[CM] build clm-4
Pascal J. Bourguignon
pjb at informatimago.com
Fri May 24 10:22:26 PDT 2013
"Bill Schottstaedt"
<bil at ccrma.Stanford.EDU> writes:
> You can get that error if you type
>
> (with-sound () fm-violin 0 1 440 .1)
>
> which strikes me as odd -- surely fm-violin is defined?
> Or is this related to the fact that fm-violin is a function
> so it's undefined when used as a variable?
>
> * (defun hi (a) a)
>
> HI
> * hi
>
> debugger invoked on a UNBOUND-VARIABLE in thread
> #<THREAD "main thread" RUNNING {10029F92B3}>:
> The variable HI is unbound.
>
> I'm forgetting what little CL I ever knew...
Common Lisp is a lisp-2: it distinguishes the variable namespace from
the function namespace. defun defines a function. To get it, you just
use the CL:FUNCTION special operator:
CL-USER> (defun hi (a) a)
HI
CL-USER> (function hi)
#<FUNCTION HI (A) (DECLARE (SYSTEM::IN-DEFUN HI)) (BLOCK HI A)>
CL:LET defines a variable. To get its value, you would just evaluate
it:
CL-USER> (let ((hi 42))
hi)
42
CL-USER> (let ((hi 42))
(list (quote hi) hi (function hi)))
(HI 42 #<FUNCTION HI (A) (DECLARE (SYSTEM::IN-DEFUN HI)) (BLOCK HI A)>)
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
You can take the lisper out of the lisp job, but you can't take the lisp out
of the lisper (; -- antifuchs
More information about the Cmdist
mailing list