---Bruce says, "Describe a use for this feature (other than the one specified in this book [i.e. to support the initialization of anonymous inner classes])." I must admit, I can't see a use for this facility (yet :). It seems to me that everything you could do in the non-static instance initialization, you could do in a constructor. I suppose having a non-static instance initialization sequence allows you to put common constructor code in a single place -- but you could put it in a normal method which you just call from the constructor, too. *shrug* I dunno.
// ch04_ex18.javaclass ch04_ex18 {
String string1;
{
string1 = "init in instance init area";
}void demo_init() {
System.out.println( "string1: " + string1 );
}public static void main(String[] args) {
ch04_ex18 obj = new ch04_ex18();
obj.demo_init();
}
}
---
This exercise doesn't really apply to Common Lisp/CLOS.