## digitalmars.D - opCall within with

• Steve Teale (13/13) Mar 19 2009 YASQ - say I have
• Simen Kjaeraas (6/19) Mar 19 2009 Glob g = new Glob(2);
• Steve Teale (2/26) Mar 19 2009 Err, well yes,silly question, what about ((3+4))? ;-)
• Jarrett Billingsley (3/4) Mar 19 2009 No! This is a stupid idea, sorry.
• Steve Teale (2/9) Mar 19 2009 That's what ;-) meant. I just so wanted to write ((((((((12)))))))) == "...
• Jarrett Billingsley (8/21) Mar 19 2009 No. Parenthesized expressions are not call expressions.
Steve Teale <steve.teale britseyeview.com> writes:
```YASQ - say I have

class Glob
{
int a;
this(int) { a = n; }
int opCall(int n) { return n*a; }
}

Glob g = new Glob(2);
with (g)
{
// should () have any special meaning here?
int n = (3);
}
```
Mar 19 2009
"Simen Kjaeraas" <simen.kjaras gmail.com> writes:
```On Thu, 19 Mar 2009 10:05:59 +0100, Steve Teale <steve.teale britseyeview.com>
wrote:

YASQ - say I have

class Glob
{
int a;
this(int) { a = n; }
int opCall(int n) { return n*a; }
}

Glob g = new Glob(2);
with (g)
{
// should () have any special meaning here?
int n = (3);
}

Glob g = new Glob(2);
with ( g ) {
int n = 2 * ( 3 + 4 );
}

If this sets my n to 28, Imma be pissed.
```
Mar 19 2009
Steve Teale <steve.teale britseyeview.com> writes:
```Simen Kjaeraas Wrote:

On Thu, 19 Mar 2009 10:05:59 +0100, Steve Teale <steve.teale britseyeview.com>
wrote:

YASQ - say I have

class Glob
{
int a;
this(int) { a = n; }
int opCall(int n) { return n*a; }
}

Glob g = new Glob(2);
with (g)
{
// should () have any special meaning here?
int n = (3);
}

Glob g = new Glob(2);
with ( g ) {
int n = 2 * ( 3 + 4 );
}

If this sets my n to 28, Imma be pissed.

Err, well yes,silly question, what about ((3+4))?  ;-)
```
Mar 19 2009
Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
```On Thu, Mar 19, 2009 at 10:41 AM, Steve Teale
<steve.teale britseyeview.com> wrote:
Err, well yes,silly question, what about ((3+4))? =A0;-)

No!  This is a stupid idea, sorry.
```
Mar 19 2009
Steve Teale <steve.teale britseyeview.com> writes:
```Jarrett Billingsley Wrote:

On Thu, Mar 19, 2009 at 10:41 AM, Steve Teale
<steve.teale britseyeview.com> wrote:
Err, well yes,silly question, what about ((3+4))?  ;-)

No!  This is a stupid idea, sorry.

That's what ;-) meant. I just so wanted to write ((((((((12)))))))) == "sausage"
```
Mar 19 2009
Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
```On Thu, Mar 19, 2009 at 5:05 AM, Steve Teale
<steve.teale britseyeview.com> wrote:
YASQ - say I have

class Glob
{
=A0 int a;
=A0 this(int) { a =3D n; }
=A0 int opCall(int n) { return n*a; }
}

Glob g =3D new Glob(2);
with (g)
{
=A0 // should () have any special meaning here?
=A0 int n =3D (3);
}

No.  Parenthesized expressions are not call expressions.

opCall, however, would be usable:

with(g)
{
int n =3D opCall(3);
}
```
Mar 19 2009