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

From: AndrevanTonder <andre>
Date: Sat Jan 27 11:55:08 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
Received on Sat Jan 27 2007 - 11:49:02 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC