Re: Casting JSONValues arrays to native arrays ... ??? ...

2021-09-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/24/21 12:58 AM, james.p.leblanc wrote: On Thursday, 23 September 2021 at 20:32:36 UTC, james.p.leblanc wrote: On Thursday, 23 September 2021 at 19:18:11 UTC, james.p.leblanc wrote: On Thursday, 23 September 2021 at 19:04:47 UTC, Steven Schveighoffer wrote: On 9/23/21 2:20 PM,

Re: Casting JSONValues arrays to native arrays ... ??? ...

2021-09-23 Thread james.p.leblanc via Digitalmars-d-learn
On Thursday, 23 September 2021 at 20:32:36 UTC, james.p.leblanc wrote: On Thursday, 23 September 2021 at 19:18:11 UTC, james.p.leblanc wrote: On Thursday, 23 September 2021 at 19:04:47 UTC, Steven Schveighoffer wrote: On 9/23/21 2:20 PM, james.p.leblanc wrote: ``` Produces: typeid(jj):

Re: Casting JSONValues arrays to native arrays ... ??? ...

2021-09-23 Thread james.p.leblanc via Digitalmars-d-learn
On Thursday, 23 September 2021 at 19:18:11 UTC, james.p.leblanc wrote: On Thursday, 23 September 2021 at 19:04:47 UTC, Steven Schveighoffer wrote: On 9/23/21 2:20 PM, james.p.leblanc wrote: Dear D-ers, Here comes a minor update (small rearrangement in mapping/array ordering) for anyone who

Re: Casting JSONValues arrays to native arrays ... ??? ...

2021-09-23 Thread james.p.leblanc via Digitalmars-d-learn
On Thursday, 23 September 2021 at 19:04:47 UTC, Steven Schveighoffer wrote: On 9/23/21 2:20 PM, james.p.leblanc wrote: Dear D-ers, In attempting to cast JSONValues that hold arrays to "native" How you really do this: ```d import std.algorithm : map; auto z5 = jj["ba"] // get the JSONValue

Re: Casting JSONValues arrays to native arrays ... ??? ...

2021-09-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/23/21 2:20 PM, james.p.leblanc wrote: Dear D-ers, In attempting to cast JSONValues that hold arrays to "native" array types, I have hit some issues.  Example code: ```d import std.stdio; import std.json; void main(){    JSONValue jj;    jj["d"] = [ 1.234 ];  // a

Casting JSONValues arrays to native arrays ... ??? ...

2021-09-23 Thread james.p.leblanc via Digitalmars-d-learn
Dear D-ers, In attempting to cast JSONValues that hold arrays to "native" array types, I have hit some issues. Example code: ```d import std.stdio; import std.json; void main(){ JSONValue jj; jj["d"] = [ 1.234 ]; // a "dummy" double value jj["ba"] = [ true, false,