I don’t think this has been covered elsewhere, but did you know that you can set default arguments for variables that are in different places with different arguments?
Here’s a snip code:
m "rep_mitchell_concatenation_arguments_for_shapes:
skip $""{1=1},$""{2=0},$""{3=1},$""{4=1}
ratio:=cut($""1,0,1)
if !$ratio error ratio_arg>0==F fi
sublevel:=abs($""3)+1
status $ratio,$""2,$sublevel,$""4
Note that series of double "s? That means this command use local $1,$2 instead of global $1,$2. So, I could set skip for arguments, and do this instead to ensure default variables for variables that are placed differently with different arguments:
ratio,angle,sublevel,fit_inside=${rep_mitchell_concatenation_arguments_for_shapes\ ${9-10},${13-14}}
So, ${9-10}
, and ${13-14}
might be switched to different place with different arguments like ${10-11}
and ${14-15}
and the output would still be the same without specifiying arguments on those. This ensure that you can set default arguments at a local level if you have not specified them.