4 ms·
I don't really understand your example. Julia has both macros and builtin parametric polymorphism. Unless you expect user code to implement its own type system
by fasquoika 8y ago
I don't really understand your example. Julia has both macros and builtin parametric polymorphism. Unless you expect user code to implement its own type system (technically possible, e.g. Racket does it), then macros aren't a solution to the same problem as generics
- dagss 8y agoIf I could do SortSliceOfIntFunction := MakeIntSorter!(int) ...then I would not need generics to sort a slice of ints. I just generate code that I would have written without generics to implememt the case for ints. You need to instantiate for all cases you need manually... but today we are using go without generics entirely and it sort of works. I agree it is not the same.