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

padovani josepadovani at yahoo.com.br
Mon Aug 20 17:08:57 PDT 2007


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 # :FOR
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 = (next nts)
             for r = (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 =
;                 (CM:NEXT CM::NTS) CM::FOR CM::R = (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é H. Padovani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20070820/0ffcac38/attachment.html>


More information about the Cmdist mailing list