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: Fri, 21 Nov 2008 09:39:05 -0600 Message-ID: <3ae3aa420811210739q5ea09bc0y13c36ed9923a0cd4@mail.gmail.com> References: <3ae3aa420811111057k597b510eyed0f351429b0d61e@mail.gmail.com> <87bpwlcd02.fsf@gnu.org> <3ae3aa420811120927m2248e87fiacf96fc701eecda1@mail.gmail.com> <49dd78620811151449n57a0c448q20f94170bb51ff91@mail.gmail.com> <3ae3aa420811201523n2cc92e74m95824cdb3e3f4e86@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 1227281965 13035 80.91.229.12 (21 Nov 2008 15:39:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Nov 2008 15:39:25 +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 16:40:25 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 1L3Y7M-0004u1-TU for guile-user@m.gmane.org; Fri, 21 Nov 2008 16:40:25 +0100 Original-Received: from localhost ([127.0.0.1]:58549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3Y6D-0005TF-MJ for guile-user@m.gmane.org; Fri, 21 Nov 2008 10:39:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3Y68-0005T0-J6 for guile-user@gnu.org; Fri, 21 Nov 2008 10:39:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3Y66-0005Sn-SX for guile-user@gnu.org; Fri, 21 Nov 2008 10:39:07 -0500 Original-Received: from [199.232.76.173] (port=44240 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3Y66-0005Sk-LP for guile-user@gnu.org; Fri, 21 Nov 2008 10:39:06 -0500 Original-Received: from hs-out-0708.google.com ([64.233.178.240]:2841) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3Y66-0006vv-F6 for guile-user@gnu.org; Fri, 21 Nov 2008 10:39:06 -0500 Original-Received: by hs-out-0708.google.com with SMTP id 55so571975hsc.10 for ; Fri, 21 Nov 2008 07:39:05 -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=Pif7B7rTO3sJZugwCT0qKn98k6Z3z3s4LNXrtJpy/r8=; b=w8IVeHCuRD2XKQd/MKgbvlx5s5/UJtvKW+Vo6dIEbV4V/1w+ixb2ULGQdrgk36ypCk L4tRnZLEVVMNVa4b+CzQwxyKCLzRgYlmVYQH8wDW/5mrHG+rl38ltkBPPkJlq8rxCBG4 bNcEvKTlOnMzlBJBUZFg2yG2lgHLjCTwt0DcE= 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=dzOZ3s1UbutQ/flQbnMbSlrvzLFCNTs7NiQByplckBHmLHHkS9W9OvyyC7DFN3uCeM RX8N38cBFVsWBbb741iPK5OTSY1weYqM+pbom/VnWcxR4hZn5hbRTKYKtHDSh/5fejcZ 007rnOz40joxlbnrVDxbpMwh/zfp/I/8CwWLE= Original-Received: by 10.100.248.9 with SMTP id v9mr258680anh.115.1227281945176; Fri, 21 Nov 2008 07:39:05 -0800 (PST) Original-Received: by 10.100.226.4 with HTTP; Fri, 21 Nov 2008 07:39:05 -0800 (PST) In-Reply-To: <3ae3aa420811201523n2cc92e74m95824cdb3e3f4e86@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:6957 Archived-At: The saga continues... 2008/11/20 Linas Vepstas : > 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. This is because the C eval uses the dynwind to get into a certain module. So if one *sets* the module, the dynwind mechanism promptly unsets it as one returns after the evaluation. --linas