From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Neil Jerram" Newsgroups: gmane.lisp.guile.user Subject: Re: Can scm_shell be interrupted? Date: Sun, 1 Jun 2008 22:58:03 +0100 Message-ID: <49dd78620806011458y3a400af9hf7e5b7b63e1dd33@mail.gmail.com> References: <200805161829.02777.vrsoft@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1212357525 19582 80.91.229.12 (1 Jun 2008 21:58:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Jun 2008 21:58:45 +0000 (UTC) Cc: guile-user@gnu.org To: "Remco Bras" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jun 01 23:59:27 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 1K2vaI-0004Ny-7T for guile-user@m.gmane.org; Sun, 01 Jun 2008 23:59:26 +0200 Original-Received: from localhost ([127.0.0.1]:33408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2vZW-0005IX-AJ for guile-user@m.gmane.org; Sun, 01 Jun 2008 17:58:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2vZ0-00056H-I8 for guile-user@gnu.org; Sun, 01 Jun 2008 17:58:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2vYy-00055W-WE for guile-user@gnu.org; Sun, 01 Jun 2008 17:58:05 -0400 Original-Received: from [199.232.76.173] (port=44714 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2vYy-00055R-SF for guile-user@gnu.org; Sun, 01 Jun 2008 17:58:04 -0400 Original-Received: from rv-out-0708.google.com ([209.85.198.251]:31601) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K2vYy-0003en-Ei for guile-user@gnu.org; Sun, 01 Jun 2008 17:58:04 -0400 Original-Received: by rv-out-0708.google.com with SMTP id k29so1289391rvb.6 for ; Sun, 01 Jun 2008 14:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=2R/TgG5SKPRh2CAIOYRIxR7Uzpf76utEotSA38nOK4A=; b=jQZugRZQqk3V1gqLKxq/LIeyMPJQ5of7aiN/icuUGwCnU5sYUROajcVfA0ccJpzawMuecq38juqRl+DiXm5L4jYE5W3Dp0TOkMxoU8GXI93Vu1DsjmbL6NyZm9kTLt0bTQwUg5zuR4gm3P7WXjFNOffO8vithGfMET+Py8lXGnU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iKF4gZoGCDaaxKg5XVd7m2IrRN75ezz9MA5VOf8COeFmw2/J8LObw3WnTsNGo7oi9b1m8SUOQT3J3VhPGzzJ3nykCcdY/5t3LawJWgdwnZW5Szg5G1VxQ3RlzCtbH4W3bqgL3Eof/uq3ryn4PiqdjhkTCe2AaYZOYqMVGVghkVY= Original-Received: by 10.114.193.1 with SMTP id q1mr7842994waf.70.1212357483339; Sun, 01 Jun 2008 14:58:03 -0700 (PDT) Original-Received: by 10.114.197.7 with HTTP; Sun, 1 Jun 2008 14:58:03 -0700 (PDT) In-Reply-To: <200805161829.02777.vrsoft@gmail.com> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: 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:6596 Archived-At: 2008/5/16 Remco Bras : > Hello, > > after the last exchange in this thread, I wrote and tested a prototype of a > repl for my app. The code for this is as follows: > > int > exec_guile_shell (void *unused_arg) > { > scm_init_guile(); [...] > This is run when the app starts, after using scm_c_define_gsubr to define the > primitive interface my app exports and after scm_c_primitive_load is used to > read in user-defined scheme files. [...] > For the most part, this works fine, but if I use this REPL to evaluate a call > to one of the functions I have defined using scm_c_define_gsubr, for example > (stop-repl), the function is unbound in the environment the REPL uses. I've > tried using scm_interaction_environment() as a second argument to scm_eval > rather than using scm_primitive_eval, but that did not solve this problem. What environment (or module) are your gsubrs defined in, and how exactly does your C code achieve this? Does exec_guile_shell() run in a separate thread from the thread where the gsubrs were defined? Neil