My Kingdom For ...

Darryl Bleau user at example.net
Thu Feb 21 09:04:33 PST 2008


Robert Fraser wrote:
> Darryl Bleau wrote:
>> opIndexConcat
>> opIndexConcatAssign
> 
> Maybe it's the 5 AM thing, but I'm feeling pretty stupid right now. What
> would these do?

This was answered and is what I would use them for. To create user
containers that operate like built-in ones. I know that there are other,
more extensible ways to do this (left references) but I'm just looking
for something a little less involved, to help with D1 programming.

It would seem to me that if there is already opIndexAssign that adding a
few others like these should probably not be a ton of effort, though
that is just an educated guess and I could be wrong. But if it weren't a
lot of effort, and only cost a few extra lines of code, it would be nice
to have.


>> Returning static arrays from functions.
> 
> Wrap it in a struct. What's your use case for this, anyway?

My particular use case is a logger which can properly use lazy format
parameters without having to do something like log.info("{}"[],
"blah"[]);, which works, and preserves laziness, but isn't exactly friendly.

>> or, possibly:
>>
>> !in
> 
> Gregor's post sums up my thoughts on the issue.

(!(a in b)) == (a !in b) would be all I'm asking.


Don't get me wrong though, I understand completely that none of this
will ever happen. I just wish it could. :)



More information about the Digitalmars-d mailing list