---
// ch04_ex01.javaimport java.util.*;
class ch04_ex01 {
ch04_ex01() {
System.out.println( "Creating a ch04_ex01" );
}public static void main( String[] args ) {
ch04_ex01 o = new ch04_ex01();
}
}
---
14:48 -- Starting 4.1, Lisp version
15:16 -- done
---Test:
;;; chapter 4, exercise 1
;;; Not entirely applicable to Common Lisp, since it has no "constructors", as
;;; such, but I'll give it a try. See
;;; http://groups.google.com/groups?threadm=uv6adjq6dfx.fsf%40tenebrae.ai.mit.edu
;;; for a discussion on why you shouldn't just define a "make-ch04-ex01-class"
;;; function.(defclass ch04-ex01-class ())
(defmethod initialize-instance :after ((obj ch04-ex01-class) &rest initargs)
(declare (ignore initargs))
(format t "Creating a ch04-ex01-class~%"))
(let ((obj (make-instance 'ch04-ex01-class)))
(declare (ignore obj))
(format t "finished creating a ch04-ex01-class~%"))
---
* (let ((obj (make-instance 'ch04-ex01-class)))
(declare (ignore obj))
(format t "finished creating a ch04-ex01-class~%"))
Creating a ch04-ex01-class
finished creating a ch04-ex01-class
NIL