walter@pelissero.org (Walter C. Pelissero) writes:
> expands to a single argument lambda expression. So that I can do things like:
>
> (map [/ _ 2] '(2 4 6 8 10))
> (cond ((regexp-exec r) => [match:substring _ 1]) ...)
>
> instead of
>
> (map (lambda (x) (/ x 2)) '(2 4 6 8 10))
> (cond ((regexp-exec r) => (lambda (m) (match:substring m 1))) ...)
>
> After a few minutes of searching I found out that Scheme48 has surprising
> similarities with CL when it comes to syntax macros. So here is the trick:
>
i would like to try it.
> --- /usr/home/wcp/Projects/others-cvs/scsh/scsh/scsh/scsh-read.scm Fri Aug 6
> 14:28:02 1999
> +++ scsh/scsh-read.scm Thu Jan 31 17:40:09 2002
> @@ -29,6 +29,15 @@
>
> (define-sharp-macro #\! script-skip)
>
> +;;; Arc à la carte (set-standard-read-macro! #\[ #t (lambda (c port) (list
> +'lambda '(_) (sub-read-list c port)))) (set-standard-read-macro! #\] #t
> (lambda
> +(c port) c port close-paren))
> +
>
i added these lines in scsh/scsh-read.scm:
;;; Arc à la carte
(set-standard-read-macro! #\[ #t
(lambda (c port)
(list
'lambda '(_) (sub-read-list c port))))
(set-standard-read-macro! #\] #t
(lambda (c port)
c port close-paren))
made:
$ make clean # i tried distclean, too
$ make
but it does not work:
scsh/scsh-0.6 $./go
Welcome to scsh 0.6.1 (Combinatorial Algorithms)
Type ,? for help.
> (map [/ _ 2] '(2 4 6 8 10))
Error: illegal character read
#\[
#{Input-fdport #{Input-channel "standard input"}}
>
Can you tell me, how you got it to work?
|