Well fundamentally it seems to go against problem decomposition, which naturally yields generic solutions.
-
-
In functional programming at least (but also in OOP) this kind of generics has been tremendously popular.
1 reply 0 retweets 0 likes -
Replying to @klmr @hadleywickham
Generic functions with multiple dispatch have not been popular.
3 replies 0 retweets 3 likes -
it's confusing here because in FP "generic functions" usually means a single, type-parametric impl
1 reply 0 retweets 3 likes -
It turns out generic is a pretty generic term. :)
2 replies 0 retweets 2 likes -
Replying to @johnmyleswhite @avibryant
does any language provide generic funs with multiple dispatch but no inheritance? (i.e. go style composition)
1 reply 0 retweets 0 likes -
Replying to @hadleywickham @avibryant
Not sure. Does Go do something like that? I thought it had no generics: one func name <=> one args signature.
1 reply 0 retweets 0 likes -
Replying to @johnmyleswhite @hadleywickham
in Julia inheritance is only of "abstract types" where are interfaces (no state), right? Seems similar.
2 replies 0 retweets 0 likes -
given that, an interesting thought experiment is this FP-inspired twist on Julia: a) no explicit inheritance,
1 reply 0 retweets 1 like -
b) abstract types still exist, and are used (required) in the signatures for generic functions,
1 reply 0 retweets 1 like
c) a concrete type "inherits" from an abstract type iff there are implementations for all generic fns which
-
-
... reference that abstract type.
1 reply 0 retweets 1 like -
(to feel a bit more static, require that generic fns can only reference abstract types from their own module)
0 replies 0 retweets 0 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.