[CM] "; There is no class named RANDOM."

padovani josepadovani@yahoo.com.br
Mon, 20 Aug 2007 21:08:57 -0300


------=_Part_82197_6955559.1187654937189
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi, I'm studying the last chapter of "Notes from the Metalevel" and I am
getting some errors...

In chapter 20, when I try to evaluate the lines

"
(new heap :of  (list (new cycle :of 'q :for 3)
               (new palindrome :of '(e. s e))
               (new random :of '(h w h.) :for 1)))
"

I get:



"
There is no class named RANDOM.
   [Condition of type SIMPLE-ERROR]

Restarts:
  0: [ABORT-REQUEST] Abort handling SLIME request.
  1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "worker" {B96CB41}>=
)

Backtrace:
  0: (SB-PCL::FIND-CLASS-FROM-CELL RANDOM NIL T)
  1: ((LAMBDA (#:WHOLE593 #:ENVIRONMENT594)) (NEW RANDOM :OF (QUOTE (H W
H.)) :FOR 1) #<unavailable argument>)
  2: (MACROEXPAND-1 (NEW RANDOM :OF (QUOTE (H W H.)) :FOR 1) #<NULL-LEXENV>=
)
  3: (MACROEXPAND (NEW RANDOM :OF (QUOTE (H W H.)) :FOR 1) #<NULL-LEXENV>)
  4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (NEW RANDOM :OF (QUOTE (H W H.)) :FOR 1)
#<NULL-LEXENV>)
  5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LIST (NEW CYCLE :OF (QUOTE Q) :FOR 3)
(NEW PALINDROME :OF (QUOTE #)) (NEW RANDOM :OF (QUOTE #) :FOR 1))
#<NULL-LEXENV>)
  6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (NEW HEAP :OF (LIST (NEW CYCLE :OF # :FO=
R
3) (NEW PALINDROME :OF #) (NEW RANDOM :OF # :FOR 1))) #<NULL-LEXENV>)
  7: ((LAMBDA NIL))
  8: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-SYNTAX-HOOKS (T))
#<unused argument> #<unused argument> #<CLOSURE (LAMBDA NIL) {B939E65}>)
 --more--
"

and in chapter 24, when I try to evaluate the CMN example

"
(define (duet-cmn stf len nts)
  (let ((nts (new heap :notes nts))
        ;; choose quarter or two eighths
        (rhy (new random
               :of `(1 ,(new cycle :of '(1/2 1/2))))))
    (process while (< (now) len)
             for n =3D (next nts)
             for r =3D (next rhy)
             output (new midi :time (now)
                         :duration r
                         :keynum n
                         :channel stf) ; link to cmn staff
             wait r)))"

I get:

"
; in: LAMBDA NIL
;     (CM:NEW RANDOM :OF `(,1 ,(CM:NEW CM:CYCLE :OF '(1/2 1/2))))
;
; caught ERROR:
;   (in macroexpansion of (NEW RANDOM :OF ...))
;   (hint: For more precise location, try *BREAK-ON-SIGNALS*.)
;   There is no class named RANDOM.

;     (LET ((CM::NTS (CM:NEW CM:HEAP :NOTES CM::NTS))
;         (CM::RHY (CM:NEW RANDOM :OF `(,1 ,#))))
;     (CM:PROCESS CM::WHILE (< (CM:NOW) CM::LEN) CM::FOR CM::N =3D
;                 (CM:NEXT CM::NTS) CM::FOR CM::R =3D (CM:NEXT CM::RHY)
CM:OUTPUT
;                 ...))
;
; note: deleting unreachable code
;
; note: deleting unreachable code
;
; compilation unit finished
;   caught 1 ERROR condition
;   printed 2 notes
"
 it seems to be the same error but as I am a newbie I have no idea about
what is wrong...
Tx if anyone can help,
Jos=E9 H. Padovani

------=_Part_82197_6955559.1187654937189
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi, I&#39;m studying the last chapter of &quot;Notes from the Metalevel&quo=
t; and I am getting some errors...<br><br>In chapter 20, when I try to eval=
uate the lines<br><br>&quot;<br>(new heap :of&nbsp; (list (new cycle :of &#=
39;q :for 3)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; (new palindrome :of &#39;(e. s e))<br>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (new random :=
of &#39;(h w h.) :for 1)))<br>&quot;<br><br>I get:<br><br><br><br>&quot;<br=
>There is no class named RANDOM.<br>&nbsp;&nbsp; [Condition of type SIMPLE-=
ERROR]
<br><br>Restarts:<br>&nbsp; 0: [ABORT-REQUEST] Abort handling SLIME request=
.<br>&nbsp; 1: [TERMINATE-THREAD] Terminate this thread (#&lt;THREAD &quot;=
worker&quot; {B96CB41}&gt;)<br><br>Backtrace:<br>&nbsp; 0: (SB-PCL::FIND-CL=
ASS-FROM-CELL RANDOM NIL T)
<br>&nbsp; 1: ((LAMBDA (#:WHOLE593 #:ENVIRONMENT594)) (NEW RANDOM :OF (QUOT=
E (H W H.)) :FOR 1) #&lt;unavailable argument&gt;)<br>&nbsp; 2: (MACROEXPAN=
D-1 (NEW RANDOM :OF (QUOTE (H W H.)) :FOR 1) #&lt;NULL-LEXENV&gt;)<br>&nbsp=
; 3: (MACROEXPAND (NEW RANDOM :OF (QUOTE (H W H.)) :FOR 1) #&lt;NULL-LEXENV=
&gt;)
<br>&nbsp; 4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (NEW RANDOM :OF (QUOTE (H W H.)=
) :FOR 1) #&lt;NULL-LEXENV&gt;)<br>&nbsp; 5: (SB-INT:SIMPLE-EVAL-IN-LEXENV =
(LIST (NEW CYCLE :OF (QUOTE Q) :FOR 3) (NEW PALINDROME :OF (QUOTE #)) (NEW =
RANDOM :OF (QUOTE #) :FOR 1)) #&lt;NULL-LEXENV&gt;)
<br>&nbsp; 6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (NEW HEAP :OF (LIST (NEW CYCLE =
:OF # :FOR 3) (NEW PALINDROME :OF #) (NEW RANDOM :OF # :FOR 1))) #&lt;NULL-=
LEXENV&gt;)<br>&nbsp; 7: ((LAMBDA NIL))<br>&nbsp; 8: ((SB-PCL::FAST-METHOD =
SWANK-BACKEND:CALL-WITH-SYNTAX-HOOKS (T)) #&lt;unused argument&gt; #&lt;unu=
sed argument&gt; #&lt;CLOSURE (LAMBDA NIL) {B939E65}&gt;)
<br>&nbsp;--more--<br>&quot;<br><br>and in chapter 24, when I try to evalua=
te the CMN example<br><br>&quot;<br>(define (duet-cmn stf len nts)<br>&nbsp=
; (let ((nts (new heap :notes nts))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; ;; choose quarter or two eighths<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (rhy (new random<br>&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :o=
f `(1 ,(new cycle :of &#39;(1/2 1/2))))))<br>&nbsp;&nbsp;&nbsp; (process wh=
ile (&lt; (now) len)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; for n =3D (next nts)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for r =3D (next rhy)<br>&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; output (n=
ew midi :time (now)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :=
duration r<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; :keynum n<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; :channel stf) ; link to cmn staff<br>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wait r)))&quot;<br><br>=
I get:<br><br>&quot;<br>; in: LAMBDA NIL<br>
;&nbsp;&nbsp;&nbsp;&nbsp; (CM:NEW RANDOM :OF `(,1 ,(CM:NEW CM:CYCLE :OF &#3=
9;(1/2 1/2))))<br>; <br>; caught ERROR:<br>;&nbsp;&nbsp; (in macroexpansion=
 of (NEW RANDOM :OF ...))<br>;&nbsp;&nbsp; (hint: For more precise location=
, try *BREAK-ON-SIGNALS*.)<br>;&nbsp;&nbsp; There is no class named RANDOM.
<br><br>;&nbsp;&nbsp;&nbsp;&nbsp; (LET ((CM::NTS (CM:NEW CM:HEAP :NOTES CM:=
:NTS))<br>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (CM::RHY (CM:NE=
W RANDOM :OF `(,1 ,#))))<br>;&nbsp;&nbsp;&nbsp;&nbsp; (CM:PROCESS CM::WHILE=
 (&lt; (CM:NOW) CM::LEN) CM::FOR CM::N =3D<br>;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (CM:NE=
XT CM::NTS) CM::FOR CM::R =3D (CM:NEXT CM::RHY) CM:OUTPUT
<br>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; ...))<br>; <br>; note: deleting unreachable code=
<br>; <br>; note: deleting unreachable code<br>; <br>; compilation unit fin=
ished<br>;&nbsp;&nbsp; caught 1 ERROR condition<br>;&nbsp;&nbsp; printed 2 =
notes<br>&quot;<br>&nbsp;it seems to be the same error but as I am a newbie=
 I have no idea about what is wrong...
<br>Tx if anyone can help,<br>Jos=E9 H. Padovani<br>

------=_Part_82197_6955559.1187654937189--