From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dirk Herrmann Newsgroups: gmane.lisp.guile.user Subject: Re: goops question Date: Mon, 8 Jul 2002 21:59:11 +0200 (CEST) Sender: guile-user-admin@gnu.org Message-ID: References: <87fzyu9iu0.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1026158608 4469 127.0.0.1 (8 Jul 2002 20:03:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 8 Jul 2002 20:03:28 +0000 (UTC) Cc: guile-devel@gnu.org, guile-user@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17RejH-00019x-00 for ; Mon, 08 Jul 2002 22:03:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17Reg3-0003Ng-00; Mon, 08 Jul 2002 16:00:07 -0400 Original-Received: from sallust.ida.ing.tu-bs.de ([134.169.132.52]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17RefD-0003Me-00; Mon, 08 Jul 2002 15:59:15 -0400 Original-Received: from localhost (dirk@localhost) by sallust.ida.ing.tu-bs.de (8.9.3+Sun/8.9.1) with ESMTP id VAA12654; Mon, 8 Jul 2002 21:59:11 +0200 (CEST) Original-To: Marius Vollmer In-Reply-To: <87fzyu9iu0.fsf@zagadka.ping.de> Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:715 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:715 On 8 Jul 2002, Marius Vollmer wrote: > Dirk Herrmann 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-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user