cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to move from signal modeling to system modeling at the first JMP Aerospace Analytics webinar. Register. June 18, 1 p.m. US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

Issue with associative arrays and default values

Why is it not possible to specify an associative array as default value?

 

create = Function( {x},	Associative Array( {{"value", x}} )	);

create(1);
Associative Array(Eval List({ Eval List( {1, create(1)})}));   // [1 => ["value" => x]]
Associative Array(Eval List({ Eval List( {1, create(1)})}),2); // [1 => ["value" => x], => 2]


Associative Array(Eval List({Eval List( {1, create(1)})}),		create( 2 )); // empty ?!?!?

//deep dive
Associative Array({ {1, 1}},create(2)); // doesn't work
Associative Array( {1}, {1},create(2)); // works

One could argue that providing the default value during the creation of the associative array is not possible - but it works in 2 out of 4 cases.

 

hogi_0-1727335823514.png

 

1 REPLY 1
hogi
Level XIII

Re: Issue with associative arrays and default values

workaround: 

<< Set Default Value( )

Recommended Articles