Advertisement
Guest User

Untitled

a guest
May 4th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.48 KB | None | 0 0
  1. ;; normal scheme way
  2. (let ((x "one\n"))
  3.   (display x)
  4.   (set! x "omg\n")
  5.   (let-values (((first second . rest)
  6.                 (list "first" "second" "third" "fourth")))
  7.     (let ((x "two\n"))
  8.       (display x))
  9.     (display x)))
  10.  
  11. ;; ugly let* trick
  12. (let*-values
  13.     (((x) "one")
  14.      (_ (display x))
  15.      ((x) "omg\n")
  16.      ((first second . rest)
  17.       (list "first" "second" "third" "fourth"))
  18.      (_ (let ((x "two\n"))
  19.           (display x))))
  20.   (display x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement