On 05/08/2012 09:01 PM, Stéphane Ducasse wrote:
On May 8, 2012, at 8:33 PM, Göran Krampe wrote:
On 05/08/2012 07:46 PM, Stéphane Ducasse wrote:
for me I can understand that people want a format to exchange objects and that they want to use STON but I do not understand why we need that to store metadata when a simple array works. Probably we love to load our boat with extra readers and writers.
No, it was just a "trigger" for this discussion/comparison.
BUT... I would like you to at least read the parts in my article which is about improving the literal support we have in Smalltalk/Pharo. The main "problem" with literals that I can see (compared to Tirade) are:
- There is no restricted parser for them (as Tirade is), you need to use Compiler and that is a HUGE security problem. But of course, you are fixing that, right? :)
:) there is no security problem just that gemstone does not have a parser. Because parsing cannot be a security hole this is blind data interpretation that is a problem. This is why Github got problems and I imagine that the code was probably passed in JSON or similar format.
Mmm, well, if you rely on full Compiler to parse literals, it is a security problem. But if you use the technique Igor showed to only parse array literals - then yes, that's safe, I agree. I forgot about his post.
- There is no support for Associations as literals which means there is no good support in literals to express Dictionaries/key-value-pairs (like JSON has). Tirade has that in the form of literal Associations. I think we should add something in this area to Pharo/Smalltalk in general, but for more thoughts on that, please see article.
Ok let me try to understand what I do not get.
Do you mean that we cannot distinguish between #((a 13) 'a' 'b' 1 )
and #(a -> 13 'a' 'b' 1 )
why #(Dictionary (a 13) (b 15)) or #(Dictionary ((a 13) (b 15)))
is not the same as #(Dictionary a-> 13 b ->15)
Now the problem is that a -> 13 is not created at parse time. So I do not get why
I presume you are describing various conventions/tricks to represent a Dictionary in a literal array, right? My point is that it would be nice if we actually had proper syntax for Associations (and or Dictionaries). regards, Göran