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

Ruby

Name: Anonymous 2011-03-14 6:23

Is Ruby an acceptable Lisp? It has everything you need except macros.

Name: Anonymous 2011-03-14 8:47

>>13
Now it does.

(module lithp racket/base
  (require (for-syntax racket/base))
  (provide #%module-begin #%datum quote
           #%plain-lambda define-values λ
           define #%app #%top)
 
  (define-syntax (#%app stx)
    (syntax-case stx ()
      ((#%app f x) #'(#%plain-app f x))
      ((#%app f x y ...) #'(#%app (#%app f x) y ...))))
  (define-syntax (λ stx)
    (syntax-case stx ()
      ((λ (x) . b)
       #'(#%plain-lambda (x) . b))
      ((λ (x y ...) . b)
       #'(#%plain-lambda (x) (λ (y ...) . b)))))
  (define-syntax (define stx)
    (syntax-case stx ()
      ((define (f x ...) . b)
       #'(define f (λ (x ...) . b)))
      ((define x y)
       #'(define-values (x) y)))))

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