Re: Getl and maps behavior?

2008-08-23 Thread Tomas Hlavaty
Hi Alex, Having list cells behave like variables (by referring to their CAR parts) is a very useful feature. Not only for properties, but also for other list structures. : (setq L (1 2 3 4 5 6 7 8 9)) - (1 2 3 4 5 6 7 8 9) : (nth L 6) - (6 7 8 9) :

Re: Getl and maps behavior?

2008-08-22 Thread Alexander Burger
Hi Tomas, Alex, why does getl return a list of (property-value . property-name) and not a list of (property-name . property-value)? There are some practical reasons for representing the elements of property lists in such a way. Most of all, a cell can be passed to functions that expect a

Re: Getl and maps behavior?

2008-08-22 Thread Alexander Burger
Hi Tomas, Isn't it just because it was implemented this way? I mean these functions could be implemented to behave the same way even if getl returned a list of (property-name . property-value) which in this case Ah, there is a misunderstanding. I was not talking especially about 'getl', but

Re: Getl and maps behavior?

2008-08-21 Thread Alexander Burger
Hi Henrik, The main problem is that I need to be able to handle an arbitrary object and convert all Ts to true, and NILs to false in the JSON string. With the NILs we run into a problem, because a property value of NIL means that this property does not exist. So it can never be extracted from

Re: Getl and maps behavior?

2008-08-21 Thread Henrik Sarvell
Maybe this is a non-issue when I think about it. I can think of two possibilities: 1) For some reason an +Entity object needs to be converted to JSON. 2) A key = value structure needs to be sent, in such a case a paired list would do the trick, ie: ((k1 . v1) (k2 v2)) = {k1: v1, k2: v2}. This is

Re: Getl and maps behavior?

2008-08-21 Thread Tomas Hlavaty
Hi Henrik, convert all Ts to true, and NILs to false in the JSON string. With the NILs we run into a problem, because a property value of NIL means that this property does not exist. So it can never be extracted from the object itself. maybe the js - picolisp mapping false - NIL is not the

Re: Getl and maps behavior?

2008-08-21 Thread Henrik Sarvell
Thanks for the input Thomas but I think I will just go with paired lists instead, they are easier to manipulate with various list functions and should therefore be preferable to basic objects anyway. +Entity objects are on the list though. This is oversimplified version as there are lots of