bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fail to parse JSON string


From: Dr . Jürgen Sauermann
Subject: Re: Fail to parse JSON string
Date: Tue, 15 Feb 2022 20:06:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi M. Misaki,

thanks, fixed in SVN 1528.

Best Regards,
Jürgen


On 2/15/22 3:36 PM, m_misaki@autistici.org wrote:
Dear maintainers,

I am trying to do some conversion between JSON strings and APL values.
However, some JSON strings could not be converted back into APL value.

For example,
      ⊢A ← (1 2) (3 4)
 1 2  3 4
      2 ⎕JSON A
[ [ 1, 2 ], [ 3, 4 ] ]
      ⎕JSON 2 ⎕JSON A
DOMAIN ERROR+
      ⎕JSON 2 ⎕JSON A
      ^
      )MORE
⎕JSON B: Got unexpected ',' at 10↓B
      10↓ 2 ⎕JSON A
, [ 3, 4 ] ]

The same problem occurs in structured variable too:
      B.a ← 123
      B.b ← 4 5
      2 ⎕JSON B
{ "b": [ 4, 5 ],
  "a": 123 }
      ⎕JSON 2 ⎕JSON B
DOMAIN ERROR+
      ⎕JSON 2 ⎕JSON B
      ^
      )MORE
⎕JSON B: Got unexpected ',' at 15↓B
      8 ⎕CR 15↓ 2 ⎕JSON B
┌→─────────────┐
│,␊  "a": 123 }│
└──────────────┘

It seems that a comma after ']' would cause the problem.

Thank you for your attention.

M Misaki



reply via email to

[Prev in Thread] Current Thread [Next in Thread]