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
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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
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@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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
Hi Wout,
On 2009-11-24, at 2:42 PM, Wout Perquin wrote:
Hi Scott, It renders "var var = at(at(element[i], childNode)[0], nodeValue);" Parenscript turns the @ into at.
You need to use PS:@. I think most folks would create their own package and :USE parenscript:
(defpackage #:your-package (:use #:common-lisp #:parenscript)
... using un-interned keywords or strings to your taste.
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 :)
I wonder if you could come up with an implementation of DOT that does what you want unambiguously... I'd think this hasn't come up before because most folks like to stick with prefix notation in PS (aside from the old symbol mangling with '.')
- Scott
Apologies for the malformed Lisp, my e-mail program doesn't use Paredit...
(defpackage #:your-package (:use #:common-lisp #:parenscript))
- Scott
On 2009-11-24, at 12:50 PM, sblist@me.com wrote:
Hi Wout,
On 2009-11-24, at 2:42 PM, Wout Perquin wrote:
Hi Scott, It renders "var var = at(at(element[i], childNode)[0], nodeValue);" Parenscript turns the @ into at.
You need to use PS:@. I think most folks would create their own package and :USE parenscript:
(defpackage #:your-package (:use #:common-lisp #:parenscript)
... using un-interned keywords or strings to your taste.
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 :)
I wonder if you could come up with an implementation of DOT that does what you want unambiguously... I'd think this hasn't come up before because most folks like to stick with prefix notation in PS (aside from the old symbol mangling with '.')
- Scott
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
Hi Scott, ps:@ does the job. (ps:ps (let ((var (ps:@ (aref (ps:@ (aref element i) :child-node) 0) :node-value))))) renders : "var var = element[i].childNode[0].nodeValue;" exactly what I wanted. Concerning the DOT implementation, it was merely a reflection but has now become some kind of a challenge. Will think about it. Will have a look into your suggestion for :USE parenscript. Thanks, Wout
On Tue, 2009-11-24 at 12:50 -0700, sblist@me.com wrote:
Hi Wout,
On 2009-11-24, at 2:42 PM, Wout Perquin wrote:
Hi Scott, It renders "var var = at(at(element[i], childNode)[0], nodeValue);" Parenscript turns the @ into at.
You need to use PS:@. I think most folks would create their own package and :USE parenscript:
(defpackage #:your-package (:use #:common-lisp #:parenscript)
... using un-interned keywords or strings to your taste.
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 :)
I wonder if you could come up with an implementation of DOT that does what you want unambiguously... I'd think this hasn't come up before because most folks like to stick with prefix notation in PS (aside from the old symbol mangling with '.')
- Scott
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
On Tue, Nov 24, 2009 at 12:43 PM, Wout Perquin wout.perquin@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
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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
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@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
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@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@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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
On Mon, Nov 30, 2009 at 7:56 PM, Vladimir Sedach vsedach@gmail.com wrote:
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.
I disagree with that characterization of SLOT-VALUE, since it is very similar to SLOT-VALUE in lisp but the slots have different semantics (MOP semantics in Lisp and hash-map semantics in Javascript). We should also note that this will break a lot of code, which generated some criticism with the last Parenscript release.
Not that it's a big deal to rename things, and PROPERTY-VALUE is a good alternative. I suppose because of the simpler semantics of the object system in Javascript that even calling it PROPERTY, as suggested, is not ambiguous. (If it were Lisp, SLOT could designate the slot metaobject as opposed to the slot value for a given instance).
Best, Red
Thanks, Vladimir
2009/11/25 Wout Perquin wout.perquin@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@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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
I disagree with that characterization of SLOT-VALUE, since it is very similar to SLOT-VALUE in lisp but the slots have different semantics (MOP semantics in Lisp and hash-map semantics in Javascript).
The bigger problem is that now PS SLOT-VALUE has a completely different argument signature from the CL one, and people will use that. So there's no way to get PS code that uses it to work in CL, and it also conflicts if you want to implement CLOS in PS (I imagine this might be a problem for PSOS).
We should also note that this will break a lot of code, which generated some criticism with the last Parenscript release.
Yes, I put SLOT-VALUE in the deprecated interface list, which will issue a warning. This isn't an incompatible change, good thing for everybody.
Not that it's a big deal to rename things, and PROPERTY-VALUE is a good alternative. I suppose because of the simpler semantics of the object system in Javascript that even calling it PROPERTY, as suggested, is not ambiguous. (If it were Lisp, SLOT could designate the slot metaobject as opposed to the slot value for a given instance).
Since the JS terminology calls object slots properties, it definitely makes sense to call the accessor something to do with "property." The three choices so var are GET-PROPERTY, PROPERTY, and PROPERTY-VALUE. I like GET-PROPERTY because it has a similar convention to GETHASH and GETF. On the other hand, if it were really similar, it might be called GETPROP. There's something ambiguous about PROPERTY, it's hard to tell if it's an accessor at first sight. PROPERTY-VALUE is like SLOT-VALUE, but it's the longest to type.
GETPROP is concise and Lispy. Thoughts?
Vladimir
Best, Red
Thanks, Vladimir
2009/11/25 Wout Perquin wout.perquin@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@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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
On Tue, Dec 1, 2009 at 4:10 PM, Vladimir Sedach vsedach@gmail.com wrote:
I disagree with that characterization of SLOT-VALUE, since it is very similar to SLOT-VALUE in lisp but the slots have different semantics (MOP semantics in Lisp and hash-map semantics in Javascript).
The bigger problem is that now PS SLOT-VALUE has a completely different argument signature from the CL one, and people will use that. So there's no way to get PS code that uses it to work in CL, and it also conflicts if you want to implement CLOS in PS (I imagine this might be a problem for PSOS).
We should also note that this will break a lot of code, which generated some criticism with the last Parenscript release.
Yes, I put SLOT-VALUE in the deprecated interface list, which will issue a warning. This isn't an incompatible change, good thing for everybody.
Not that it's a big deal to rename things, and PROPERTY-VALUE is a good alternative. I suppose because of the simpler semantics of the object system in Javascript that even calling it PROPERTY, as suggested, is not ambiguous. (If it were Lisp, SLOT could designate the slot metaobject as opposed to the slot value for a given instance).
Since the JS terminology calls object slots properties, it definitely makes sense to call the accessor something to do with "property." The three choices so var are GET-PROPERTY, PROPERTY, and PROPERTY-VALUE. I like GET-PROPERTY because it has a similar convention to GETHASH and GETF. On the other hand, if it were really similar, it might be called GETPROP. There's something ambiguous about PROPERTY, it's hard to tell if it's an accessor at first sight. PROPERTY-VALUE is like SLOT-VALUE, but it's the longest to type.
GETPROP is concise and Lispy. Thoughts?
I'm for it.
Red
Vladimir
Best, Red
Thanks, Vladimir
2009/11/25 Wout Perquin wout.perquin@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@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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
On Tue, Dec 1, 2009 at 4:10 PM, Vladimir Sedach vsedach@gmail.com wrote:
I disagree with that characterization of SLOT-VALUE, since it is very similar to SLOT-VALUE in lisp but the slots have different semantics (MOP semantics in Lisp and hash-map semantics in Javascript).
The bigger problem is that now PS SLOT-VALUE has a completely different argument signature from the CL one, and people will use that. So there's no way to get PS code that uses it to work in CL, and it also conflicts if you want to implement CLOS in PS (I imagine this might be a problem for PSOS).
Good point. I did not put in fancy slot semantics for PSOS because I was concerned about speed (and I did not need them). I also do not share code between between CL and Parenscript so I haven't run into the former problem. Nonetheless this is an important objection to using slot-value.
Red
We should also note that this will break a lot of code, which generated some criticism with the last Parenscript release.
Yes, I put SLOT-VALUE in the deprecated interface list, which will issue a warning. This isn't an incompatible change, good thing for everybody.
Not that it's a big deal to rename things, and PROPERTY-VALUE is a good alternative. I suppose because of the simpler semantics of the object system in Javascript that even calling it PROPERTY, as suggested, is not ambiguous. (If it were Lisp, SLOT could designate the slot metaobject as opposed to the slot value for a given instance).
Since the JS terminology calls object slots properties, it definitely makes sense to call the accessor something to do with "property." The three choices so var are GET-PROPERTY, PROPERTY, and PROPERTY-VALUE. I like GET-PROPERTY because it has a similar convention to GETHASH and GETF. On the other hand, if it were really similar, it might be called GETPROP. There's something ambiguous about PROPERTY, it's hard to tell if it's an accessor at first sight. PROPERTY-VALUE is like SLOT-VALUE, but it's the longest to type.
GETPROP is concise and Lispy. Thoughts?
Vladimir
Best, Red
Thanks, Vladimir
2009/11/25 Wout Perquin wout.perquin@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@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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
Hi Vladimir, GET-PROPERTY is certainly a better name then SLOT-VALUE, but why not calling it PROPERTY, that is more generic and also 4 characters shorter. It would make sense in constructs like SETF. If I had the choice between : (setf (get-property foo 1 2 'bar) value) ; and (setf (property foo 1 2 'bar) value) I would pick PROPERTY because it is shorter and it says exactly what it is about ... a property of a JavaScript object. But ... if you want to go a step further, because what SLOT-VALUE is actually addressing/pointing/referring to, is either a property, a function, or an object, you can consider to call it MEMBER, which is even a shorter name and even more generic. If you would ask me, I would go for MEMBER (setf (member foo 1 2 'bar) value ; how shorter and abstracter could one go :) Regards, Wout
On Mon, 2009-11-30 at 22:56 -0500, Vladimir Sedach wrote:
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@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@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@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel@common-lisp.net