From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Walck, Scott" Newsgroups: gmane.lisp.guile.user Subject: RE: set-current-module in .guile ? Date: Sun, 6 Apr 2008 21:27:05 -0400 Message-ID: References: <18423.46537.161648.253613@entangle.lvc.edu> <47F7E878.20609@wilsonjc.us> , <87iqyvrpwj.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1207531609 19127 80.91.229.12 (7 Apr 2008 01:26:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2008 01:26:49 +0000 (UTC) To: "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Apr 07 03:27:22 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 1Jig8l-00028m-P1 for guile-user@m.gmane.org; Mon, 07 Apr 2008 03:27:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jig88-0004yK-JA for guile-user@m.gmane.org; Sun, 06 Apr 2008 21:26:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jig83-0004u9-C1 for guile-user@gnu.org; Sun, 06 Apr 2008 21:26:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jig7y-0004jY-Kz for guile-user@gnu.org; Sun, 06 Apr 2008 21:26:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jig7y-0004jN-92 for guile-user@gnu.org; Sun, 06 Apr 2008 21:26:30 -0400 Original-Received: from lvc02.lvc.edu ([192.77.143.72] helo=exchange.lvc.edu) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1Jig7x-00032O-U7 for guile-user@gnu.org; Sun, 06 Apr 2008 21:26:30 -0400 Original-Received: from lvc02.lvc.edu ([10.1.1.71]) by lvc02.lvc.edu ([10.1.1.71]) with mapi; Sun, 6 Apr 2008 21:27:05 -0400 Thread-Topic: set-current-module in .guile ? Thread-Index: AciX9t/pABecE+ICRlWSNV+THdhPzAAVlisI In-Reply-To: <87iqyvrpwj.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ 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:6521 Archived-At: Hi, That seems to cause me a core dump. scott@dell:~$ guile guile> (load "/usr/local/src/guile-scmutils/src/load.scm") guile> + # guile> (module-use! (current-module) generic-environment) #f guile> + # guile> (+ 2 3) 5 guile> (+ (vector 5 6) (vector 7 8)) Segmentation fault (core dumped) scott@dell:~$ Here is how it is designed to work: scott@dell:~$ guile guile> (load "/usr/local/src/guile-scmutils/src/load.scm") guile> + # guile> (+ (vector 2 3) (vector 5 6)) Backtrace: In current input: 3: 0* [+ {#(2 3)} #(5 6)] :3:1: In procedure + in expression (+ (vector 2 3) (vector 5 = 6)): :3:1: Wrong type argument in position 1: #(2 3) ABORT: (wrong-type-arg) guile> (set-current-module generic-environment) # guile> + # guile> (+ (vector 2 3) (vector 5 6)) #(7 9) guile> and what I'd really like to do is find a way to effectively execute the (set-current-module generic-environment) command before the user gets the guile prompt. I'll keep trying things, an= d let you know if something works. What puzzles me is that if I just put code in my .guile file to define the = things I want, like (define + g:+) (define * g:*) etc., I begin to get strange stack overflows, and what appear to be infinite loop= s. I conclude that the underlying primitive operations are needed somewher= e by some procedure. The whole thing is pretty treacherous, I guess. Than= ks for your ideas. Scott ________________________________________ From: guile-user-bounces+walck=3Dlvc.edu@gnu.org [guile-user-bounces+walck= =3Dlvc.edu@gnu.org] On Behalf Of Ludovic Court=E8s [ludo@gnu.org] Sent: Sunday, April 06, 2008 10:58 AM To: guile-user@gnu.org Subject: Re: set-current-module in .guile ? Hi, "Walck, Scott" writes: > I don't know how to use use-modules in this situation. That should be something like: (module-use! (current-module) generic-environment) `use-modules' is just syntactic sugar that does this. Let us know if it solves you problem. Thanks, Ludo'.