Hi all,
I just started learning to program in LISP. I stumbled upon this question when I was going through the SICP exercises.
1. The following always return b ; I suppose this is because + here is not treated as a function
(defun a-plus-abs-b (a b)
(if (> b 0) + -) a b)
2. However I can't get the following to work as well ...
(defun a-plus-abs-b (a b)
(if (> b 0) #'+ #'-) a b)
Thanks for your 'gyan' ..
Cheers,
Nanda
I just started learning to program in LISP. I stumbled upon this question when I was going through the SICP exercises.
1. The following always return b ; I suppose this is because + here is not treated as a function
(defun a-plus-abs-b (a b)
(if (> b 0) + -) a b)
2. However I can't get the following to work as well ...
(defun a-plus-abs-b (a b)
(if (> b 0) #'+ #'-) a b)
Thanks for your 'gyan' ..
Cheers,
Nanda