[Newbies] one more parsing JSON..

Cédrick Béler cdrick65 at gmail.com
Mon Apr 5 10:55:27 UTC 2010


yes this is a problem related to _ that was used for affectation before. I
think this is fixed now in Pharo.

Anyway, a workaround is to change all $_ in another character in the stream
you get (maybe changing it to $-).

'test_test' replaceAll: $_ with: $-

hth,

2010/4/5 sergio_101 <sergiolist at village-buzz.com>

> i am using the json library, and everything seems to be going great..
> but i am missing one more piece..
>
> my code looks like this:
>
> results := Json readFrom: geocode readStream.
>
> and it works fine..
>
> the only problem is that there are a few keys that have underscores in
> them.. like:
>
> 'formatted_address'
>
> when i try to do:
>
> results 'formatted_address'
>
> it bombs..
>
> but any other key that does not have an underscore works fine..
>
> any ideas?
>
> thanks!
>
> --
>
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>



-- 
Cédrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20100405/3a82a18c/attachment.htm


More information about the Beginners mailing list