From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Lexical environment for functions? Date: Sun, 28 Dec 2014 07:40:59 +0100 Message-ID: <87d2742s5g.fsf@fencepost.gnu.org> References: <874msh3tm1.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419759613 8028 80.91.229.3 (28 Dec 2014 09:40:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Dec 2014 09:40:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 28 10:40:06 2014 Return-path: Envelope-to: ged-emacs-devel@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 1Y5AKS-0001nj-Be for ged-emacs-devel@m.gmane.org; Sun, 28 Dec 2014 10:40:04 +0100 Original-Received: from localhost ([::1]:57957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5AKR-0001wb-GR for ged-emacs-devel@m.gmane.org; Sun, 28 Dec 2014 04:40:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5AKF-0001wK-AX for emacs-devel@gnu.org; Sun, 28 Dec 2014 04:39:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5AKE-0008W0-77 for emacs-devel@gnu.org; Sun, 28 Dec 2014 04:39:51 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5AKE-0008Vu-4g for emacs-devel@gnu.org; Sun, 28 Dec 2014 04:39:50 -0500 Original-Received: from localhost ([127.0.0.1]:50418 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5AKD-00082x-As; Sun, 28 Dec 2014 04:39:49 -0500 Original-Received: by lola (Postfix, from userid 1000) id 57DD4DF8BC; Sun, 28 Dec 2014 07:40:59 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Sat, 27 Dec 2014 19:10:09 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:180740 Archived-At: Stefan Monnier writes: >> Does that mean that lexical environments exist only for value cells? > > Yes, at least for the "native" lexical binding. > >> Because it would seem convenient, if one has some >> Lisp-like presentation of a parse tree like XML, to just eval it with a >> number of function bindings in place. > > Just like you could simulate the new (eval E ENV) form via > (eval `(lexical-let ,ENV ,E)), you can do the above with > (eval `(cl-flet FENV E)). cl-flet is optimized for compilation rather that interpretation. So this is not likely to make eval a good idea for fast interpretation of parsed expressions. -- David Kastrup