[parenscript-devel] How to generate element[i].childNodes[0].nodeValue

Wout Perquin wout.perquin at skynet.be
Wed Nov 25 19:53:23 UTC 2009


Hi Red,

It works on my version too (*)
It is a clean solution that I like a lot.
I did some tests and the slot-value operator is quite versatile.  In
fact it makes aref redundant because (slot-value foo 1 2 3) renders the
same as (aref foo 1 2 3).  

It also allows constructs like :
(slot-value foo 1 "two" three 'bar 1 2)
=> "foo[1]['two'][three].bar[1][2];" //not necessary meaningful but
possible :)  

I believe the versatility of slot-value should make it to the reference.

Many thanks.
Best wishes, Wout Perquin

(*) not sure what version I have, but the changelog youngest entry is
from Nov-4, 2007

On Wed, 2009-11-25 at 00:10 -0800, Red Daly wrote:
> On Tue, Nov 24, 2009 at 12:43 PM, Wout Perquin <wout.perquin at skynet.be> 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.
> 
> On my local version, slot-value accepts multiple slots:
> 
> (slot-value element i 'child-node 0 'node-value)
> =>"element[i].childNode[0].nodeValue;"
> 
> Nested @s and the like tend to become confusing, so I prefer this
> solution.  I don't know if it is part of the current Parenscript or
> not.
> 
> Best regards,
> Red Daly






More information about the parenscript-devel mailing list