New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compare Functor Project #1
Comments
Now at https://github.com/waves/functor, but it has not seen any activity since May 2010. |
Besides the over use of the term "Functor" (hey, I used it first for Ruby! 👅) The Functor project differs syntactically in that is defines a new "def" method called "functor" to handle the creation of overloaded methods. Feature wise, it offers static value and lambda matching, which is something Patypus doesn't provide, but is should not be hard to add. Actually Platypus might support this in part, b/c the Beyond that the project has anonymous "functors", which are like Procs but have pattern matching built into them, and provide a small DSL to define them by hand. e.g. fib = Functor.new do |f|
f.given( Integer ) { | n | f.call( n - 1 ) + f.call( n - 2 ) }
f.given( 0 ) { |x| 0 }
f.given( 1 ) { |x| 1 }
end That's kind of nice, and I wonder if Platypus can incorporate something like that into its design as well. |
On the other hand I just looked at the code (https://github.com/waves/functor/blob/master/lib/functor.rb) and my eyes went cross. |
Take a look at the "Functor" project (yea I know, terrible name for a overload system) and compare it to Platypus' implementation of method overloading.
The text was updated successfully, but these errors were encountered: