bug-apl
[Top][All Lists]
Advanced

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

Fail to parse JSON string


From: m_misaki
Subject: Fail to parse JSON string
Date: Tue, 15 Feb 2022 14:36:36 +0000
User-agent: Roundcube Webmail

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]