From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Basa Centro Newsgroups: gmane.lisp.guile.user Subject: Re: Transient environment with standard functions Date: Fri, 10 Jun 2016 20:39:33 +0000 Message-ID: References: <30B0B35B-F6B0-4FD4-A35D-3E6542C3871F@gmail.com> <7B7BC3F7-A25D-427D-8E21-D3583C3C7DEA@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1465591202 8206 80.91.229.3 (10 Jun 2016 20:40:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2016 20:40:02 +0000 (UTC) Cc: matt.j.keeter@gmail.com To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 10 22:40:01 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bBTDl-0006Co-4V for guile-user@m.gmane.org; Fri, 10 Jun 2016 22:40:01 +0200 Original-Received: from localhost ([::1]:44293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBTDh-0001vU-53 for guile-user@m.gmane.org; Fri, 10 Jun 2016 16:39:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBTDM-0001vB-S7 for guile-user@gnu.org; Fri, 10 Jun 2016 16:39:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBTDK-0007np-Mu for guile-user@gnu.org; Fri, 10 Jun 2016 16:39:35 -0400 Original-Received: from mail-oi0-x22e.google.com ([2607:f8b0:4003:c06::22e]:35938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBTDK-0007ne-IP for guile-user@gnu.org; Fri, 10 Jun 2016 16:39:34 -0400 Original-Received: by mail-oi0-x22e.google.com with SMTP id p204so129647097oih.3 for ; Fri, 10 Jun 2016 13:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GtAfBkQpiyCXy2LW/JnM/j9ahh39I32MwAppYF2IQcQ=; b=ms2D3fFhlDJF3Gbn5vjiSRMmPNJ/8H2+LZql5hBzIFV73C/IkBo6AFONthoqTl6lL/ M8kkUt5/g5UxbAnXM6E1mEDekAEeGY3xTyAN/aFFiydYremYTSJv32fJwxz/A+1/00Oh 81FOrcUqQKT+q1XsT0lihgiThevv4l0FsA/7t//wYxebViuuy7TiVJ/hZ0efxWVS7L2Y 8NEz/71kzcpQmLvDCHoaJpAKW5g5sSKqCWGzqSmqA4CLjfyZoXe6aieBbkIiQO2XgEdY ZMXj4fkKy+UnB7tgXRKCMPffZg0Y+0mke8uKODpcGMthujIR6G5e5eNUKg32X49S5274 PokA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GtAfBkQpiyCXy2LW/JnM/j9ahh39I32MwAppYF2IQcQ=; b=Ot/juQUTHkujj/GBoZF1AF9jmQySQPCeiMq5dTgU1DB0bZxpw/6dMmDWbMWoT1CcKM nOKmnzD6tAI+fPzYZ551pV/CHueP++63MLxKpoeB335HYHNlio9Jk69ibUyZELRAPCrh 3zpPOw72tsjuiVFYf9/MRCH1cnK/ril1lT5X1kCIYfyIJyySlrj7tuPBVNVsxHkvtMUh kw4B3sx1wwrpuFrO6bXeviPFsLgvuuZ+LG1eApAFxScprK3XcnlbNdcvD9k4QB+J15/4 AzQ9SD3SAeqOL75GTrC6Cy+b2QTru62I/H0CjubllChtS4g0r3v5x7UWVZvkHppeG2I/ ZPcA== X-Gm-Message-State: ALyK8tKO60jGF4/hq+ZRDSuQ0sZ2Ir4wq0B2ZGR3lrZsyk5ixjdrqxc4HCnKjSd5RaU29u4K739lADB3vAfo9g== X-Received: by 10.157.5.148 with SMTP id 20mr2471771otd.60.1465591173989; Fri, 10 Jun 2016 13:39:33 -0700 (PDT) Original-Received: by 10.202.104.150 with HTTP; Fri, 10 Jun 2016 13:39:33 -0700 (PDT) In-Reply-To: <7B7BC3F7-A25D-427D-8E21-D3583C3C7DEA@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::22e X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12612 Archived-At: Matt and List, As a matter of fact, I've been thinking about defecting to MIT/GNU Scheme if I don't get better support for scmutils and C++ FFI. :) Come on now Guilers, we can't have people defecting to Racket. Is there equivalent functionality in Guile to Racket's make-base-namespace, as Matt needs? It does seem like Guile's module system should handle this. Let's help Matt. Esprit de Guile! (Basa) On 6/10/16, Matthew Keeter wrote: > Thanks for the reply! > > You=E2=80=99ll be sad to hear that I=E2=80=99ve solved the problem by swi= tching to Racket =E2=80=93 > (make-base-namespace) creates the kind of temporary environment I needed, > and multiple calls produce multiple independent namespaces. > > -Matt > > On Jun 10, 2016, at 2:18 PM, Basa Centro wrote: > >> Hi Matthew, >> >> [I know this reply is a little delayed. Please let us know how you >> did it if you have already solved the problem.] >> >> Are you using eval-string? >> >> https://www.gnu.org/software/guile/manual/html_node/Fly-Evaluation.html#= Fly-Evaluation >> >> It might help for you to post a minimal code sample of what "almost >> works" and point out what doesn't. Also, there may be a simpler >> technique for what you are trying to accomplish--can you backtrack us >> to a higher level motivation? It seems like you need a read-only >> environment with a read/write one added on. >> >> (Basa) >> >> >> On 5/28/16, Matthew Keeter wrote: >>> I=E2=80=99m trying to generate a temporary, transient environment that = a useful >>> set >>> of functions in it. >>> >>> The use case is eval=E2=80=99ing a set of small code strings. Each env= ironment >>> needs to be >>> independent, so previous eval=E2=80=99s don=E2=80=99t leave anything in= the environment. >>> >>> I can make a dummy environment with (null-environment 5), but it=E2=80= =99s >>> missing >>> everything >>> useful. Calling (scheme-report-environment 5) gives me a useful >>> environment, but the >>> environment is shared (so effects from one eval can carry over, which i= s >>> undesirable). >>> >>> Any pointers? (resolve-module) seems like it could be useful, but the >>> #:version argument >>> doesn=E2=80=99t seem to work. >>> >>> Thanks, >>> Matt >>> > >