From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: Commercial development Date: Wed, 08 Jun 2005 20:03:17 +0100 Message-ID: <42A740F5.90400@ossau.uklinux.net> References: <115t7ajdbfq8348@corp.supernews.com> <871x966hwn.fsf@naia.workingwithlinux.com> <426505c8$0$196$edfadb0f@dread12.news.tele.dk> <426601FF.6010600@ossau.uklinux.net> <9qGdnYkVut1t0PvfRVn-rw@giganews.com> <4266AB46.2050107@ossau.uklinux.net> <4266AC41.4050105@ossau.uklinux.net> <87zmu4k03x.fsf@zagadka.de> <42A619D7.3040703@ossau.uklinux.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1118258328 10151 80.91.229.2 (8 Jun 2005 19:18:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Jun 2005 19:18:48 +0000 (UTC) Cc: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jun 08 21:18:45 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dg634-000644-JS for guile-devel@m.gmane.org; Wed, 08 Jun 2005 21:17:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg69p-0002yB-NI for guile-devel@m.gmane.org; Wed, 08 Jun 2005 15:24:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dg65V-0008Fl-Cz for guile-devel@gnu.org; Wed, 08 Jun 2005 15:19:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dg65T-0008E7-MW for guile-devel@gnu.org; Wed, 08 Jun 2005 15:19:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg5yw-0006sq-Dv for guile-devel@gnu.org; Wed, 08 Jun 2005 15:12:54 -0400 Original-Received: from [80.84.72.33] (helo=mail3.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dg5tX-0001i3-37 for guile-devel@gnu.org; Wed, 08 Jun 2005 15:07:19 -0400 Original-Received: from laruns (host81-130-111-97.in-addr.btopenworld.com [81.130.111.97]) by mail3.uklinux.net (Postfix) with ESMTP id 709A540A001; Wed, 8 Jun 2005 19:03:33 +0000 (UTC) Original-Received: from [127.0.0.1] (laruns [127.0.0.1]) by laruns (Postfix) with ESMTP id 380DB6F8E7; Wed, 8 Jun 2005 20:03:18 +0100 (BST) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1 X-Accept-Language: en Original-To: Marius Vollmer In-Reply-To: <42A619D7.3040703@ossau.uklinux.net> X-Enigmail-Version: 0.91.0.0 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:5080 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:5080 Neil Jerram wrote: > > I'm not sure it's that obscure, and it seems a shame to leave this as > ammunition for those who like to claim that Guile is not R5RS-compliant. Another possibility would be to do what SCM does. If I understand correctly, SCM does the list construction that we have noted as being necessary to pass the test, but compensates by not building the init values into a list to begin with. Instead, it builds the init values onto the stack, by using a recursive function like this: static void ecache_evalx(x) SCM x; { SCM argv[10]; int i = 0, imax = sizeof(argv)/sizeof(SCM); scm_env_tmp = EOL; while NIMP(x) { if (imax==i) { ecache_evalx(x); break; } argv[i++] = EVALCAR(x); x = CDR(x); } ENV_V2LST((long)i, argv); } The ENV_V2LST at the end then conses all the values on the stack into a list, and the calling code finishes things off by inserting that list into the extended environment. Cunning, isn't it? It passes the test because a continuation captured during an ecache_evalx call will preserve the values on the stack, and because the values on the stack are not affected by set!s on the letrec environment. What do you think? It seems like a very self-contained trick, so I think we could easily copy it to Guile. Neil _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel