Re: [Factor-talk] Serialisation with a JSON representation

2013-07-11 Thread Chris Double
On Thu, Jul 11, 2013 at 6:45 PM, Loryn Jenkins lor...@gmail.com wrote: 1. I'm using first4 to retrieve the members of the tuple from the JSON representation, placing them on the stack, so they can form an input to boa. How would I retrieve an arbitrary number of slots onto the stack? (i.e. For

Re: [Factor-talk] Serialisation with a JSON representation

2013-07-11 Thread John Benediktsson
You can use firstn to get an arbitrary number of elements from a sequence onto the stack, but I think that is often a sign of bad code. http://docs.factorcode.org/content/word-firstn,sequences.generalizations.html Also, your hashtablecd word seems like it could be more clear if it were

Re: [Factor-talk] Serialisation with a JSON representation

2013-07-11 Thread Loryn Jenkins
My thanks for Chris and John. John's suggestion to use the `from-slots' word to provide automatic generic deserialisation of json is great. I've been experimenting with serialization using different methods and different encodings. This thread on github has been raised: