2 ms·
In Jay (a language not finished) there is a prefix for the parameter who is the 'master' type (if memory serves '$'), this has the following benefits: -in fun f
by renox 11y ago
In Jay (a language not finished) there is a prefix for the parameter who is the 'master' type (if memory serves '$'), this has the following benefits:
-in fun f(a:$T, b:T) and f(1, 'hello') you can say
Error parameter 'b' is a string but generic type T is int as defined by parameter 'a'.
-no need to have a separate definition of generic types as in fn f<T>(a:T): fn f(a:$T) tells you already which type is generic.