▲ | kragen 4 days ago | |||||||
Oh, thanks! I didn't know that about defgeneric. How would you classify Ruby? You can reopen a class and add more methods to it at any time. | ||||||||
▲ | MarsIronPI 2 days ago | parent [-] | |||||||
Well, reopening the class is the idiomatic way to define a method after the class definition, but if I wanted to write Ruby the ML/Common Lisp way, I would use "Class.define_method" like so:
What I like most about Ruby is how close it gets to Lisp's flexibility of semantics (i.e. macros) without actually having macros. (Common Lisp is still my favorite language for larger projects though.) | ||||||||
|