diff --git a/modules/std/syntax/functors/minmax.xw b/modules/std/syntax/funcs/minmax.wx similarity index 79% rename from modules/std/syntax/functors/minmax.xw rename to modules/std/syntax/funcs/minmax.wx index 40497c02..ee0bdc12 100644 --- a/modules/std/syntax/functors/minmax.xw +++ b/modules/std/syntax/funcs/minmax.wx @@ -5,29 +5,42 @@ Namespace std.syntax 'iDkP from GaragePixel 'Since 2018-2025 +'Note: In monkey library, the bad implemented min/max functions must be deactivated +'in order to make the multitypes min/max functions to works + +Function Min:T(a:T,b:T) Where T Implements INumeric + 'the limit value, if returned, is casted to the initial type + Return a:T1(a:T1,b:T2) Where T1 Implements INumeric And T2 Implements INumeric 'the limit value, if returned, is casted to the initial type Return Cast(a:T Ptr(a:T Ptr,b:T Ptr) Where T Implements INumeric Return a[0]:T(a:T Ptr,b:T Ptr) Where T Implements INumeric -' 'return type overload? -' Return a[0]:T(a:T Ptr,b:T Ptr) Where T Implements INumeric + 'return type overload? + Return a[0]:T1(a:T1 Ptr,b:T2 Ptr) Where T1 Implements INumeric And +Function Min:T1(a:T1 Ptr,b:T2 Ptr) Where T1 Implements INumeric And T2 Implements INumeric 'the limit value, if returned, is casted to the initial type Return Cast(a[0]:T(a:T,b:T,c:T) Where T Implements INumeric + + '3 arguments breaks the overloading of the language min/max stuff + 'So the language library non-native stuff was undoned, + 'and in the the word we'll have peace! Return a:T1(a:T1 Ptr,b:T2 Ptr,c:T3 Ptr) Where T1 Implements INu Return Cast(a[0]:T(a:T,b:T) Where T Implements INumeric + Return a:T1(a:T1,b:T2) Where T1 Implements INumeric And T2 Implements INumeric Return a