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 probably more preferable than an object when I think even more :-). So, I'll implement that and take a look at converting entity objects. /Henrik On Thu, Aug 21, 2008 at 3:02 PM, Alexander Burger <[EMAIL PROTECTED]>wrote: > 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 the object itself. > > To cover non-NIL properties, you could do > > (mapcar > '((X) (or (pair X) (cons T X))) > (getl Tst) ) > > > > Is there some other function/mechanism I could use instead? > > Hmm, not that I can think of at the moment. > > To solve the problem with the NILs, you'll have to keep a separate > record of possible properties (as is done, for example, in the '+Entity' > objects). > > Cheers, > - Alex > -- > UNSUBSCRIBE: mailto:[EMAIL PROTECTED] > ------=_Part_31067_20121356.1219308350562 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline <div dir="ltr">Maybe this is a non-issue when I think about it. I can think of two possibilities:<br><br>1) For some reason an +Entity object needs to be converted to JSON.<br><br>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 probably more preferable than an object when I think even more :-).<br> <br>So, I'll implement that and take a look at converting entity objects.<br><br>/Henrik<br><br><div class="gmail_quote">On Thu, Aug 21, 2008 at 3:02 PM, Alexander Burger <span dir="ltr"><<a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Henrik,<br> <div class="Ih2E3d"><br> > The main problem is that I need to be able to handle an arbitrary object and<br> > convert all Ts to true, and NILs to false in the JSON string.<br> <br> </div>With the NILs we run into a problem, because a property value of NIL<br> means that this property does not exist. So it can never be extracted<br> from the object itself.<br> <br> To cover non-NIL properties, you could do<br> <br> (mapcar<br> '((X) (or (pair X) (cons T X)))<br> (getl Tst) )<br> <div class="Ih2E3d"><br> <br> > Is there some other function/mechanism I could use instead?<br> <br> </div>Hmm, not that I can think of at the moment.<br> <br> To solve the problem with the NILs, you'll have to keep a separate<br> record of possible properties (as is done, for example, in the '+Entity'<br> objects).<br> <br> Cheers,<br> - Alex<br> <font color="#888888">--<br> UNSUBSCRIBE: mailto:<a href="mailto:picolisp@software-lab.de">picolisp@software-lab.de</a>?subject=Unsubscribe<br> </font></blockquote></div><br></div> ------=_Part_31067_20121356.1219308350562-- -- UNSUBSCRIBE: mailto:[EMAIL PROTECTED] -------