www.digitalmars.com         C & C++   DMDScript  

D - with(struct)

reply Patrick Down <pat codemoon.com> writes:
Ok maybe I'm just being lazy but I can't
put a struct in a with statment?

struct Foo
{
  int a;
}

Foo b;

with(b)
{
  a = 2;
}
May 21 2002
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"Patrick Down" <pat codemoon.com> wrote in message
news:Xns92164F7FB434patcodemooncom 63.105.9.61...

 Ok maybe I'm just being lazy but I can't
 put a struct in a with statment?
Earlier, on my similar comment, Walter said that "it is an interesting idea"... =)
May 22 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
I thought that was what the with statement was for?

Sean

"Pavel Minayev" <evilone omen.ru> wrote in message
news:acfrqa$g6v$1 digitaldaemon.com...
 "Patrick Down" <pat codemoon.com> wrote in message
 news:Xns92164F7FB434patcodemooncom 63.105.9.61...

 Ok maybe I'm just being lazy but I can't
 put a struct in a with statment?
Earlier, on my similar comment, Walter said that "it is an interesting idea"... =)
May 22 2002
parent Patrick Down <pat codemoon.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in news:acgk9h$17a2$1
 digitaldaemon.com:

 I thought that was what the with statement was for?
 
It works with object references but not structs.
May 22 2002