Re: [Clg-devel] Some thoughts
Brought to you by:
espen
From: Christophe R. <cs...@ca...> - 2001-11-20 15:55:47
|
On Tue, Nov 20, 2001 at 10:38:33AM -0500, Bob Rogers wrote: > Actually, CLHS[1] specifies that the main system-defined method does > slot initialization, so it is cleaner to use :after methods, e.g.: > > (defmethod initialize-instance :after (...) > (do-some-more-stuff)) > > This also makes the intent clearer as well, and takes care of preserving > the return value(s) from the main method (the "let" only covers the > first value, incidentally). True. > However, the return value doesn't matter in > this case, since (again, according to CLHS), the return value of > initialize-instance is not defined by the ANSI language. (Perhaps you > are thinking of make-instance?) Hmm. The CLHS that I have has: """ Syntax: initialize-instance instance &rest initargs &key &allow-other-keys => instance """ which seems fairly explicit to me, though I grant you that it's not in the description of initialize-instance. That said, I'd go with :after methods on shared-initialize, probably. I'll soon get round to posting a reference to my translations of the GTK tutorial, I hope, whereupon people can comment about the right way of doing things... Cheers, Christophe -- Jesus College, Cambridge, CB5 8BL +44 1223 510 299 http://www-jcsu.jesus.cam.ac.uk/~csr21/ (defun pling-dollar (str schar arg) (first (last +))) (make-dispatch-macro-character #\! t) (set-dispatch-macro-character #\! #\$ #'pling-dollar) |