On Sun, 08 Jan 2012 12:54:13 -0500, Ben Davis ent...@cantab.net wrote:
Hi,
Is there a reason 'ref' is disallowed for local variables? I want to
write something like:
MapTile[] map; // It's a struct
ref MapTile tile=map[y*w+x];
tile.id=something;
tile.isWall=true;
My actual case is more
Steven Schveighoffer:
With new = syntax (in git head), this would probably be:
@property ref tile = map[y*w+x];
That's not currently supported:
http://d.puremagic.com/issues/show_bug.cgi?id=7176
Bye,
bearophile
On Mon, 09 Jan 2012 09:27:06 -0500, bearophile bearophileh...@lycos.com
wrote:
Steven Schveighoffer:
With new = syntax (in git head), this would probably be:
@property ref tile = map[y*w+x];
That's not currently supported:
http://d.puremagic.com/issues/show_bug.cgi?id=7176
The given
Hi,
Is there a reason 'ref' is disallowed for local variables? I want to
write something like:
MapTile[] map; // It's a struct
ref MapTile tile=map[y*w+x];
tile.id=something;
tile.isWall=true;
My actual case is more complicated, so inlining the expression
everywhere would be messy. I
MapTile[] map; // It's a struct
ref MapTile tile=map[y*w+x];
tile.id=something;
tile.isWall=true;
MapTile* tile = map[y*w+x];
Sorry, didn't read the rest. ^^
On 08.01.2012 18:54, Ben Davis wrote:
Hi,
Is there a reason 'ref' is disallowed for local variables? I want to
write something like:
MapTile[] map; // It's a struct
ref MapTile tile=map[y*w+x];
tile.id=something;
tile.isWall=true;
My actual case is more complicated, so inlining the
I also meant to say: 80x25? Epic :D
On 08/01/2012 20:25, Ben Davis wrote:
There are two things going on in your example:
1. Use of 'auto' where I'm currently having to write 'MapTile*' and
wanted to write 'ref MapTile'. It will infer 'MapTile*'. Or, if you
forget the , then it will infer
There are two things going on in your example:
1. Use of 'auto' where I'm currently having to write 'MapTile*' and
wanted to write 'ref MapTile'. It will infer 'MapTile*'. Or, if you
forget the , then it will infer 'MapTile' and do the copy that I want
to avoid. So it might be slightly more
On Sun, 08 Jan 2012 18:54:13 +0100, Ben Davis ent...@cantab.net wrote:
Hi,
Is there a reason 'ref' is disallowed for local variables? I want to
write something like:
MapTile[] map; // It's a struct
ref MapTile tile=map[y*w+x];
tile.id=something;
tile.isWall=true;
My actual case is more
10 matches
Mail list logo