[plt-scheme] Is it possible to define ' ` , like syntax?
Sorry, you are right. I copy/pasted the piece of code and forgot to replace
'lazy' by 'dance'.
Jos
((((lambda(x)((((((x x)x)x)x)x)x))
(lambda(x)(lambda(y)(x(x y)))))
(lambda(x)(write x)x))
'greeting)
----- Original Message -----
From: "Majorinc, Kazimir" <kazimir at chem.pmf.hr>
To: "PLT-list" <plt-scheme at list.cs.brown.edu>
Sent: Tuesday, December 11, 2007 6:30 AM
Subject: Re: [plt-scheme] Is it possible to define ' ` , like syntax?
> Thanks Jos and Anton. (Also, thanks to all who answered on my previous
> question on printing procedures, I'll use some of the solutions.) Jos, if in
> your code 'lazy is replaced with 'dance, it appears to work even recursively.
> But I'm not sure. Is it true? What is the purpose of 'lazy and how it is
> understood, but only once?
>
> ;;;;;;;;;;;;;;;;;;
> (define read-odd-char
> (case-lambda
> ((ch port src line col pos)
> #`(dance #,(read/recursive port #f (current-readtable))))
> ((ch port)
> (list 'lazy (read/recursive port #f (current-readtable))))))
>
> (current-readtable
> (make-readtable #f
> #\° 'terminating-macro read-odd-char))
>
> (define dance sqrt)
>
> °4 ; ==> 2 --OK
> (+ °9 °16) ; ==> 7 --OK
> °(+ 9 16); ==> 5 --OK
> °(+ °9 °16); ==> reference to undefined identifier: lazy
>
> ;;;;;;;;;;;;;;;;
> If 'lazy is changed to 'dance, it appears it works.
>
> --
> Kazimir Majorinc
>
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>