On 15/03/12 00:16, H. S. Teoh wrote:
On Tue, Mar 13, 2012 at 09:30:45PM -0500, Andrei Alexandrescu wrote:
On 3/13/12 7:54 PM, H. S. Teoh wrote:
Hi all,
My AA implementation is slowly inching closer to being ready to
replace aaA.d.
Great! This will need compiler restructuring, and in fact offers the
perfect opportunity for it. I suggest you to post your implementation
here for review first, and assume only the minimal lowerings from the
compiler.
Alright, I've finished the basic functionality of my AA implementation.
I still haven't solved that problem with using suffixless string
literals to index X[dstring], so you'll have to write aa["abc"d] instead
of just aa["abc"]. But I thought I should post my code now so that
people can take a look at it:
https://github.com/quickfur/New-AA-implementation/blob/master/newAA.d
Currently, this code is still standalone, not integrated with druntime
yet. Since that will require compiler changes and is potentially a very
big change, I've decided to polish up the standalone version as much as
possible before attempting druntime integration.
This is good, and very, very important. Do *not* make any attempt at
compiler integration until it is *completely* ready.
This includes AA literals. They need to be accepted somehow. The
compiler will give you syntax sugar and *nothing* more.
One possibility might be to accept a pair of array literals,
representing keys and values.
Possibly it should call a CTFE function to convert them into some other
form?