gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
274 stars 61 forks source link

"create_struct" differs from IDL when the tag name is not a tag name ! #1808

Open alaingdl opened 5 months ago

alaingdl commented 5 months ago

(not the same case than #1627 )

IDL> t=create_struct({test, value:0.0},10,2)
% Unable to convert variable tagname to type struct.
% Execution halted at: $MAIN$          

but accepted in GDL

GDL> t=create_struct({test, value:0.0},10,2)

(and a series of other bad tests ...)

GillesDuvert commented 5 months ago

The structure is not the first problem:

IDL> t=create_struct(10,2)
% Unable to convert variable tagname to type struct.

GDL correctly takes the 1st argument as a structure (permitted) and adds to it the second tag, 10 and value, 2. The "only" problem is that

IDL> t=create_struct('10',2)  
% CREATE_STRUCT: Illegal tag name: 10.

when GDL creates an acceptable tag:

GDL> t
{
    "______10": 2
}

So this is NOT really an issue, and cannot easily be patched without reverting #1627 (regression)