Racket:参数是非null错误

时间:2016-01-23 21:16:02

标签: eval racket quote

首先,我将HALFQUARTEREIGHT定义为define的值,然后引用的符号将作为{{1}中的参数引入函数因此产生错误。然后我使用note,现在我收到了错误

let

我的理论是,流仍将stream-rec->C: argument is not non-null `stream-rec' pointer argument: #f 作为HALF而不是'HALF处理。我尝试将其放入30000中的eval列表,note random-length绑定中letrandom-note中的#lang racket (require rsound rsound/piano-tones) ;Where notes are made. (define stream (make-pstream)) (define count 10000) (define (note y x) (pstream-queue stream (clip (piano-tone y) 0 20000) count) (set! count (+ count x))) ;Defining length of notes. (let ([HALF 30000]) 30000) (let ([QUARTER 15000]) 15000) (let ([EIGHT 7500]) 7500) (define (random-element list) (list-ref list (random (length list)))) ;Getting a random note length. (define (random-length) (random-element '(HALF QUARTER QUARTER EIGHT))) ;Getting a random note and note length. (define (random-note) (note (random-element '(40 42 43 45 47 48 50 52 54 55 57 59 60 62 64)) (random-length))) ;Main loop for creating the notes. (for ([i (in-range 32)]) (random-note)) ;For the program not to close itself before runing loop, only after pstream- queue is emptied. (define ok-to-exit? #f) (pstream-queue-callback stream (lambda () (set! ok-to-exit? #t)) count) (let loop () (sleep 0.1) (unless ok-to-exit? (loop))) 列表中。我该怎么办?

package = "testrock"
version = "scm-1"

source = ...
description = ...
dependencies = ...

build = {
   type = "none",
   install = {
       lua = {
           "testrock.lua",
           "foo.lua"
       }
   }
}

0 个答案:

没有答案