From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "John W. Eaton" Newsgroups: gmane.lisp.guile.user Subject: Re: translators and scoping rules (was: Re: language translator help) Date: Sun, 28 Apr 2002 21:26:22 -0500 Sender: guile-user-admin@gnu.org Message-ID: <15564.44878.450070.152178@segfault.bogus.domain> References: <15561.38014.967466.255795@segfault.bogus.domain> <15563.18499.936272.639276@segfault.bogus.domain> <87662cnd8c.fsf@zagadka.ping.de> <15564.317.135557.127405@segfault.bogus.domain> <87znznnb6i.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1020047274 31820 127.0.0.1 (29 Apr 2002 02:27:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 29 Apr 2002 02:27:54 +0000 (UTC) Cc: guile-user Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 1720tO-0008H7-00 for ; Mon, 29 Apr 2002 04:27:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1720sd-0000iE-00; Sun, 28 Apr 2002 22:27:07 -0400 Original-Received: from bevo.che.wisc.edu ([128.104.177.141]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1720ry-0000gE-00 for ; Sun, 28 Apr 2002 22:26:26 -0400 Original-Received: from segfault.bogus.domain (12-221-96-229.client.insightBB.com [12.221.96.229]) by bevo.che.wisc.edu (8.12.1/8.12.1/Debian -5) with ESMTP id g3T2QPZo011095; Sun, 28 Apr 2002 21:26:25 -0500 Original-Received: from segfault.bogus.domain (localhost [127.0.0.1]) by segfault.bogus.domain (8.12.2/8.12.2/Debian -5) with ESMTP id g3T2QNcv003817; Sun, 28 Apr 2002 21:26:24 -0500 Original-Received: (from jwe@localhost) by segfault.bogus.domain (8.12.2/8.12.2/Debian -5) id g3T2QM4f003814; Sun, 28 Apr 2002 21:26:22 -0500 Original-To: Marius Vollmer In-Reply-To: <87znznnb6i.fsf@zagadka.ping.de> X-Mailer: VM 7.04 under Emacs 20.7.2 Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.9 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:363 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:363 On 28-Apr-2002, Marius Vollmer wrote: | "John W. Eaton" writes: | | > [defining new local variables via eval.] | > | > OK. I'm not sure whether this feature is really necessary, but it | > might also turn out to be a mistake to design the translator in way | > that makes it impossible. | | Can you statically determine whether a function uses eval in such a | way? If so, you can generate efficient code for functions that can | not define new locals, and use some horrible scheme for functions that | can. I'm not sure. It would be easy to determine whether a function uses eval(), but I think it would be harder to decide whether what funny stuff might be going on with eval since the string to be evaluated can come from anywhere, including user input. If I have something like function y = foo (some_string) eval (some_string); y = sin (x); endfunction and SOME_STRING doesn't define a variable X, it is an error anyway, and we could probably detect that. OTOH, there is no way to determine what might happen for function foo (string_one, string_two) eval (string_one); eval (string_two); endfunction since the code in STRING_TWO might depend on what variables were defined in STRING_ONE. Does it matter? I don't know. I don't think I would ever write a program that does these kinds of things, but it is allowed by Matlab, and Octave users like the fact that Octave has until now tried to be mostly compatible. Before I do a lot of coding, I'm trying to explore what can be done easily if I decide to have Octave emit Scheme code for Guile to interpret. jwe _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user