From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: BT Templeton Newsgroups: gmane.lisp.guile.devel Subject: Re: *current-language* Date: Fri, 08 Jul 2011 21:03:41 -0400 Message-ID: <871uy0tgcy.fsf@olor.terpri.org> References: <87pqmjj0zo.fsf@olor.terpri.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1310173463 14314 80.91.229.12 (9 Jul 2011 01:04:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Jul 2011 01:04:23 +0000 (UTC) Cc: Andy Wingo To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jul 09 03:04:18 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QfLxy-0005Or-Fd for guile-devel@m.gmane.org; Sat, 09 Jul 2011 03:04:18 +0200 Original-Received: from localhost ([::1]:47958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfLxx-0006Gj-CM for guile-devel@m.gmane.org; Fri, 08 Jul 2011 21:04:17 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfLxm-0006GN-7V for guile-devel@gnu.org; Fri, 08 Jul 2011 21:04:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QfLxj-0004dD-6I for guile-devel@gnu.org; Fri, 08 Jul 2011 21:04:05 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:56628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfLxi-0004ce-Ge for guile-devel@gnu.org; Fri, 08 Jul 2011 21:04:02 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QfLxf-0005GW-W1 for guile-devel@gnu.org; Sat, 09 Jul 2011 03:03:59 +0200 Original-Received: from cpe-173-095-173-064.nc.res.rr.com ([173.95.173.64]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 09 Jul 2011 03:03:59 +0200 Original-Received: from bpt by cpe-173-095-173-064.nc.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 09 Jul 2011 03:03:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpe-173-095-173-064.nc.res.rr.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:eBto1d8V6L7bn4DDu8SeiPqMhDE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12648 Archived-At: BT Templeton writes: > What is `*current-language*' supposed to be used for? I see that it's > set by `(@ (ice-9 eval-string) read-and-eval)' and by `(@ (system base > compile) read-and-compile)', but not by the REPL. So calling > `primitive-load-path' on a Scheme file from a REPL for another language > works as expected, but it fails if called from a context in which > `*current-language*' is bound to a value other than the default. For > example: > > scheme@(guile-user)> ,use (ice-9 eval-string) > scheme@(guile-user)> (eval-string > ... "(eval-when-compile > ... (funcall (guile-ref (guile) primitive-load-path) > ... \"texinfo.scm\"))" > ... #:lang 'elisp) > ;;; note: source file /home/bpt/src/guile/module/texinfo.scm > ;;; newer than compiled /home/bpt/[...]/texinfo.scm.go > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /home/bpt/src/guile/module/texinfo.scm > ;;; WARNING: compilation of /home/bpt/src/guile/module/texinfo.scm failed: > ;;; key wrong-type-arg, throw args [...] > $1 = nil > > (This example currently only works in my copy of Guile, since it > requires an `eval-when-compile' special operator for Elisp.) > > I think it might be preferable to require explicit language arguments to > all compilation functions, or to default to Scheme explicitly. > > But another solution for this particular bug would be to have > `compile-file' guess the language based on the file extension, and then > `primitive-load-path' and similar functions would work with other > languages too. A simple patch implementing this follows. A complete > solution would be more general than this, of course, and might involve > making load.c aware of the existence of other languages or rewriting > some loading functions in Scheme. [patch removed] Any comments on this? I'd like to remove `*current-language*' entirely, since it doesn't seem terribly useful ATM. -- Inteligenta persono lernas la lingvon Esperanton rapide kaj facile. Esperanto estas moderna, kultura lingvo por la mondo. Simpla, fleksebla, belsona, Esperanto estas la praktika solvo de la problemo de universala interkompreno. Lernu la interlingvon Esperanton! http://lernu.net/