ch-ch-changes
Bill Baxter
wbaxter at gmail.com
Tue Jan 27 23:17:55 PST 2009
On Wed, Jan 28, 2009 at 2:17 PM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> Jarrett Billingsley wrote:
>>
>> On Tue, Jan 27, 2009 at 11:15 PM, Andrei Alexandrescu
>
> [...]
>>>
>>> Feedback welcome.
>>
>> This is some awesome stuff. std.range and std.algorithm are really
>> coming together into a compelling whole. I don't know what else to
>> say - _you_ seem to know what you're doing!
>>
>> It's a minor point, but in the docs, with all the templating madness
>> it gets very hard to find the name of the symbol actually being
>> documented. For example:
>>
>> Filter!(unaryFun!(pred),Chain!(Ranges)) filter(alias pred,
>> Ranges...)(Ranges rs);
>>
>> "filter" gets lost in the middle. Could it be highlighted, or moved
>> to the front (using a Pascal-like "func(params) : returntype" syntax
>> instead)?
>
> Good point. Actually I've been experimenting with using "auto" for the
> return type. That does work most of the time, but unfortunately ddoc doesn't
> understand it. Then,
>
>> Also - "toe" is still a stupid name. ;) "first" and "last" would
>> have been my first choices, they seem so obvious.
>
> Turns out toe isn't half bad when I was coding with it - all I needed was
> something short and memorable.
>
> One problem with "first" is that it sometimes suggests something else. For
> example, if I have a generator for the numbers 1 to 10 and have advanced it
> a bit, gen.first suggests I'm looking back to the very first element, not
> the state of the iteration. I agree that gen.head isn't terribly evocative
> either, but then at least it doesn't evoke something wrong :o).
>
> Anyhow, how about doing what Haskell does? They use "head" and "last". And
> at least we'd be able to blame *them* if anyone doesn't like the names :o).
> Thoughts?
Well Haskell has a commonly used "tail", so it has an excuse for not
making head/last match up.
There's the C++-ish names: front/back Anything wrong with those?
--bb
More information about the Digitalmars-d
mailing list