<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16939" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New" size=2>Consider the following code extracted from
a larger piece of code:</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>#lang scheme</FONT></DIV><FONT
face="Courier New" size=2>
<DIV><BR>(define-syntax (make-box stx)<BR> (syntax-case stx ()<BR>
((_) #`#,(box 1))))</DIV>
<DIV><BR>(define my-box (make-box))</DIV>
<DIV><BR>(immutable? my-box) ; --> #t</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>The box delivered by the expander
appears to be immutable, which seems appropriate. However, I do not
understand how in this case an immutable box is produced. I checked with
check-syntax. Indeed:</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>(define my-box (make-box)) ==>
(define-values (my-box) '#&1)<BR><BR>But inspecting the expansion of
(define-syntax (make-box stx) ...) I don't see how transformer make-box produces
an immutable box.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>NB. This is not a question how to produce a
mutable box, for I could easily write</FONT></DIV>
<DIV><FONT face="Courier New" size=2>#'(box 1)) in stead of</FONT></DIV>
<DIV><FONT face="Courier New" size=2>#`#,(box 1) or even simpler:</FONT></DIV>
<DIV><FONT face="Courier New" size=2>(define (make-box) (box 1))</FONT></DIV>
<DIV><FONT face="Courier New" size=2>I am simply interested in the background
mechanism.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>Thanks, Jos</FONT></DIV></BODY></HTML>