[parenscript-devel] Feature request: prefixed names

Vladimir Sedach vsedach at gmail.com
Wed Jun 20 22:15:03 UTC 2007


Hi John,

That sounds like a good idea, but I think it would be difficult to
implement correctly. The problem is that name mangling would have to
take place both when you declare the variables/functions, and when you
access them. So there would have to be some global state to keep track
of which identifiers have already been declared in ParenScript code so
that the corresponding name-mangling could take place when those
identifiers are accessed. This presents problems with forward
references - there's currently no notion of "whole Javascript program"
in ParenScript, which besides wouldn't make sense if you're using
ParenScript to write inline scripts. If everything is going to get
name-mangled, then there would have to be some escape procedure for
identifiers that you don't want to name mangle (functions in other
Javascript libraries). Plus, you'd have to have a way to "export"
identifiers when you want to make your own functions for other
Javascript code to call. In short, I don't think there is a solution
to this that would work well in more than one use case.

Thanks,
Vladimir

On 6/19/07, John Fremlin <john at fremlin.org> wrote:
> Nowadays many things seem to want to include their JavaScript in your
> webpages. Aside from the fact that this is annoying, dangerous and
> wrong, we have to accept that it is quite prevalent: from Google
> AdWords to ReCaptcha.
>
> If I might add a feature request, it would be to be able to make sure
> that the identifiers generated by parenscript don't clash with
> anything else.
> _______________________________________________
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>



More information about the parenscript-devel mailing list