[parenscript-devel] js closures in ps?
Henrik Hjelte
henrik at evahjelte.com
Sat Oct 13 16:10:33 UTC 2007
It was probably too obvious, anonymous functions are called lambda:
(*g-event.add-listener marker "click" (lambda ()
(map.open-info-window-html point label))
/Henrik Hjelte
On 10/13/07, Kevin Layer <layer at known.net> wrote:
> Greetings. I'm new to parenscript. I'm currently playing with
> converting a lisp program that generates js "the hard way". I have
> some code that looks like this (excerpted from a format string):
>
> function addPlace(lat, lon, label, icon) {
> var point = new GLatLng(lat, lon);
> var marker = new GMarker(point, { icon : icon });
> GEvent.addListener(marker,\"click\", function() {
> map.openInfoWindowHtml(point, label);
> });
> map.addOverlay(marker);
> }
>
> I can find nothing in the ps docs that tell me how to deal with the
> function() { ... }. Did I just miss it?
>
> Kevin
> _______________________________________________
> 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