Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Lisp is SHIT

Name: Anonymous 2011-12-07 13:05

Give me three good reasons to use Lisp or Scheme instead of C++

Name: Anonymous 2011-12-07 14:13

1. eval
2. λ
3. anus


(define x 2)
(define y 3)
(define a 0)
(eval ((λ (anus)
  (define (hax t)
     (match t
       [(regexp #rx"^(.+) *\\+ *(.+)$" `(,_ ,op1 ,op2)) `(+ ,(hax op1) ,(hax op2))]
       [(regexp #rx"^(.+) *\\* *(.+)$" `(,_ ,op1 ,op2)) `(* ,(hax op1) ,(hax op2))]
       [(regexp #rx"^([0-9.]+) *$" `(,_ ,num))           (string->number num)]
       [(regexp #rx"^([A-Za-z0-9.]+) *$" `(,_ ,lit))     (string->symbol lit)]))
  (match anus
    [(regexp #rx"^([a-zA-Z0-9]+) *= *(.+)$" `(,_ ,lhs ,rhs))
     `(set! ,(string->symbol lhs) ,(hax rhs))])
  ) "a = x+10*y"))
a
32

Your move.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List