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

newLISP the true champion of homoiconicity

Name: Anonymous 2012-11-10 10:11

Can your Lisp do this, /prog/?

(define (plus-minus a b)
  (begin
    (setf (nth '(1 2 0) plus-minus) (if (= (nth '(1 2 0) plus-minus) -) + -))
    (+ a b)))

(plus-minus 10 2)
8
(plus-minus 10 2)
12


newLISP treats code literally as data unlike Common Lisp or Scheme.

Name: Anonymous 2012-11-11 15:43

>>25

If mf is a function and m is a macro defined as:

(defmacro m (&rest args)
  (apply mf args))

Then the following are equivalent:


(m 2 3 4)
(eval (mf 2 3 4))



(m (* 5 6 (/ 7 8)) (eat apple))
(eval (mf '(* 5 6 (/ 7 8)) '(eat apple)))

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