I use a syntax like this:
(methcall 't-string object param1 parm2 param3)
=> object.tString(param1, param2, param3).
It's basically a shortcut for ((slot-object ...) param1 ...) but I have found it to be more readable.
When I need a long string of dot-separated identifiers (e.g. foo.bar.viz) I use (slot-value foo 'bar 'viz) => foo.bar.viz
What other syntax do people use to deal with dotted objects in Parenscript? I try to avoid them if possible, perhaps because the current syntax is verbose.
Red
John Fremlin <john@fremlin.org> writes:I've been tasked with re-adding the shorthand syntax to parenscript [0]
> Hi Vladimir,
>
> It seems that the new parenscript horribly breaks tpd2.
>
> The awful part of the business is changing from using elements.push etc.
> methods.
>
> You seem to recommend to rewrite them as ((slot-value elements 'push)
> new-thing).
>
> This is completely not at all related to Common Lisp syntax, which was
> supposedly the aim of this change, so I guess I am barking up the wrong
> end of the stick.
>
> Should I wait for the reader macros before making the update?
in the symbol-syntax if you need these features. Right now it only does
(.method ...) syntax, but sometime today or tomorrow I'll have
(foo.bar.baz) expanding to ((slot-value foo 'bar) 'baz). I'm not sure
whether it is worthwhile keeping foo[bar] syntax; (aref foo bar) is not
particularly less convenient.
If upstream will not accept the changes this will be maintained as part
of UCW again (probably renamed to avoid conflicts; since ps no longer
uses the js package we'll move back there). I'll try to keep up with
merges from upstream and whatnot as well.
[0] http://git.hcoop.net/?p=clinton/parenscript.git;a=summary
--
<captain_krunk> ntk is currently using "telnet fyodor 25" to send email
_______________________________________________
parenscript-devel mailing list
parenscript-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel