[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Proposal] .name global indexing (Was: Re: 'with' statement)
- From: Coda Highland <chighland@...>
- Date: Thu, 10 Mar 2016 07:55:47 -0800
On Thu, Mar 10, 2016 at 2:42 AM, Soni L. <fakedme@gmail.com> wrote:
>
>
> On 10/03/16 05:09 AM, Thijs Schreijer wrote:
>>>
>>> I never thought I'd say this, but I like the way Visual Basic 6 does it:
>>> with foo
>>> .x = 1
>>> .y = some_local_var
>>> end with
>>> I don't remember the exact syntax, but the important part is you still
>>> included the dot from foo.x, so that distinguished properties from other
>>> variables in outer scopes.
>>
>> While reading up the thread, I had the same thought. I also like that
>> about VB.
>>
>> Thijs
>
> This can be implemented with .name as being a global access. But you'll need
> to end your lines with a ;.
>
> e.g.
>
> do local _ENV = something;
> .a = 1;
> .b = 2;
> end
>
> --
> Disclaimer: these emails may be made public at any given time, with or
> without reason. If you don't agree with this, DO NOT REPLY.
>
At this point you might as well use _.a = 1 and then you no longer
even need a with statement.
/s/ Adam