shortcuts for defining block-local private names, plays nicely with @foo syntax
Herby Vojčík
herby at mailbox.sk
Sun Jan 22 02:01:37 PST 2012
Brendan Eich wrote:
> And _the_real_foo should be expanded:
>
> {
> private foo;
> ...
> }
>
> desugars to
>
> {
> const foo = Name.create("foo");
> ...
> }
>
> with Name.create imported appropriately.
No, I though more in lines of:
// singleton code, in module level / program level
// generated from all private occurences:
const __prvTable__ = Name.create();
// __prvTable__ being hardwired somehow so it does not clash
// and of course hidden from user
@__prvTable__ = [
Name.create(),
Name.create(),
... // n times when n is number of privates
];
// and the bocks desugared to
{
const foo = module. at __prvTable__[42];
// module. at __prvTable__ is just a hint for
// "somehow, get to the private table"
// it is up to implementation
// 42 is just the example index
...
}
with Name.create imported appropriately.
> /be
Herby
More information about the es-discuss
mailing list