[r6rs-discuss] [Formal] (r6rs base) must also export _ and ... at level 1

AndrevanTonder andre at het.brown.edu
Sat Jan 27 11:49:02 EST 2007


On Fri, 26 Jan 2007, R. Kent Dybvig wrote:

>>> That's incorrect, even if one ignores the likelihood that implementations
>>> will provide traditional interactive environments.  They can be stomped on
>>> by local bindings, which is what I think is most likely:
>>>
>>>  (define foo
>>>    (lambda (fields)
>>>      ---
>>>      (let (---)
>>>        (define-record-type foo (fields (mutable x)))  => syntax violation
>>>        ---)))
>>
>> ...
>
> I agree, but I was not suggesting that we leave 'fields' and other
> define-record-type noise words unbound while still using free-identifier=?
> for the comparison; rather, I am suggesting that we weight the costs and
> benefits of treating the noise words as symbols, i.e., leaving them
> unbound but comparing them symbolically.

I understand now.

Let me mention in this regard that, given the abilities of syntax-case, an 
implementation that binds the noise words in the exporting library can easily 
detect local shadowing such as in the above example and print a warning 
message.  This way the error in your example would no longer be mysterious and, 
at the same time, one would regain the ability to rename/translate/exclude the 
noise words.

By the way, a nice example of the utility of being able to exclude one of the 
literals:  A teacher wishing to enforce students to write in purely 
functional style may wish to exclude the "mutable" keyword.

Andre



More information about the r6rs-discuss mailing list