(Was: On 80 columns should (not) be enough for everyone)

Steven Schveighoffer schveiguy at yahoo.com
Tue Feb 1 08:36:32 PST 2011


On Mon, 31 Jan 2011 18:08:53 -0500, Adam Ruppe <destructionator at gmail.com>  
wrote:

> Steven Schveighoffer wrote:
>> It does help, but I was kind of hoping for something that shows the
>> structure.
>
> Those relationships are in the HTML too.... try it now:
> http://arsdnet.net/d-web-site/std_algorithm.html
>
> (I know it needs some work still, I'm just sick of Javascript after
> spending 20 minutes tracking down a bug caused by me using the
> same variable name twice! Gah! And wow do I miss foreach.)

Yes, it's in the right direction, but it does need work.

BTW, foreach is available, but you can't use it on arrays (HAHAHAHA!)

it's one of the reasons I use objects in JS most of the time instead of  
arrays:

for(key in obj)
{
    var elem = obj[key];
    /* use elem */
}

of course, I'd only recommend this on objects you have used as arrays.   
What I mean by that is, you don't have any methods or prototypes, because  
those will also be iterated.

https://developer.mozilla.org/en/JavaScript/Reference/Statements/for...in

-Steve


More information about the Digitalmars-d mailing list