= TODO * Also think about how to extend the DBC abilities. Invariants would be nice, but how to implement them? * Add multi method dispatch facilities similar to those from dispatch.rb. It would be good if code could be shared between that and signatures. * Write introductionary explanation of what we do and don't and why we do so. Probably belongs into the README but should also appear in the RDoc output. http://split-s.blogspot.com/2005/02/quack-quack.html might be useful for explaining why this is better than doing the usual is-a typing of static languages. * Perhaps teach the Rakefile how to export the SVN tree to the RubyForge project (see http://svn2cvs.tigris.org/) * If we add DBC we probably ought to have ways of getting the pre and post checks as well as the in-variants as an Array of Procs or something like that. * Make Method#signature return a meta object that allows you to do method.signature.matches?(*args) or something similar? = Done * Add methods for querying signature meta information. (Unbound)Method#signature would return the original Module#signature arguments. * Set up a RubyForge project and teach the Rakefile how to upload releases * Contact the pragprog guys about DBC in Ruby: http://www.eng.cse.dmu.ac.uk/~hgs/projects/ruby_dbc.html * Done, might base post/pre-conditions implementation on that project * Think about the kind of object adaption that matz discussed on his weblog: http://redhanded.hobix.com/inspect/staticTyping.html Also see http://www.python.org/peps/pep-0246.html and http://peak.telecommunity.com/DevCenter/MonkeyTyping adaption :from => Pathname, :to => String, :via => :to_str adaption :from => String, :to => Pathname do |string| Pathname.new(string) end adaption :from => String, :to => Pathname, :via => Pathname.method(:new) Perhaps make both :from and :to default to self so short forms are possible inside classes: (raise Exception when :to == :from) class String adaption :to => Pathname, :via => Pathname.method(:new) adaption :from => Pathname, :via => :to_str adaption :to => Symbol, :via => :to_sym end Might be nice to have conditional adaption routes: class Object adaption :to => String, :via => :to_str, :if => Contract::Check::Quack[:to_str] # perhaps also introduce this short form adaption :to => String, :via => :to_str, :if => :to_str end Perhaps :if should default to :via if :via is a Symbol which would allow the above to become class Object adaption :to => String, :via => :to_str end * Implemented. * Think about implementing Contract#implies which would automatically trigger the inclusion of a Module on other Modules/Classes that do fulfills(contract). * Implemented. * Module#fulfills(contract) -- a way of stating that all instances of a Class should be checked against the contract after initialisation. This would always need to be called after defining a custom initialize(). * Read http://www.smalltalk.org/articles/ * Has a few generic comments about static typing and dynamic typing.