[Issue 3470] [tdpl]: .length should not pop up inside indexing expressions.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 4 12:16:14 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3470



--- Comment #3 from Don <clugdbug at yahoo.com.au> 2009-11-04 12:16:12 PST ---
(In reply to comment #2)
> Great work, Don! Since you're there and the code is fresh in your mind, I
> suggest you operate these two additional changes that were discussed in the
> newsgroup several times:
> 
> a) In single-argument index and slice expressions, rewrite $ to __a.length,
> where __a is the already-evaluated array being indexed/sliced.
> 
> b) In multi-argument index and slice expressions, rewrite $ to __a.lengths!(n),
> where n is the compile-time argument position where $ appears.

Actually, the 'opDollar' problem is not very similar to this one, so I'll
create a new ticket for it. I've had a go at it. The difficult bit is that
currently '$' turns into a symbol, but it needs to become an expression, and it
needs the 'this' pointer, which isn't in scope. I can get around this by
creating local variables to hold the various values of $ for each dimension,
but I'm not sure if that's the right approach. Still not working, but close.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list