Re: GOOPS: Customizing class instantiation

2006-09-28 Thread Neil Jerram
[EMAIL PROTECTED] (Ludovic Courtès) writes: > In short, the lesson is: one should use `make-class' (although > it's undocumented) rather than `(make ...)' when instantiating a > new class. Apologies for not playing earlier, but for the record I agree that this is the right answer. The GOOPS cod

Re: GOOPS: Customizing class instantiation

2006-09-27 Thread Ludovic Courtès
Hi, Nobody won the prize, because nobody gave the correct answer. For those of you who played, I'm giving the correct answer below. ;-) [EMAIL PROTECTED] (Ludovic Courtès) writes: > (use-modules (oop goops)) > (read-set! keywords 'prefix) > > (define-class () > (the-slot :init-value

Re: GOOPS: Customizing class instantiation

2006-09-27 Thread Ludovic Courtès
Hi, "Pat Lasswell" <[EMAIL PROTECTED]> writes: > On 9/26/06, Ludovic Courtès <[EMAIL PROTECTED]> wrote: >   (define-method (make-instance (c )) > (format (current-error-port) "make-instance (~a)~%" c) > (next-method)) > Try adding a '. initargs' after '(c )'. I shouldn't be needed and it

Re: GOOPS: Customizing class instantiation

2006-09-26 Thread Pat Lasswell
On 9/26/06, Ludovic Courtès <[EMAIL PROTECTED]> wrote:  (define-method (make-instance (c )) (format (current-error-port) "make-instance (~a)~%" c)(next-method))Try adding a '. initargs' after '(c )'.cheerspatOn 9/26/06, Ludovic Courtès <[EMAIL PROTECTED]> wrote: Hi,I'm trying to "dynamical

Re: GOOPS: Customizing class instantiation

2006-09-26 Thread Ludovic Courtès
Hi, [EMAIL PROTECTED] (Ludovic Courtès) writes: > guile> (define c (make-a-class 'some-name)) > guile> (define obj (make c)) > guile> obj > #< some-name deadbeef> This should rather be: #. > This is quite unexpected since I would expect, at least, the > `initialize' class for instances

GOOPS: Customizing class instantiation

2006-09-26 Thread Ludovic Courtès
Hi, I'm trying to "dynamically" create classes which I would then like to instantiate. The behavior I would like to achieve is that: guile> (define c (make-a-class 'some-name)) guile> (define obj (make c)) guile> obj #< some-name deadbeef> To that purpose, I have a metaclass named `' an