[CM] Scheme - cm 3.6.0 beta

Adam ahcnz at ihug.co.nz
Wed Apr 21 00:11:21 PDT 2010


Thanks again.  Quasiquotation  which I find in R5RS  section 4.2.6 
and now understand. Beaut. 

Could you help with this example below?  My Scheme is going 
well, but this has me stumped. 

Run first with the 4 comments in place, and then remove 
the 4 comments to see the problem. 

Error is that argument sf1 is symbol but should be pair (list). 
>From the predicates below, it seems sf1 sf2 morph from list 
to symbol inside the process.   
 

;                               name      channels  duration 
(define sf1 '("\"C:/sampledir/samp1.wav\""  2        10))
(define sf2 '("\"C:/sampledir/samp2.wav\""  1        32))
; -----
(define (type-samps samps)
        (process for smp in samps
;              for sname = (nth smp 0)
;              for sch = (nth smp 1)
;              for sdur = (nth smp 2)
                do 
                 (print smp "  list?   " (list? smp))
                 (print smp " symbol?  " (symbol? smp))
;                 (print smp sname sch sdur)
                 (newline) ))

(sprout (type-samps '(sf1 sf2)))

; -----

(nth sf1 0)
(nth sf1 1)
(nth sf1 2)

(print 'sf1 "  list?   " (list? sf1))
(print 'sf1 " symbol?  " (symbol? sf1))





More information about the Cmdist mailing list