Why D is annoying =P
Mehrdad
wfunction at hotmail.com
Wed Oct 24 21:21:02 PDT 2012
Haha thanks a bunch for the advice. :) I was actually intending
it to be a quick hack, not a highly-generalized thing.
So I thought, hey, I'll just use a
Tuple!(string, q{symbol}, size_t, q{iRule}, size_t, q{iSymbol})
to denote an "LR Item".
So an "item set" became RedBlackTree!(Tuple!(...)), but that
didn't work because of the reference semantics.
So I tried int[Tuple!(...)], and hence the story.
(I actually even scrapped the idea of using a 'set' and just used
an array.
Screw the O(n) performance.
But one of my goals was getting the code to be concise (the idea
was to use CTFE + mixins/templates to generate some optimized
code with switch statements for the parser), but sprinkling it
with all the sort()s and all the code required to switch from
hashtables to arrays just made it too ugly/indecipherable for me
to continue working on it.)
etc.
But yeah, thanks for the advice, I'll keep it in mind. :)
More information about the Digitalmars-d
mailing list