# Dear list and Mr. Taube<div># I want to use Grace with Scheme rather than SAL. I am using version 3.3.0 svn:1769. I looked at the "SAL tutorials" and tried to convert them to Scheme code. But I think some SAL commands does not exist in Scheme version. Like:</div>
<div><br></div><div>print "Hello, world!" -> (print "Hello, world!")</div><div># gives "print: unbound variable" error. I can just evaluate</div><div>"Hello, world!"</div><div># or try</div>
<div>(display "Hello, world!")</div><div># But the output of (display) is yellow, not green and does not have "\n" character at the end.</div><div><br></div><div>print "my key number: ", between(60, 90) -> (display "my key number: " (between 60 90))</div>
<div># gives "display argument 2, 66, is an integer, but should be an output port" error. I have to write</div><div>(string-append "my key number: " (number->string (between 60 90)))</div><div><br>
</div><div><br></div><div># Another component I could not find (which is, I think, more important) is the loop macro.</div><div><div>loop repeat 5</div><div> print "a random keynum: ", random(128)</div><div>end</div>
<div>---></div><div><div>(loop repeat 5</div><div> (random 128))</div><div># gives: >>> Error: Found 'repeat' where operator expected.</div><div>clause context: 'repeat 5 (random 128)'</div>
<div><br></div><div># and</div><div><br></div><div><div>loop for c in {a b c d e f g }</div><div> print c</div><div>end</div><div>---></div><div><div>(loop for c in '(a b c d e f g)</div><div> (display c))</div>
<div># gives: >>> Error: Expression expected but source code ran out.</div><div><br></div><div># Similarly,</div><div><div>loop for x from 1 to 10</div><div> print "x=", x</div><div>end</div><div>----></div>
<div><div>(loop for x from 1 to 10</div><div> x)</div><div># gives the same error.</div></div></div><div><br></div></div></div><div># Of course a recursive approach using car's and cdr's works.</div><div>(define (play-chord chd)</div>
<div> (if (not (equal? chd '()))</div><div> (begin (send "mp:midi" :key (car chd))</div><div> (play-chord (cdr chd)))))</div><div>(play-chord '(50 55 60))</div><div># But I think that the loop macro is not implemented in Grace. Am I correct or making a mistake?</div>
<div><br></div></div><div># Best regards,</div><div>-ugur guney-</div></div>