Happy !

zeroflag / Lisph

Project infos

License MIT
Tags
Creation date 2013-07-18
Website

Monticello registration

About Lisph

Just a tiny experimental lisp interpreter inspired by http://norvig.com/lispy.html

'(do
    (defn factorial (n) 
        (if (<= n 2)
            n
            (* n (factorial (- n 1)))))
    (factorial 50))' evalLisph.

30414093201713378043612608166064768844377641568960512000000000000

'(do
    (defn even? (n)
        (zero? (rem n 2)))
    (filter even? (quote (1 2 3 4 5 6))))' evalLisph.

(2 4 6)

(defmacro if-not 
    (fn (test success fail)
        `(if ~test ~fail ~success)))
'(let 
    (morph (class :PluggableButtonMorph :new)
    size (class :Point :x 150 :y 40)
    center (class :Point :x 800 :y 600))
    (do
        (send! morph :extent size)
        (send! morph :center center)
        (send! morph :label "hello")        
        (send! morph :actionBlock 
            (fn (event) 
                (send! morph :label "pressed")))
        (send! morph :openInWorld)))' evalLisph.