From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Neil Jerram" Newsgroups: gmane.lisp.guile.user Subject: Re: Me no understand scoping Date: Fri, 8 Aug 2008 21:54:51 +0100 Message-ID: <49dd78620808081354v292fd767q97d8f24bbdb9c6cf@mail.gmail.com> References: <489074A9.1080508@wilsonjc.us> <49dd78620807310020i8b55067gd22f6ce361a04d7d@mail.gmail.com> <49dd78620807311437g7ab367bdxed293a3b8dbd5753@mail.gmail.com> <49dd78620808021043h66f6d953uff37c35d018afb80@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218228911 26846 80.91.229.12 (8 Aug 2008 20:55:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Aug 2008 20:55:11 +0000 (UTC) Cc: guile-user@gnu.org To: "Maciek Godek" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Aug 08 22:56:02 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KRZ0A-0007Ln-4y for guile-user@m.gmane.org; Fri, 08 Aug 2008 22:55:58 +0200 Original-Received: from localhost ([127.0.0.1]:58531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRYzE-0005xd-Ky for guile-user@m.gmane.org; Fri, 08 Aug 2008 16:55:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KRYzA-0005w0-8U for guile-user@gnu.org; Fri, 08 Aug 2008 16:54:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KRYz8-0005td-TH for guile-user@gnu.org; Fri, 08 Aug 2008 16:54:55 -0400 Original-Received: from [199.232.76.173] (port=34431 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRYz8-0005tT-O1 for guile-user@gnu.org; Fri, 08 Aug 2008 16:54:54 -0400 Original-Received: from qb-out-1314.google.com ([72.14.204.174]:16449) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KRYz8-0000Sz-85 for guile-user@gnu.org; Fri, 08 Aug 2008 16:54:54 -0400 Original-Received: by qb-out-1314.google.com with SMTP id d2so1090644qbc.30 for ; Fri, 08 Aug 2008 13:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=5h0KK2O3mbAHmS78sXGLBGAQ6KRk7w/6FefuX8GvJNo=; b=pW9Ips+J1EGb+pmuTUpLDUPWWoJUK7MvjVzP2RplIgnz7mXuBklZLV3YiPztoAtX+p fSC6tKaP07L+flZXcXzFUUEhGWRxGOh7Ro/36xUsFfG3OFJxk5FcyHIIAAfioucmwabV bjSJbR7vKYdwnuU29JN6itFMBHAVt+w0x6FiA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=LvpSzF8f5coZc4C9Cfy07+fDhq1p4gQFErq5kmlYXafuEF+xv2JYjqVCz7Ws3sdZWG VrEEBTkzdUxF+RHitga/1H7X4zf/8DpdByUmLfEOLAXq52gDzA6wVepsA7LOGRQLvJ78 nKKgq/iyDSmo6ha+N8hUP02o7eG8C7E1F6JP4= Original-Received: by 10.114.148.1 with SMTP id v1mr2287195wad.21.1218228891131; Fri, 08 Aug 2008 13:54:51 -0700 (PDT) Original-Received: by 10.114.197.8 with HTTP; Fri, 8 Aug 2008 13:54:51 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6731 Archived-At: 2008/8/2 Maciek Godek : >> 1. IMO this could be really beautifully done in GOOPS, by defining >> custom metaclasses and slot types. > > I've been considering that, and I'm still having doubts. > The main reason is that there's no documented way > of accessing GOOPS objects from C (except from using > scm_c_eval_string etc.), or at least I couldn't find any > documentation for that. Yes, that's a fair point. And one that keeps coming up. I hope we can remedy this some time soon. > Besides (which is the matter of personal taste), I don't > like the idea of using generics and trashing the global > namespace with them. (I mean, the sole idea of generics > is fine, but I wouldn't want to be forced to use them) They can of course be confined to modules, like any other names. > I also get this unpleasant feeling that all these 'getters' > and 'setters' are entities multiplied beyond necessity > (even the infamous C++ doesn't explicate them) I don't understand you here. And in any case, getters and setters are optional. You can just use slot-ref and slot-set! if you prefer. > I'm really trying to get close > to the classical OOP notation: object.method() -- and > it's probably why I explore the potential of using these > "poor man's objects" Unfortunately that's only "classical" for non-Lisp-like languages! Still, I'd take your point if you said you wanted to write something that would be familiar to OO programmers in non-Lisp languages. > But the point is that I saw that there is a 'make-hash-table' function > available in lisp -- and this lead me to the conclusion that it's probably > because the scopes/closures/environments implicitly use hash > tables to store their bindings Right (more or less). > (and the same mechanism was given > explicitly to the programmer). You mean in the sense that can one create and manipulate a hash table where the keys are symbols? I'd certainly agree with that. > And so I never stopped to believe that (define x 5) is more or > less equivalent to (hash-set! global-scope 'x 5). Well yes.... but I'm afraid I'm still not sure how that leads us to local-eval ! Sorry if I'm being dumb about this! Regards, Neil