[parenscript-devel] How to generate element[i].childNodes[0].nodeValue
Wout Perquin
wout.perquin at skynet.be
Tue Nov 24 21:42:58 UTC 2009
Hi Scott,
It renders "var var = at(at(element[i], childNode)[0], nodeValue);"
Parenscript turns the @ into at.
I would be happy with a "dot operator", so that I could code :
(dot (aref element i)(aref child-node 0) node-value)
it wouldnt be a bad extension to Parenscript :)
Regards, Wout
On Tue, 2009-11-24 at 11:47 -0700, sblist at me.com wrote:
> Hi Wout,
>
> Unless I'm totally out-to-lunch regarding the associativity
> of the '.' operator, I think this is what you want:
>
> (ps (let ((var (@ (aref (@ (aref element i) :child-node) 0) :node-value)))))
>
> Good luck,
>
> - Scott
>
> On 2009-11-24, at 1:43 PM, Wout Perquin wrote:
>
> > On Tue, 2009-11-24 at 19:42 +0000, Wout Perquin wrote:
> >> Hi,
> >> I would like to generate :
> >> "var value = element[i].childNode[0].nodeValue"
> >> in one sentence.
> >>
> >> Currently I have a workaround :
> >> (ps:ps
> >> (let ((foo (aref element i))
> >> (value (slot-value (aref foo.child-nodes 0)'node-value)))))
> >> which renders :
> >> "var foo = element[i];
> >> var value = foo.childNodes[0].nodeValue;"
> >>
> >> Is there another more direct way ?
> >> Thanks in advance.
> >> Wout Perquin
> >
> >
> > _______________________________________________
> > parenscript-devel mailing list
> > parenscript-devel at common-lisp.net
> > http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>
>
> _______________________________________________
> 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