I implemented 'cond*'

37 views
Skip to first unread message

lisp...@gmail.com

unread,
Nov 2, 2010, 1:16:07 AM11/2/10
to Lisphp
Please check my 'cond*'(but 'else' syntax is not include)

and show another solution if you can

(define cond*
[macro (if(= 1 (eval (car (car #arguments))))
(eval (car (cdr (car #arguments))))
(if (= 1 (eval (car (car (cdr #arguments)))))
(eval (car (cdr (car (cdr #arguments)))))
(car (car (cdr (cdr #arguments))))
)

"test --------"

(define a 3)
(define b (+ a 1))
(echo (cond* ((= a 4) 6)
((= b 4) (+ 6 7 a))
(25)
)
)
Reply all
Reply to author
Forward
0 new messages