From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Maciek Godek" Newsgroups: gmane.lisp.guile.user Subject: Re: Me no understand scoping Date: Sat, 2 Aug 2008 23:36:24 +0200 Message-ID: References: <87r69ccaus.fsf@unknownlamer.org> <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 1217713005 22231 80.91.229.12 (2 Aug 2008 21:36:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Aug 2008 21:36:45 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Aug 02 23:37:35 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 1KPOn2-0008QX-9T for guile-user@m.gmane.org; Sat, 02 Aug 2008 23:37:28 +0200 Original-Received: from localhost ([127.0.0.1]:41362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KPOm7-0005Ei-Ev for guile-user@m.gmane.org; Sat, 02 Aug 2008 17:36:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KPOm3-0005ET-6B for guile-user@gnu.org; Sat, 02 Aug 2008 17:36:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KPOm1-0005EB-QT for guile-user@gnu.org; Sat, 02 Aug 2008 17:36:25 -0400 Original-Received: from [199.232.76.173] (port=45575 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KPOm1-0005E8-KI for guile-user@gnu.org; Sat, 02 Aug 2008 17:36:25 -0400 Original-Received: from wf-out-1314.google.com ([209.85.200.170]:64445) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KPOm1-0002wM-3q for guile-user@gnu.org; Sat, 02 Aug 2008 17:36:25 -0400 Original-Received: by wf-out-1314.google.com with SMTP id 28so1445543wfc.24 for ; Sat, 02 Aug 2008 14:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=AN3xiiDyhefoUqgpNsz2RhRavNFFh/m5VRJYxKt4tK8=; b=Ao6nfZKa9vRZFRi/f8MUjQVFdphpXz/StLFdYSPta/8snyg2+MxziuiRrJDTq6YjeU RqHPAxVndmJ0nXtDooKnhK2iClG7oa19xCzL/WroM3Hps+0tQDchzT+Ntwzir8Y+fwQW sqfCrEnUMB/NgirfjixHap4NIJcgzEnY6frdQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=tNqWY5ziVB6ql1cK1dJDn5XSQJeNxJRD8qYmp+I7gU1xZjxZ3AqsjrDmSiZwyPUUTn UICT5kxqB92STpBwcVuckXklWx+Hsqm9DgG0OUqeZERaIp6xb01cMUqcFkaT99jQfMC1 nb3vmX+Ay0+6NeimD2ZCllnj7E3S6GHUhgKT0= Original-Received: by 10.142.191.10 with SMTP id o10mr4310580wff.94.1217712984365; Sat, 02 Aug 2008 14:36:24 -0700 (PDT) Original-Received: by 10.142.141.17 with HTTP; Sat, 2 Aug 2008 14:36:24 -0700 (PDT) In-Reply-To: <49dd78620808021043h66f6d953uff37c35d018afb80@mail.gmail.com> 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:6724 Archived-At: >> I'm currently working on a little project (in my spare time). [...] > > Many thanks for providing this description. The project looks fun, so > I hope it continues to go well. > > A few thoughts occurred to me when reading through. > > 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. 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) 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'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" > 2. You say that your protocol is lisp-ish. I have found it really > useful, both in GDS and in another client/server project, to express > the protocol entirely in lisp forms. Simply because this means that > you can use `read' to read exactly one protocol instruction; no > parsing required! Yeah, I had a similar idea, although at first I thought of making a more efficient (but less elastic) binary protocol that would require some mechanisms to convert various supported guile types to binary form. I eventually concluded that it's better to keep everything textual not only to praise my laziness, but also it would be better to make a statistical information-theory based compression protocol to speed it up (if it turns out necessary). > 3. It's still not obvious to me how this ends up using the-environment > and local-eval. If class variables never interact directly with the > real environment, they could be just stored in a hash table.. I'm just looking for the most expressive way to use the language. I've first heard of lisp like two years ago or so and even started to learn that language from David Lamkins' "Successful Lisp" and caught some of its spirit from Petet Graham's "On Lisp", but I always kept getting distracted, finding other things to do. 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 (and the same mechanism was given explicitly to the programmer). And so I never stopped to believe that (define x 5) is more or less equivalent to (hash-set! global-scope 'x 5). >> PS gdm rocks! (thankyouthankyouthankyou!! it really did change >> my way of writing the code) > > Do you mean GDS? If so, thanks for your thanks! Yes, it's a great piece of software, regardless of its name :) There's no need for your thanks for my thanks as they are deserved. M.