Mitko_jos

drapanje_madinja

Feb 27th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.68 KB | None | 0 0
  1. ;2ra LISP
  2. (SETQ X(CAR '(A B C)))
  3. (PRINT X)
  4. (SETQ Y(CAR '(E F R)))
  5. (PRINT Y)
  6. (SETQ Z(CAR '(H J P)))
  7. (PRINT Z)
  8. (SETQ K(CONS X(CONS Y(CONS Z NiL))) )
  9. (PRINT K)
  10.  
  11.  
  12. ;3ta
  13. (SETQ X '(1 2 3 4 ))
  14. (SETQ N 10)
  15. (PRINT (LIST (CAR X) (CAR (CDR X)) N (CAR (CDDDR X))))
  16.  
  17.  (print (cons (cons 'A(cons (cons 'B nil) nil)) (cons 'B (cons 'c nil))))
  18.  
  19.  
  20. (PRINT(LIST (LIST 'A (LIST 'B)) 'B 'C))
  21.  
  22. (print (LIST (CAR '(1 2 3)) (CAR '(4 5 6))))
  23.  
  24.  
  25.  
  26. (setq x '(1 2 3 4 5))
  27. (* (car x) (car (cdr (cdr x))))
  28. (* (car x) (car (cdr (cdr x))) (car(cdr(cdr(cdr(cdr x))))) )
  29.  
  30. (setq x '(1 2 3))
  31.  
  32. (setq y '(4 5 6))
  33.  
  34. (append x y)
  35.  
  36. (reverse x)
  37.  
  38. (last x)
  39.  
  40.  
  41. (setq x '(1 2 3 4))
  42.  
  43. (append x (cdr (reverse x)))
Advertisement
Add Comment
Please, Sign In to add comment