From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aibo.runbox.com (aibo.runbox.com [91.220.196.211]) by sourceware.org (Postfix) with ESMTPS id 060233836C15 for ; Mon, 30 Nov 2020 12:21:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 060233836C15 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bothner.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=per@bothner.com Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1kjiBM-00011W-Mc; Mon, 30 Nov 2020 13:21:28 +0100 Received: by submission03.runbox with esmtpsa [Authenticated alias (524175)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1kjiBH-0008IN-TN; Mon, 30 Nov 2020 13:21:24 +0100 Subject: Re: Using eval with environments and R7RS modules To: Damien.Mattei@unice.fr, kawa@sourceware.org References: <3c4fc600-110f-e1fe-4421-aeb91c8fab22@oca.eu> From: Per Bothner Message-ID: <60e9b887-73ef-76f8-87e1-a8158802beef@bothner.com> Date: Mon, 30 Nov 2020 04:21:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <3c4fc600-110f-e1fe-4421-aeb91c8fab22@oca.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2020 12:21:32 -0000 On 11/30/20 2:13 AM, Damien MATTEI wrote: > (define (foo L) > >    (eval L (interaction-environment)) > > and i got an error like UNBOUND VARIABLE L > > but this not only in Kawa,it is in Scheme, i was in a R5RS , The eval functon is really not compatible with lexical scoping, at least not unless you use a different evaluation strategy which make Scheme run much slower and use more memory. And that would be all the time, not just when eval is used (possibly unless you made eval a special syntax the compiler could recognize, rather than a procedure). Scheme from the very beginning has focused on lexical scoping and being able to compile it to efficient code: https://en.wikisource.org/wiki/Lambda_Papers > if there is a way to know the current bindings from EVAL i will be happy Dynamic bindings, yes, but lexical bindings, no. And that won't change. > to know it, because without this , i do not see any use for EVAL , I've many times said there is very little use for eval, and that too many people overuse it. If you think you have a good use for eval, you're probably wrong. > having only the toplevel bindings is not enought for development. If you mean that eval is not very useful for debugging, that is true. -- --Per Bothner per@bothner.com http://per.bothner.com/