It would be quite convenient if JMP allowed the Substitute() function to have an optional argument such as Substitute( ...., First Occurrence( 1 ) ). This will help when passing arguments into a function by reference. Consider the following:
some function = Function( {_function, _args},
{Default Local},
function = Name Expr( _function );
Eval( Substitute( _args, {}, Expr( function ) ) )
);
other function = Function( {_1, _2, _3 = "optional"},
Show( _1, _2, _3 )
);
some function( Name Expr( other function ), {1, 2, 3} );
/* OUTPUT
_1 = 1;
_2 = 2;
_3 = 3;
*/
some function( Name Expr( other function ), {1, {2, 4}, 3} );
/* EXPECTED OUTPUT
_1 = 1;
_2 = {2, 4};
_3 = 3;
*/
Here in the first function I am calling a referenced function with a given argument list. The problem is that the Subsitute() replaces tous lists with the function call, instead of the outer one only. This is where it would be nice to substitute only the first occurrence of the List() expression.
@ErraticAttack Merci pour la suggestion.Nous examinons cela et ferons un suivi sur ce que nous décidons de faire ou s'il existe une solution de contournement pour faire ce que vous voulez faire.
Salut @ErraticAttack , Merci pour votre suggestion! Nous avons enregistré votre demande et la prendrons en considération.