Re: Javascript: Time Traveller From the Year 1962!

[prev] [thread] [next] [lurker] [Date index for 2005/04/10]

From: peter (Peter da Silva)
Subject: Re: Javascript: Time Traveller From the Year 1962!
Date: 00:09 on 10 Apr 2005
> Ahh, the fundamental difference here is that the include in C goes into the
> source code but the include in JS goes into the thing USING the source code.

That's because in "C" it's preprocessed before the compiler sees it.

Run your javascript through the preprocessor.

If that's too hard, then hide it, make it automatic, like it is in C. It's
a function of the hosting environment, not the language.

> Well for god's sake, could they stop adding new ways to make things rotate
> for a second and add one useful function to the language?!

> 	function include(source) {
> 		document.write("<script source\"" + source + "\"></script>");
> 	}

Because this is done at EXECUTE time, and prevents you from writing a JS
compiler EVEN IF YOU WANTED TO.

This stuff has to exist OUTSIDE the eval loop. Putting it IN the eval loop
would prevent Javascript from being usable as anything but a scripting
language, ever, and it's too good for that.

There's stuff above here

Generated at 12:00 on 12 Apr 2005 by mariachi 0.52