April 11, 2002 Re: More on Delegates (was: D alpha 26) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russ Lewis | More thoughts about this...the concatenate operator might be useful for combining associative arrays/sets; the problem is, what do you do if there are any conflicting keys? It might suggest a full set of operators for associative arrays/sets: union junction exclusion (dunno the official name...the backslash operator) Of course, now we're heading toward a much more complex implementation for sets, one that might be in a class. But it seems like a simple and logical extension; associative arrays lead to sets, and sets lead to built-in set operators. My 2 cents, anyhow. -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ] |
April 11, 2002 Re: More on Delegates (was: D alpha 26) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russ Lewis | My sample code for adding multiple delegates is pretty ugly: dg_t[] MyEvent; // ... DelegatesAndEvents.dt_t[0] a_delegate; a_delegate[0] = &o.member; dae.MyEvent ~= a_delegate; a_delegate[0] = &o2.func; dae.MyEvent ~= a_delegate; something like dg_t[] MyEvent; // ... dae.MyEvent += &o.member; dae.MyEvent += &o2.func; would cleaner. Dan "Russ Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:3CB5CB05.8347198C@deming-os.org... > More thoughts about this...the concatenate operator might be useful for combining > associative arrays/sets; the problem is, what do you do if there are any conflicting keys? > > It might suggest a full set of operators for associative arrays/sets: > union > junction > exclusion (dunno the official name...the backslash operator) > > Of course, now we're heading toward a much more complex implementation for sets, > one that might be in a class. But it seems like a simple and logical extension; > associative arrays lead to sets, and sets lead to built-in set operators. > > My 2 cents, anyhow. > > -- > The Villagers are Online! villagersonline.com > > .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] > .[ (a version.of(English).(precise.more)) is(possible) ] > ?[ you want.to(help(develop(it))) ] > > |
Copyright © 1999-2021 by the D Language Foundation