From: Ralf J. <jue...@cs...> - 2008-01-12 18:36:38
|
I found that a few files were missing in the tarball. This is fixed in this one, ftp://ftp.cs.pdx.edu/pub/psu-lush/psu-lush-1.3pre5.tar.gz I also got around to adding documentation for some new features that I want to point to you: * Default constructors User defined classes inherit the constructor of the superclass as a default constructor. Of course, you are free to override this default by providing your own definition. Example: (defclass A object i) (defmethod A A (j) (setq i j) ) (defclass B A) (new B 15) * Class namespaces Every class has an associated namespace. It is empty unless you put something in it. The names in a class namespace are visible in method definitions (when <defmethod> is evaluated, that is). This is useful for defining auxiliary functions or macros that you only need in the implementation of a class. Example: (defclass A object s) (in-namespace (class A) (defalias ++ concat) ) (defmethod A A (u) (setq s (++ u u u)) ) * Template classes "Template" as in "generic programming". See the online documentation for an example. This is not a well designed language facility as C++ templates, of course. This is a hack. But I'm hoping we will be able to improve it or develop something better in the future. I needed something like this for a library of abstract datatypes that I started writing. For a more complex example take a look at the set datatypes. (libload "datatypes/int-set") etc. Ralf |