[parenscript-devel] Reimplementing (.method object ...) syntax

Clinton Ebadi clinton at unknownlamer.org
Fri Sep 18 04:34:19 UTC 2009


I recently upgraded parenscript after a few months and was disheartened
to see that (.method ...) syntax was removed (and to a lesser extent
foo.bar and foo[bar] syntax). I read the mailing list threads pertaining
to the new lexical let implementation and compiler improvements, but
after skimming the source code I don't see why (.method ...) could not
be supported.

As such I have started a symbol-syntax branch at [0]. In particular I
have done a first stab at reimplementing the (.method ...) syntax in the
patch viewable at [1]. I do not yet have a grasp of the subtleties in
the new compiler, but I think the patch looks basically correct. I
figured you guys could tell me if I missed anything.

Are there any objections to the patch? I've found that (funcall (@ foo
bar) ...) and (chain foo bar (baz ...)) syntax to be fairly unwieldy for
something as common as a method call, and don't see why (.method ...)
should not be considered a fundamental syntax of parenscript
(parenscript is parenscript and not lisp; enforcing consistency with
lisp syntax at the expense of conciseness is not desirable in my

I'll probably reimplement foo.bar.baz syntax properly (by splitting the
symbol apart and translating to nested (js:slot-value ...) nodes?). I'm
not convinced that it is worth having foo[bar] syntax however (but drewc
disagrees so I may reimplement it anyway for our use in
ucw/lisp-on-lines). Is there anything fundamentally preventing this from
working properly (in the face of symbol renaming and such)?

[0] git://git.hcoop.net/git/clinton/parenscript.git
[1] http://git.hcoop.net/?p=clinton/parenscript.git;a=commitdiff;h=18eb199841541edad87956b2380fd012e5a60769

Jessie: but today i was a nerd
Jessie: i even read slashdot.

More information about the parenscript-devel mailing list