I've been using Gambit Scheme as my primary language for about a year now, and I'm finding it pretty much the best for what I'm doing. However, the one thing that I find lacking is read- macros: Why doesn't Scheme have an equivalent to CL's set-macro-char and the like? It seems to me that you can do lots of interesting things with them that you couldn't do otherwise.
Does anyone know of a way to do something equivalent to the following CL in Gambit? I suspect that there's some way to do it using readtables...but I have no idea how..
(set-macro-character #] (get-macro-character #)))
(set-dispatch-macro-character ## #[ #'(lambda (stream char1 char2) (let ((accum nil) (pair (read-delimited-list #] stream t))) (do ((i (ceiling (car pair)) (1+ i))) ((> i (floor (cadr pair))) (list 'quote (nreverse accum))) (push i accum)))))
Thanks for your time, any help is appreciated!
James
Afficher les réponses par date