D to Javascript converter (a hacked up dmd)

Jacob Carlborg doob at me.com
Sat Mar 3 04:12:51 PST 2012


On 2012-03-02 15:57, Adam D. Ruppe wrote:
> On Friday, 2 March 2012 at 09:33:44 UTC, Alix Pexton wrote:
>> Have you considered faking scopes in JS using anonymous functions?
>
> Yeah, though right now I'm trusting the D compiler to
> keep it straight, and it is doing a pretty good job
> while being really simple to code.
>
> What happens is all the local variables are mangled
> with respect to their full scope too (which leads to
> ridiculously long, but unique names).

Wouldn't you save a lot of characters by properly scoping the variables 
instead of using unique names? The compile JavaScript code would also be 
more readable.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list