Thread overview
what do you think of
Feb 09, 2004
imr1984
Feb 09, 2004
davepermen
Feb 09, 2004
imr1984
Feb 09, 2004
davepermen
Feb 09, 2004
Sam McCall
February 09, 2004
ok i didnt like any of the List classes that i found, so i made my own. what do you think:

List!(int) myList = new List!(int);

list.append(9);
list.prepend(4);

for(List!(int).Node node = myList.first; node; node = node.next)
{
printf("%u", node());//overloaded opCall
printf("%u", node.t);//not quite as elegant, but required sometimes
}

what do you guys think?


February 09, 2004
'overload' foreach.. that'll be most fun:D

and opRange should be doable, too, rather simple.. (even for placing into
foreach..)

"imr1984" <imr1984_member@pathlink.com> schrieb im Newsbeitrag news:c07ic9$1dje$1@digitaldaemon.com...
> ok i didnt like any of the List classes that i found, so i made my own.
what do
> you think:
>
> List!(int) myList = new List!(int);
>
> list.append(9);
> list.prepend(4);
>
> for(List!(int).Node node = myList.first; node; node = node.next)
> {
> printf("%u", node());//overloaded opCall
> printf("%u", node.t);//not quite as elegant, but required sometimes
> }
>
> what do you guys think?
>
>


February 09, 2004
is that possible? how do i do that?

In article <c07p50$1p0t$1@digitaldaemon.com>, davepermen says...
>
>'overload' foreach.. that'll be most fun:D
>
>and opRange should be doable, too, rather simple.. (even for placing into
>foreach..)
>
>"imr1984" <imr1984_member@pathlink.com> schrieb im Newsbeitrag news:c07ic9$1dje$1@digitaldaemon.com...
>> ok i didnt like any of the List classes that i found, so i made my own.
>what do
>> you think:
>>
>> List!(int) myList = new List!(int);
>>
>> list.append(9);
>> list.prepend(4);
>>
>> for(List!(int).Node node = myList.first; node; node = node.next)
>> {
>> printf("%u", node());//overloaded opCall
>> printf("%u", node.t);//not quite as elegant, but required sometimes
>> }
>>
>> what do you guys think?
>>
>>
>
>


February 09, 2004
its all in the manuals..

"imr1984" <imr1984_member@pathlink.com> schrieb im Newsbeitrag news:c085vu$2dtc$1@digitaldaemon.com...
> is that possible? how do i do that?
>
> In article <c07p50$1p0t$1@digitaldaemon.com>, davepermen says...
> >
> >'overload' foreach.. that'll be most fun:D
> >
> >and opRange should be doable, too, rather simple.. (even for placing into
> >foreach..)
> >
> >"imr1984" <imr1984_member@pathlink.com> schrieb im Newsbeitrag news:c07ic9$1dje$1@digitaldaemon.com...
> >> ok i didnt like any of the List classes that i found, so i made my own.
> >what do
> >> you think:
> >>
> >> List!(int) myList = new List!(int);
> >>
> >> list.append(9);
> >> list.prepend(4);
> >>
> >> for(List!(int).Node node = myList.first; node; node = node.next)
> >> {
> >> printf("%u", node());//overloaded opCall
> >> printf("%u", node.t);//not quite as elegant, but required sometimes
> >> }
> >>
> >> what do you guys think?
> >>
> >>
> >
> >
>
>


February 09, 2004
imr1984 wrote:

> ok i didnt like any of the List classes that i found, so i made my own. what do
> you think:
> 
> List!(int) myList = new List!(int);
> 
> list.append(9);
> list.prepend(4);
> 
> for(List!(int).Node node = myList.first; node; node = node.next)
> {
> printf("%u", node());//overloaded opCall
> printf("%u", node.t);//not quite as elegant, but required sometimes
> }
> 
> what do you guys think?
> 
> 
Nice! I still think List should be an interface a la Java though, with linked and array based implementations. Implementing foreach and indexing would be nice.
Sam