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

Vladimir Sedach vsedach at gmail.com
Tue Dec 1 03:56:53 UTC 2009


This is actually a cool example. I never thought about using
SLOT-VALUE that way. I'm rewriting the reference manual right now
(should be done in a couple of days), I'll make sure to mention this.

The way the @ macro works is actually just by quoting all symbols it
finds and passing its arguments to SLOT-VALUE.

One thing is that I renamed SLOT-VALUE to GET-PROPERTY in the
repository version, since what the form did really didn't have
anything in common with Common Lisp's SLOT-VALUE, as someone pointed
out.

Thanks,
Vladimir

2009/11/25 Wout Perquin <wout.perquin at skynet.be>:
> 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
>
>
>
> _______________________________________________
> 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