Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define naravna (letrec([f (lambda(x) (cons x (lambda() (f(+ x 1)))))])
- (f 1)))
- (define skoki (letrec([f (lambda(x) (cons x (lambda() (f(cond [(= x 0) 1] [(= x 1) 2] [(= x 2) 0])) )))])
- (f 1)))
- ;samostojno
- (define (preskocni tok skoki)
- (letrec([f (lambda(x y) (cons (car x) (lambda() (f (letrec(
- [l (lambda(a b) (cond
- [(> b 0) (l ((cdr a)) (- b 1)) ]
- [else a]))])
- (l x (car y))) ((cdr skoki)) ))))])
- (f tok skoki)))
- ;priprava na kolokvij
- (define (preskocni tok skoki)
- (letrec([f (lambda(t x) (if(= x 0) (car t) (f ((cdr t)) (- x 1)) ))])
- cons (car tok) (lambda() (preskocni (f((cdr tok)) (car skoki)) ((cdr skoki)) )))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement