From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Newsgroups: gmane.lisp.guile.user Subject: Re: Transient environment with standard functions Date: Sat, 11 Jun 2016 00:11:08 +0300 Message-ID: <87twh0wxzn.fsf@T420.taylan> 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 X-Trace: ger.gmane.org 1465593000 3039 80.91.229.3 (10 Jun 2016 21:10:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2016 21:10:00 +0000 (UTC) Cc: guile-user@gnu.org, matt.j.keeter@gmail.com To: Basa Centro Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 10 23:09:55 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 1bBTgg-0003Vf-S9 for guile-user@m.gmane.org; Fri, 10 Jun 2016 23:09:55 +0200 Original-Received: from localhost ([::1]:44445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBTgf-0003lv-Oy for guile-user@m.gmane.org; Fri, 10 Jun 2016 17:09:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBTgB-0003lE-50 for guile-user@gnu.org; Fri, 10 Jun 2016 17:09:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBTg6-0005kV-UC for guile-user@gnu.org; Fri, 10 Jun 2016 17:09:22 -0400 Original-Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:35121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBTg6-0005kP-GG for guile-user@gnu.org; Fri, 10 Jun 2016 17:09:18 -0400 Original-Received: by mail-wm0-x235.google.com with SMTP id v199so7287175wmv.0 for ; Fri, 10 Jun 2016 14:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=BPXJQLhGyJRxuEwEaTtRjKEqk8556uZmBg25Uzae7Hc=; b=U7hoPVqMIjifvaG2IRyaqrCDGvReoMFiKXdOncmhahcsDJ48tL1p/d4SoSepAtzvSL YO60nijJ2fA/jTgXE/47Njq8i4vRld/tttBK/88OTq47GMbkU5kaFjHM2ubT4KgU2nP6 ya8YGDOWf98JfHMSM6AL1VIvsyCy8HoN5dHSO7QNgzeEdXDq+i0cFVu8WmvmcDv/RtXp WlYLJrtzotwhtx0Z2aLReANuDjiGYPhpgNCNcyQGofKGXo5HQSB94Zl9OwfPtN5mvQA9 lYP5wvPsRZgSrJujohlHkgH3+2y0Af3m/vIynj7VHReLasmy7nVK2wwjC6d1tOM602ix 4CHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=BPXJQLhGyJRxuEwEaTtRjKEqk8556uZmBg25Uzae7Hc=; b=BJhT1HQmDB15JW+5EjYAtHA7fJvJSV231YeCydecXvgXPk9S4pMNGh1KjUSElD3hmG yHLm0UnhyzcQvQ7YmWcXIqSF8nwsf0/gN3UZJ76HQeZy71NrCl24WJ3ZrdhRC0GZR13z +KxdOhBAmO52PVgV6KyA7PHYR4meATPm4tF5eWYPrlxcRUp61BlZCwrZ/F2LmvgYW+lj mwD8SYeZLcazDA4OBiEDqpSPCVChqCMPykRnmCbn0IfnjPR7MBCC7do2rLblVyfYpS49 FL+7T+lAmKMyWpZ/iX8dKQcU/q5UkV7aee6CvnayWId9Rn5t/LYF1nTEQyxOeM6yVYIv R5aQ== X-Gm-Message-State: ALyK8tJLFX+cxSHKD12HIPDfvvM6g+uER1mXLpkA/cE73v1BmX7WNvlxRyckXpdkdzdHPA== X-Received: by 10.28.197.132 with SMTP id v126mr775174wmf.8.1465592957640; Fri, 10 Jun 2016 14:09:17 -0700 (PDT) Original-Received: from T420.taylan ([78.179.55.193]) by smtp.gmail.com with ESMTPSA id f196sm895927wmg.15.2016.06.10.14.09.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jun 2016 14:09:16 -0700 (PDT) In-Reply-To: (Basa Centro's message of "Fri, 10 Jun 2016 20:39:33 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::235 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:12613 Archived-At: Basa Centro writes: > 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) First of all: is the "sandboxing" aspect of these environment important? Because Guile uses psyntax so far, which allows "injecting" absolute references to any binding in any module in the runtime. For instance, enter the following into a Guile REPL: #(syntax-object proper-list? ((top)) (hygiene srfi srfi-1)) It will return the 'proper-list?' procedure defined in (srfi srfi-1) even though we didn't import that module! If that's acceptable, then you can create new environment objects with 'make-module' and add bindings to it with some of the interfaces explained in: (info "(guile) Module System Reflection") Equivalent web link: https://www.gnu.org/software/guile/manual/html_node/Module-System-Reflection.html For instance, the unmerged r7rs-wip branch defines the 'environment' procedure of R7RS like this: (define (environment . import-sets) (let ((m (make-module))) (module-use-interfaces! m (map resolve-r6rs-interface import-sets)) m)) (Switch to the r7rs-wip branch and see file 'module/scheme/eval.scm'.) Hope that helps :-) Taylan