... dozens of lines with single and double quotes ...
'>> is the binary delimiter - And there is NO quoting convention *within* the body
of the binary. So if you want to write '>> within the binary you can't (horrors)
(but who would want to anyway? - '>>)
I've also written a little parse transform. So that
Which is actually rather useful for mixing and embedding Erlang in HTML
In my case a certain reluctance to using binaries has a lot to do with how they are printed and
how they are inputted. The above two conventions make life a *lot* easier.
I had pondered the
<<#flunkYStuff# ... #flunkyStuff#>>
Convention (old Unix people will understand this :-) - so I could enter *any* text within the
body of the binary without quoting. So you could write:
<<#glurk# to quote a binary use <<' ... '>> or use the
<<#flunkyStuff# ... #flunkyStuff#>> convention
Eureka - having written this down it actually looks less repulsive than I had imagined -
I shall add this tonight :-)
> -----Original Message-----
> From: Jim Larson [mailto:jim]
> Sent: den 17 november 2005 09:29
> To: Joe Armstrong (AL/EAB); Bob.Smart;
> Cc: jim
> Subject: Re: JSON?
> I've recieved approval to release the JSON library for Erlang!
> I'll get it cleaned up and released tomorrow.
> In message
> se> Joe Armstrong writes:
> >IMHO you might get a nicer mapping if you changed strings to
> I've pondered that. It's a little awkward with the quoting and
> unquoting you need to do. Binaries also imply that you'd need to
> choose a Unicode format for the internal representation that would
> be good for all applications.
> >I'd let the parser return an association list (not a dict) -
> since (probably)
> >the object is small
> >and it's nice to be able to print it and pattern match it directly.
> Yeah - I'd be glad to trade the asymptotic efficiency of dicts for
> compactness and nicer printing. I liked dicts until they started
> showing up in error reports. I'll probably change this in a future
> Pattern matching? This means you'd have to:
> * have the JSON decoder always sort the assoc-list;
> * remember to maintain your pattern assoc-list in sorted order;
> * have optional fields sort after mandatory fields.
> Am I forgetting some new language feature?
> Thanks for your thoughts!
> Jim Larson