[Grace-core] [Minigrace] minor nits - should imports be inherited
Andrew P Black
black at cs.pdx.edu
Fri Nov 29 09:38:52 PST 2013
On 28 Nov 2013, at 22:06 , Michael Homer <mwh at ecs.vuw.ac.nz> wrote:
> I don't think it's a significant problem. It only appears when client
> code wants to declare a variable by the same name as the dialect does,
> which is fairly easily avoidable on both sides (or definitely an
> error).
The problem is that the dialect may use internal names, which are not part of its interface, and
appropriately flag them as local — but then programs written in the dialect can't use them. The list of things
that they can't use is dependent on the current implementation of the dialect. Not good!
> For imports specifically it's prevented if they aren't made available
> to the client, which I still think is the right thing to do anyway.
> You can think of the names bound by import as being in another scope,
> or aliases, so that they never leak into clients.
>
> It might still be worth punting the rule into dialects anyway. We get
> the most power by making the very core language as unrestricted as
> possible, just like we did with types, and I don't see much downside.
I think that final paragraph is saying the same as the following comment from James:
On 28 Nov 2013, at 21:53 , James Noble <kjx at ecs.vuw.ac.nz> wrote:
> I have a folk memory of us agreeing to move that out of the core &
> Into a dialect
I don't have that memory, but did come to the same conclusion myself last night, while I was asleep.
The "core language" should allow shadowing. The beginning and intermediate student dialects can
disallow shadowing by means of a checker. This gives us the best of both worlds, I think.
Andrew
More information about the Grace-core
mailing list