Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TXR Lisp: mlet (magic/mutual let), lnew (lazy new), lcons (lazy cons);

  1> (mlet ((z (+ x y))
            (y (succ x))
            (x 42))
       (list x y z))
 (42 43 85)

  2> (mlet ((z (+ x y))
            (y (succ x))
            (x (* z 2)))
       (list x y z))
  ** (expr-2:1) force: recursion forcing delayed form (* z 2) (expr-2:3)
  3> (flip *print-circle*)
  t
  4> (defstruct node () next prev)
  #<struct-type node>
  5> (mlet ((n (lnew node next n prev n))) n)
  #1=#S(node next #1# prev #1#)
  6> (mlet ((c (lcons 1 c))) c)
  #1=(1 . #1#)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: