Lurker News
Preferably an elegant snippet rather than an entire (well engineered) codebase.

Comments (380) 116 threads

Show all comments

Showing thread 7 of 116

labria4 replies#

  (define eval-expr
    (lambda (expr env)
      (pmatch expr
        [`,x (guard (symbol? x))
          (env x)]
        [`(lambda (,x) ,body)
          (lambda (arg)
            (eval-expr body (lambda (y)
                              (if (eq? x y)
                                  arg
                                  (env y)))))]
        [`(,rator ,rand)
         ((eval-expr rator env)
          (eval-expr rand env))])))
There's an amazing talk about it: https://www.youtube.com/watch?v=OyfBQmvr2Hc
chombier#
Once you've seen this one, it's difficult not to rank it first :)
estomagordo1 reply#
Great. In 90 minutes I may be able to know what you're talking about.
estomagordo1 reply#
Is it a complete lisp interpreter, written in lisp?
quickthrower2#
Y Combinator?