Un-named Intrepreted Functions Question
Posted: Thu Mar 13, 2014 4:28 pm
This may be a really dumb question, but in the code below, what the heck is *d*?!!
I understand that *d*'s function value is set to the lambda form, but it really isn't a named function:
So just what should I call *d*? Thanks.
Code: Select all
(setq *d* (λ(r)(* 2 pi r))) ;; just an identifier picked at random, the lambda form is the formula for circumference
(funcall *d* 4) ;; the λ form is applied to 4, its missing argument
(*d* 3) ;; *d* is a not a function; evaluating this will cause an undefined function error
(functionp #'*d*) ;; undefined function error, again
(describe *d*) ;; #<FUNCTION :LAMBDA (R) (* 2 PI R)> is an interpreted function.|Argument list: (R)|; No values
(type-of *d*) ;; FUNCTION
Code: Select all
(defun circumference(r)(* 2 pi r))
(circumference 4)
(functionp #'circumference) ;; T