From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Keeter Newsgroups: gmane.lisp.guile.user Subject: Re: Transient environment with standard functions Date: Fri, 10 Jun 2016 18:31:14 -0400 Message-ID: References: <30B0B35B-F6B0-4FD4-A35D-3E6542C3871F@gmail.com> <7B7BC3F7-A25D-427D-8E21-D3583C3C7DEA@gmail.com> <87twh0wxzn.fsf@T420.taylan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1465597926 11203 80.91.229.3 (10 Jun 2016 22:32:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2016 22:32:06 +0000 (UTC) Cc: guile-user@gnu.org To: Basa Centro Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jun 11 00:31:53 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 1bBUy0-0004Wz-Pd for guile-user@m.gmane.org; Sat, 11 Jun 2016 00:31:53 +0200 Original-Received: from localhost ([::1]:44754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBUxw-0001jg-BO for guile-user@m.gmane.org; Fri, 10 Jun 2016 18:31:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBUxX-0001jM-5R for guile-user@gnu.org; Fri, 10 Jun 2016 18:31:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBUxS-0000tN-1V for guile-user@gnu.org; Fri, 10 Jun 2016 18:31:22 -0400 Original-Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]:33675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBUxR-0000tH-Qi for guile-user@gnu.org; Fri, 10 Jun 2016 18:31:17 -0400 Original-Received: by mail-qt0-x232.google.com with SMTP id c34so21790966qte.0 for ; Fri, 10 Jun 2016 15:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=/iNmndjNcQuqPncsfRscqpVkYFf5q0UwGfg3ZWgN0EY=; b=k3F5MZJ2T3pIompRC3vxOPganswGgBoFhmRX+zXknrWB/zHVaXZGln9gh5lfcz0VeI z5BjVIfMoYmD/+kJxwkIoUaHvb45pFxv0czA6McxwHQYfnU8JQedxkIfyEqMHMHaeVER DfIRSUD8tcpR26XCfi9Y9Y123HikE6cPAbcxTjoANCLJrVRJR7CJU6k8Przm9kbjbKaC GbnNpApZIvoupJmhtQf7KCtCPkDXZTg6JOZ35tdOuPrFHbZ1zg9badTo3EsHsDRpiBoa Rko9vYeorG4kz6dhxl/evQKYF3uvQ4exQRm1M/HFuUwCVOKijQFoVE5y6d5lkWg28bpI m7qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=/iNmndjNcQuqPncsfRscqpVkYFf5q0UwGfg3ZWgN0EY=; b=Yk4Ap/zzT/Qmwne/eYNTB+yErGyMOoAa8RqB3S51qiktrFkHDf4tC377Nx/Gr/ibpQ RUsXLXyLKE2prIkv3F5hLLSh6/XQboLAzS3DC0j3QrlK+KFhY2n69oSlFjtyttl/OG6j IdjCJDdbSLkTeh33GNfJE5j8s8oS65Sz164ReUsWFnfCRHuNF3J1y2bERrHuZa9IVGp9 Y6VnQ3Hl9UwVaLoHqoYlz8OjH6Tu3N0UoG1XEH1zoVkyWLwmuiHPDI47YasSY4NqYJEr QUqFX8gLwobvmvg3nXXO21etWu7k6t9XsOMgk9/W9Pqp+CjQajC1CL1QDbNrMVcFTKFt EOng== X-Gm-Message-State: ALyK8tIIEoE6JAzP6HNR1B9JJDMf2+UxZS3A/YI3Y9C8vV3PSkxl66a+tPssm3/o43vUFQ== X-Received: by 10.200.50.237 with SMTP id a42mr4260257qtb.80.1465597877183; Fri, 10 Jun 2016 15:31:17 -0700 (PDT) Original-Received: from [192.168.1.2] (209-6-50-175.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com. [209.6.50.175]) by smtp.gmail.com with ESMTPSA id p39sm560083qtp.14.2016.06.10.15.31.15 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Jun 2016 15:31:15 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1878.6) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::232 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:12616 Archived-At: The specific use case is for dataflow graphs, where you=92re evaluating = a bunch of small snippets of code that can refer to each other by name. I=92d like to make an environment in which the variables in the same = subgraph are exposed as no-argument thunks. For example, let=92s say I have one subgraph that contains a =3D =9312=94 =3D> evaluates to 12 b =3D =93(+ 1 (a))=94 =3D> evaluates to 13, since the (a) thunk = evaluates to 12 and another subgraph which contains x =3D =931=94 =3D> evaluates to 1 y =3D =93(* (x) 2)=94 =3D> evaluates to 2 If I insert the thunks into (scheme-report-environment 5), they leak = from one graph to another =96 and to be fair, the docs to say that assigning into this = environment is undefined behavior. However, if I make an empty environment with (null-environment), it = doesn=92t have useful functions like + and *; looks like (make-module) has the same = issue. I'm sure that this is possible in Guile, but I got tired of reading = through the source files to hunt down undocumented function that do what I need [1]. -Matt [1] Another recent incident: How do you programmatically list all of the = variables in a module?=20 You search the web, find = http://www.draketo.de/proj/guile-basics/#sec-3-2, see a a reference to module-map, which doesn=92t exist in the documentation, dig it up in the = source to see its arguments, etc=85 On Jun 10, 2016, at 6:11 PM, Basa Centro wrote: >> First of all: is the "sandboxing" aspect of these environment = important? >=20 > Taylan, >=20 > Thanks, that's exactly what I meant by "motivation" in my first reply. > (There was a recent, 6 months ago or so, thread on sandboxing in > guile-user by the way.) >=20 > Was Matt trying to prevent _access_ (inaccessible vs. read-only vs. > read/write) to data? Or was he trying to prevent only _visibility_ > (e.g. for hygeine)? >=20 > I think we need to know more about "what" and "why" to answer his > question, rather than just "how"--if that makes any sense. Does > Racket [1] even _really_ achieve what he needs to do (_prevent_ access > for example)? We don't even know if we don't understand the > higher-level purpose. >=20 > (Basa) >=20 > [1] Disclaimer: I like Racket too--it is a great project. I just hate > to see someone leave Guile because of a minor technicality.