3 ms·
Both of those uses of = above are actually pretty consistent, given how Atomo's scoping and dispatch system works. When you said "for 0, fib is 1," you could j
by vito 16y ago
Both of those uses of = above are actually pretty consistent, given how Atomo's scoping and dispatch system works.
When you said "for 0, fib is 1," you could just as easily say "for the current scope object, x is Object clone." This is exactly how it works. Method dispatch is 100% pattern-matching, and Atomo's scopes are 100% message dispatch, combined with delegation.
When you say "0 fib = 1", the method is inserted on Integer. When you send a message to an Integer, you're sending (pseudocode) `Single "fib" (Integer 0)`. The methods on Integer pattern-match on that, in this case with `PSingle "fib" (PMatch (Integer 0))`. If that pattern fails, it moves on to "1 fib = ...", and finally to the least-precise "(n: Integer) fib := ...".
Not sure if that answers your question, but I thought I'd expand on it a bit.