[CM] determining existence of function

taube@uiuc.edu taube@uiuc.edu
Sat, 2 Oct 2004 09:14:03 -0500


Hmm, it looks to me that you are using CLISP (Common Lisp) not Guile (Scheme).
CM does provide some "syntactic sugar" that lets you work with Scheme style
expressions so you can keep code portable accross CM ports but it does not turn
Common LIsp (CLISP, SBCL, CMUCL, OPenMCL, etc) int Scheme!  
In particular, scheme's function-in-a-variable is scheme, not CL.

In CL, to get a function from its name do #'row->matrix

I hope this helps.


---- Original message ----
>Date: Sat, 02 Oct 2004 04:33:02 -0400
>From: Terrence Brannon <metaperl@urth.org>  
>Subject: [CM] determining existence of function  
>To: cmdist@ccrma.Stanford.EDU
>
>I defined the function row->matrix via C-x C-e and then went to the Listener and
>attempted to verify that I did by typing row->matrix into the Listener window.
>With most Schemes I have used, I get something like:
>#<function row->matrix>
>
>But with guile-scheme I got this:
>
>CM[1]>
>CM[2]>
>CM[3]> row->matrix
>
>*** - EVAL: variable ROW->MATRIX has no value
>The following restarts are available:
>STORE-VALUE    :R1      You may input a new value for ROW->MATRIX.
>USE-VALUE      :R2      You may input a value to be used instead of ROW->MATRIX.
>
>*** - UNIX error 13 (EACCES): Permission denied
>The following restarts are available:
>STORE-VALUE    :R1      You may input a new value for ROW->MATRIX.
>USE-VALUE      :R2      You may input a value to be used instead of ROW->MATRIX.
>
>Break 1 CM[4]> (pprint (row->matrix albans-row))
>
>((0 3 7 11 2 5 9 1 4 6 8 10) (9 0 4 8 11 2 6 10 1 3 5 7)
>   (5 8 0 4 7 10 2 6 9 11 1 3) (1 4 8 0 3 6 10 2 5 7 9 11)
>   (10 1 5 9 0 3 7 11 2 4 6 8) (7 10 2 6 9 0 4 8 11 1 3 5)
>   (3 6 10 2 5 8 0 4 7 9 11 1) (11 2 6 10 1 4 8 0 3 5 7 9)
>   (8 11 3 7 10 1 5 9 0 2 4 6) (6 9 1 5 8 11 3 7 10 0 2 4)
>   (4 7 11 3 6 9 1 5 8 10 0 2) (2 5 9 1 4 7 11 3 6 8 10 0))
>
>Break 1 CM[4]>
>
>====
>the fact that I can run the function implies that the C-x C-e on the function
>definition did in fact define it. However, I do not understand why I could test
>for the existence of the function by typing it into the REPL.
>
>_______________________________________________
>Cmdist mailing list
>Cmdist@ccrma.stanford.edu
>http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist