@grainloom Why not? I don't want to guess what the map is that call each time. Overloading bad.
@amiloradovsky There aren't many reasonable ways to implement map. Overloading is only bad when it leads to ambiguity, but when there is just one implementation of functor for the given type, there is no ambiguity.
@amiloradovsky Like, there is no important difference between mapping over a cons list vs a vector vs a string.
But I might use all three in an algorithm and switch between them until I figure out which one is optimal.
You could use CLOS to define your "types" and associated methods
Or you could use transducers
Guile has an object system, similar, in spirit, to CLOS
https://www.gnu.org/software/guile/manual/html_node/Methods-and-Generic-Functions.html
@AbbieNormal @amiloradovsky @grainloom Anyway, vlist-map in Guile is too tempting. I want to use it. 😅
Sometimes I wonder if Scheme had integerinteger+ integerfloat+ floatfloat+.
@veer66 @AbbieNormal @grainloom The arithmetic is already "polymorphic":
> (+ (sqrt -1) 1)
$1 = 1.0+1.0i
@AbbieNormal I used goops even when I don't have to. https://github.com/veer66/wordcut-guile/blob/master/wordcut/tokenizer.scm 😅