differences between miniscript and Mini Micro
hi, how to add prototype to function?
funcRef.a=function()
>>> print "hello"
>>> end function
> (@print)["a"]
Runtime Error: Key Not Found: 'a' not found in map [line 1]
> (@print).a
Runtime Error: Key Not Found: 'a' not found in map [line 1]
but, in Mini Micro, this works:
] funcRef.a=function()
...] print "hello"
...] end function
] (@print)["a"]
hello
] (@print).a
hello
both latest version 1.6.2
and why null +3 is null , 3+null == 3 ?
https://miniscript.org/wiki/Null Numeric arithmetic with null is null When null is involved in any numeric expression, the result is null. For example, null + 42 is null.
The first problem is a known bug, see in #70 .
The second question:
- String has the highest priority. If an expression has strings, the result is a sting. (null + "1" == "1"; 2 + "3" == "23")
- Otherwise, MiniScript tends to convert the data type to the same as what it meets first. (null + 3 == null; 3 + null == 3)
- Lists and Maps have their own method of calculation.
@Withered-Flower-0422 The first issue has nothing to do with #70. #70 only happens with (@a.b).c, not (@a).b, and even if it did, ["a"] completely avoids it.
The issue looks like c++ version doesn't allow properly lookup on the funcRef objects, or at least doesn't look up funcRef map for them