* goops question
@ 2002-07-07 8:45 Dirk Herrmann
2002-07-08 18:26 ` Marius Vollmer
0 siblings, 1 reply; 4+ messages in thread
From: Dirk Herrmann @ 2002-07-07 8:45 UTC (permalink / raw)
Hi,
can some of the goops experts please confirm:
"define-class, define-generic and define-accessor can only be used at the
top level"
Best regards,
Dirk Herrmann
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: goops question
2002-07-07 8:45 goops question Dirk Herrmann
@ 2002-07-08 18:26 ` Marius Vollmer
2002-07-08 19:59 ` Dirk Herrmann
2002-07-09 21:17 ` Neil Jerram
0 siblings, 2 replies; 4+ messages in thread
From: Marius Vollmer @ 2002-07-08 18:26 UTC (permalink / raw)
Cc: guile-devel, guile-user
Dirk Herrmann <dirk@sallust.ida.ing.tu-bs.de> writes:
> "define-class, define-generic and define-accessor can only be used at the
> top level"
I'm not calling myself an expert here, but I would say that it is very
valid to use 'define-class' inside some lexical scope. Just think of
utility structs that are only used in one function.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: goops question
2002-07-08 18:26 ` Marius Vollmer
@ 2002-07-08 19:59 ` Dirk Herrmann
2002-07-09 21:17 ` Neil Jerram
1 sibling, 0 replies; 4+ messages in thread
From: Dirk Herrmann @ 2002-07-08 19:59 UTC (permalink / raw)
Cc: guile-devel, guile-user
On 8 Jul 2002, Marius Vollmer wrote:
> Dirk Herrmann <dirk@sallust.ida.ing.tu-bs.de> writes:
>
> > "define-class, define-generic and define-accessor can only be used at the
> > top level"
>
> I'm not calling myself an expert here, but I would say that it is very
> valid to use 'define-class' inside some lexical scope. Just think of
> utility structs that are only used in one function.
Surprisingly, define-class is the only one of the three where in the code
it is explicitly checked that it is only executed on the top level. For
this reason, the definition of define-class could really easily converted
to use an mmacro instead of a macro.
For define-generic and define-accessor things are different: In the code
there is no explicit check for asserting execution on the top level.
However, I was not able to make define-generic work in a lexical scope: I
always get 'bad define placement' as a result - although I don't
understand it.
However, if it was granted that define-class, define-generic and
define-accessor are all three just used on the top level, they can simply
be converted to use an mmacro instead of a macro: just exchange the call
to procedure->macro by a call to procedure->memoizing macro, and you are
done.
Thus, I would like people to confirm that it is actually not possible to
use define-class, define-generic and define-accessor other than at the top
level. If someone can give us an counterexample, things will be more
difficult.
Best regards
Dirk Herrmann
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: goops question
2002-07-08 18:26 ` Marius Vollmer
2002-07-08 19:59 ` Dirk Herrmann
@ 2002-07-09 21:17 ` Neil Jerram
1 sibling, 0 replies; 4+ messages in thread
From: Neil Jerram @ 2002-07-09 21:17 UTC (permalink / raw)
Cc: Dirk Herrmann, guile-devel, guile-user
>>>>> "Marius" == Marius Vollmer <mvo@zagadka.ping.de> writes:
Marius> Dirk Herrmann <dirk@sallust.ida.ing.tu-bs.de> writes:
>> "define-class, define-generic and define-accessor can only be used at the
>> top level"
Marius> I'm not calling myself an expert here, but I would say
Marius> that it is very valid to use 'define-class' inside some
Marius> lexical scope. Just think of utility structs that are
Marius> only used in one function.
Agreed, and it seems reasonable to me to use lexical generics (and so
accessors) as well.
Neil
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-07-09 21:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-07 8:45 goops question Dirk Herrmann
2002-07-08 18:26 ` Marius Vollmer
2002-07-08 19:59 ` Dirk Herrmann
2002-07-09 21:17 ` Neil Jerram
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).