potential behavior of nested structs
Era Scarecrow
rtcvb32 at yahoo.com
Mon Feb 4 18:12:20 PST 2013
On Monday, 4 February 2013 at 22:42:52 UTC, Zach the Mystic wrote:
> On Monday, 4 February 2013 at 22:17:04 UTC, Era Scarecrow wrote:
>> They already exist for classes though; Or so I understand.
>>
>> They would be rare; But I've had the need for them with
>> non-classes (say a sorting algorithm that's also a range) it's
>> an annoyance to manually do it using pointers and then having
>> to update said pointers. It can be done... It's just ugly and
>> doesn't feel like I should have to.
>
> Hey I've been working on this. Thanks for holding the fort down.
After reading your post (Atoms, protons, neurons) I can see
we're thinking a lot on the same lines; Although yours doesn't
get into limitations of when not to return a nested struct, But
if the implementation never leaves the outer/parent struct then
it doesn't matter.
This would be something for someone to try incorporating into a
test version of the front end and just see how it works. Kinda
like the @property problem, some things you just gotta try
yourself with an implementation before you know if it's a good
design.
Thankfully if it is allowed it couldn't possibly break code (as
they aren't allowed right now). But that's up to Andrei and
Walter to decide if it's allowed, we don't want to have
create/break specs and split the community.
More information about the Digitalmars-d
mailing list