From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Linas Vepstas" Newsgroups: gmane.lisp.guile.user Subject: Re: bug: defining things in different threads Date: Thu, 20 Nov 2008 17:23:12 -0600 Message-ID: <3ae3aa420811201523n2cc92e74m95824cdb3e3f4e86@mail.gmail.com> References: <3ae3aa420811111057k597b510eyed0f351429b0d61e@mail.gmail.com> <87bpwlcd02.fsf@gnu.org> <3ae3aa420811120927m2248e87fiacf96fc701eecda1@mail.gmail.com> <49dd78620811151449n57a0c448q20f94170bb51ff91@mail.gmail.com> Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1227223414 15763 80.91.229.12 (20 Nov 2008 23:23:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Nov 2008 23:23:34 +0000 (UTC) Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , guile-user@gnu.org To: "Neil Jerram" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Nov 21 00:24:33 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 1L3Isz-00081V-0k for guile-user@m.gmane.org; Fri, 21 Nov 2008 00:24:33 +0100 Original-Received: from localhost ([127.0.0.1]:58404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3Irp-0000e5-TG for guile-user@m.gmane.org; Thu, 20 Nov 2008 18:23:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3Irl-0000e0-Jf for guile-user@gnu.org; Thu, 20 Nov 2008 18:23:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3Iri-0000dl-UV for guile-user@gnu.org; Thu, 20 Nov 2008 18:23:17 -0500 Original-Received: from [199.232.76.173] (port=51211 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3Iri-0000di-ON for guile-user@gnu.org; Thu, 20 Nov 2008 18:23:14 -0500 Original-Received: from an-out-0708.google.com ([209.85.132.248]:58420) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3Iri-0004aI-EM for guile-user@gnu.org; Thu, 20 Nov 2008 18:23:14 -0500 Original-Received: by an-out-0708.google.com with SMTP id c38so339607ana.21 for ; Thu, 20 Nov 2008 15:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=604vyB/A35xE4Gln5u54n9IMgKOp3vS0g/04nor9FIw=; b=TpaNPA+1wVbRSXivEmUdRuy1luy5FIfi07SJmo2he1RVVL9tdhIxioXuK8Yq417KfO C8Ph1rQuizV6g4lzozrsa24h+540aSGw+NaV4YLtgQYcUkf8xhQOYQdkYrtIrA9skPbr RS6FIxEOODQNn4z/0dMmBm6B4XGKBZsX59se4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references; b=i7APyD7tyAFVrko/QB/8v8fQbkTO6uIJdgHayPEUWsXQg8QUKK5KqmUl9u9o/G/Tcc Wkb/0og5FsxSW5y104h2d4vKBQlbvFzY16z3s/nbad/7bjOpZSiD2+IthefdT9c+v4iW +Ngs9BSpuJscxvOeO9r/LjoyDRhIW2anYDmVc= Original-Received: by 10.100.140.15 with SMTP id n15mr1449995and.111.1227223392740; Thu, 20 Nov 2008 15:23:12 -0800 (PST) Original-Received: by 10.100.226.4 with HTTP; Thu, 20 Nov 2008 15:23:12 -0800 (PST) In-Reply-To: <49dd78620811151449n57a0c448q20f94170bb51ff91@mail.gmail.com> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/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:6950 Archived-At: 2008/11/15 Neil Jerram : > 2008/11/12 Linas Vepstas : > >> Yes, of course, the problem remains. > > Explanation: > > Thread 1 is the first thread that does any Guile stuff, so it loads > boot-9.scm, which means that it ends up in the (guile-user) module. > > Thread 2 hasn't done any (set-current-module ...), so it stays at the > default, which is (guile). > > Solution: add (define-module (guile-user)) to the code that you > execute in thread 2. This won't actually work, for some reason or another. Once I am in the second, third, etc. thread, then I cannot set the current module to be guile-user. So, for example: scm-interp> (current-module) # scm-interp> (define-module (guile-user)) # scm-interp> (current-module) # scm-interp> (set-current-module (define-module (guile-user))) # scm-interp> (current-module) # Here, scm-interp is my shell, which just calls scm_c_eval() from C code. What's worse, I seem to not be able to use modules when I'm in this mode. I can reproduce this behaviour from the standard command line client. So for example, list-index is defined in boot-9, but I want the one in srfi-1. They don't work alike; the boot-9 one complains about something when fed an example from srfi-1: linas@backlot: /usr/share/guile/1.8/srfi $ guile guile> (list-index even? '(3 1 4 1 5 9)) ERROR: Wrong type (expecting pair): # ABORT: (wrong-type-arg) guile> (use-modules (srfi srfi-1)) guile> (list-index even? '(3 1 4 1 5 9)) 2 guile> (current-module) # guile> (define-module (guile)) # guile> (current-module) # guile> (list-index even? '(3 1 4 1 5 9)) ERROR: Wrong type (expecting pair): # ABORT: (wrong-type-arg) guile> (use-modules (srfi srfi-1)) guile> (list-index even? '(3 1 4 1 5 9)) ERROR: Wrong type (expecting pair): # ABORT: (wrong-type-arg) guile> So apparently, it seems that I can't do a (use-modules) and have it stick, when I'm not in guile-user. What's worse, when I'm in any thread other than the first thread, I cannot get to guile-user. Which means that, no matter what, I cannot use srfi-1; there seems to be no workaround for this. --linas