JoeStrout / miniscript

source code of both C# and C++ implementations of the MiniScript scripting language
MIT License
280 stars 64 forks source link

[C# != C++] Generated functions not unique in C# #148

Open marcgurevitx opened 7 months ago

marcgurevitx commented 7 months ago

The C# version (observed in Mini Micro) allows generated functions to be equal (==).

u = function
    f = function ; end function
    return @f
end function

print u == u

Prints 1 in Mini Micro vs 0 in command line.

Withered-Flower-0422 commented 7 months ago

I incline to the CL behavior, which produces 0 as a result.

]a = function; end function
]b = @a
]a = function; end function
]c = @a
]@b == @c
0

After all, the f is redefined after u is called, so they won't be same.