2 ms·
Theoretically, Erlang does this as well; it just restricts the set of functions you can use in a clause-head to a language-defined set† of pure (and almost enti
by derefr 8y ago
Theoretically, Erlang does this as well; it just restricts the set of functions you can use in a clause-head to a language-defined set† of pure (and almost entirely O(1)‡) functions, such that you don't really worry about how much or little computation is going on during clause-head unification.
† https://learnyousomeerlang.com/syntax-in-functions#guards-guards https://learnyousomeerlang.com/syntax-in-functions#guards-gu...
‡ `length(List)` is allowed in guards and is O(N), though it could be O(1) in a different VM implementation that makes different trade-offs.