Ok Cheers for the feed back.<div><br></div><div>Rich<br><br><div class="gmail_quote">On Tue, Jun 7, 2011 at 2:34 PM, Bob Ippolito <span dir="ltr"><<a href="mailto:bob@redivi.com">bob@redivi.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">In a string you need to escape the quotes so that the parser can know<br>
when the string ends. This is required in essentially any programming<br>
language. In some languages you may be able to use a different quote<br>
character for your string, but in Erlang there is only one so<br>
embedding strings with lots of quotes does look noisy. In practice<br>
this isn't a problem because most of your JSON is going to be coming<br>
from the network or disk and not embedded in Erlang source strings.<br>
<div><div></div><div class="h5"><br>
On Tue, Jun 7, 2011 at 6:06 AM, richard claxton <<a href="mailto:rich.claxton@gmail.com">rich.claxton@gmail.com</a>> wrote:<br>
> I though i should be able to run this.<br>
> mochijson2:decode( "{ "colour" : "red", "value" : "#f00" }" ).<br>
> but get  2: syntax error before: colour<br>
> Like you said i think its the syntax, but i cant see it.<br>
> Cheers Richard<br>
><br>
> On Tue, Jun 7, 2011 at 1:51 PM, Bob Ippolito <<a href="mailto:bob@redivi.com">bob@redivi.com</a>> wrote:<br>
>><br>
>> It sounds like your input isn't JSON, or maybe you've misunderstood<br>
>> something about Erlang syntax. If you post some code it may help<br>
>> pinpoint exactly what's going on.<br>
>><br>
>> On Tue, Jun 7, 2011 at 5:22 AM, richard claxton <<a href="mailto:rich.claxton@gmail.com">rich.claxton@gmail.com</a>><br>
>> wrote:<br>
>> > I am new to erlang and i am playing around with mochijson2, JSON parsing<br>
>> > from a http post, I can decode the json http request if i escape all the<br>
>> > quotes in the string \" but there must be a better solution then this?<br>
>> > Cheer Richard<br>
>> > _______________________________________________<br>
>> > erlang-questions mailing list<br>
>> > <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
>> > <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>