dual with statement

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 25 14:10:55 PDT 2014


On Friday, 25 July 2014 at 01:54:53 UTC, Jay Norwood wrote:
> On Thursday, 24 July 2014 at 20:16:53 UTC, monarch_dodra wrote:
>>
>> Or did I miss something?
>
> Yes, sorry, I should have pasted a full example previously. The 
> code at the end is with the Raw_met members renamed (they were 
> originally a and b but clashed).
>
> So, if Raw_met members were still a and b ...
>   with(ar.r as v) with (ar.rm as res){
>      res.a = v.a + v.c;
>      res.b = (v.c==0)? 0: (v.a + v.b)/ v.c;
>
> I don't recall the exact use case for the database expressions, 
> but I believe they were substituting a simple symbol for the 
> fully qualified object. So they would have done something 
> analogous to this ...

Isn't:
with(foo.bar as baz) { ... }

Functionally nothing more than an alias? EG:
{
     alias baz = foo.bar;
     ...
}

Or mix of both. I don't see a need for "as".


More information about the Digitalmars-d-learn mailing list