[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: still is obscure to me ...

From: Rob Browning
Subject: Re: still is obscure to me ...
Date: 09 Jun 2001 00:46:43 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

David Pirotte <address@hidden> writes:

> (define-macro (dbu/build-db-class-1 class-name slot-defs slot-idts)
>   `(begin
>      (define-class ,class-name () ,@slot-defs)
>      (export class-name ,@slot-idts)))
> (define (dbu/build-db-class tb-nme tb-att)
>   (let ((cl-name (string->symbol (string-append "<" tb-nme ">"))))
>     (call-with-values 
>      (lambda () (dbu/build-db-class-slots tb-att))
>      (lambda (slot-idts slot-defs)
>        (dbu/build-db-class-1 cl-name slot-defs slot-idts)
>        ))))

I haven't messed with goops much myself yet, but my guess is that the
problem is that you're building a function that internally defines a
class, but if classes are like normal scheme definitions, then that
class only "exists" within the scope of the function you've created.

This would be like saying:

  (define (foo)
    (define bar 13)

Here bar is not visible outside the function, and I'm not really sure
what calling export on it would do.  I'd have to run some tests and/or
read the module system docs/code to see.  Regardless, unless exporting
something that's not defined at the top level is documented as kosher,
you'd best avoid it.

Rob Browning <address@hidden> PGP=E80E0D04F521A094 532B97F5D64E3930

reply via email to

[Prev in Thread] Current Thread [Next in Thread]