[bitc-dev] Location semantics
Sam Mason
sam at samason.me.uk
Wed May 31 12:43:52 EDT 2006
Jonathan S. Shapiro wrote:
>I have just added a section to the specification that informally
>describes the location semantics of the language. I'm sure that I messed
>some of it up, but in principle I don't think that there are any
>surprises in this section.
Hope you don't mind some naive comments.
The contents of the section look reasonable and I agree with the
comment at the end that locations shouldn't be automatically inferred.
The restriction may get annoying for parameters though, so I would
be tempted to loosen the requirement to the type of return values
only. There's also a very small typo when you give the code for
4th-elem then give the type for 5th-elem.
My main comment is about the necessity of locations. I don't see
what locations get you beyond "refs with automatic promotion". I.e.
why can't set! have the type:
set!:(fn ((ref (mutable 't)) 't) ())
and there exists some rule that automatically gets a reference to
the variable that you're setting. I don't know if this is a solved
problem but locations, as they are currently described, appear to
very similar to references.
Sam
More information about the bitc-dev
mailing list