From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: master b72f885: Make dlet work like let, not let* Date: Tue, 21 Sep 2021 07:19:23 +0300 Message-ID: References: <83wnp5m9i5.fsf@gnu.org> <87y27rhwp0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2726"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.7+183 (3d24855) (2021-05-28) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 21 06:22:05 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSXID-0000PY-6c for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 06:22:05 +0200 Original-Received: from localhost ([::1]:38162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSXIB-00024D-9s for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 00:22:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSXHF-0001O4-IG for emacs-devel@gnu.org; Tue, 21 Sep 2021 00:21:05 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:53193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSXH9-0007ix-8N; Tue, 21 Sep 2021 00:21:04 -0400 Original-Received: from localhost ([::ffff:41.210.154.92]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000005A04E.0000000061495DA7.00002DB4; Mon, 20 Sep 2021 21:20:55 -0700 Mail-Followup-To: Tassilo Horn , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <87y27rhwp0.fsf@gnu.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275193 Archived-At: * Tassilo Horn [2021-09-20 22:31]: > Jean Louis writes: > > > I am user and I do not expect it to work as `let' because `dlet' is > > supposed to make temporarily global variables. Now it doesn't work: > > > > (dlet ((wrs::variables (make-hash-table :test 'equal)) > > (wrs::_ (puthash "areas_name" "Hyperscope" wrs::variables))) > > ) > > > > error: let: Symbol’s value as variable is void: wrs::variables > > > > That is IMHO wrong, as it is supposed to bind variables > > dynamically: > > Being able to refer to variables earlier in the same binding form has > nothing do with dynamic binding. `let' and `dlet' don't support that, > `let*' does, and as Mattias said, there could be a `dlet*' if someone > needs it. > > What dlet allows you is to bind variables dynamically which are no > special variable (are not declared with defvar). For example: > > --8<---------------cut here---------------start------------->8--- > (defun foo () > some-var) > > (foo) ;; Lisp error: (void-variable some-var) > > (dlet ((some-var 17)) > (foo)) ;=> 17 > --8<---------------cut here---------------end--------------->8--- > > But instead of dlet you could just as well defvar some-var and use a > normal `let' instead. > > Why can't you defvar wrs::variables? Or maybe it already is? In that > case, you could just replace `dlet' with `let*'. Thanks Tassilo for the tip, though I have tried to use `defvar' and `let*' and that does not work in my case. I cannot technically explain it why. Practically, lexical binding script is calling in my case dynamical binding function. By using `defvar' and subsequently `let*' I can avoid the first error. I cannot however get the variables to pass over to the function in dynamical binding script `rcd-template-eval' that is supposed to work with variables. This worked with `dlet' before, not it does not work. Developer changed `dlet' to fit whatever programming habits, but deleted the functionality of `dlet*' I really need it. rcd-template-eval: `eval' error: (void-variable languages_extension) for match: 'languages_extension'rcd-template-eval: `eval' error: (void-variable areas_id) for match: 'areas_id'rcd-template-eval: `eval' error: (void-variable pages_categories) for match: 'pages_categories'rcd-template-eval: `eval' error: (void-variable pages_id) for match: 'pages_id'rcd-template-eval: `eval' error: (void-variable pages_copypage) for match: 'pages_copypage'rcd-template-eval: `eval' error: (void-variable areas_company) for match: 'areas_company'rcd-template-eval: `eval' error: (void-variable areas_url) for match: 'areas_url'rcd-template-eval: `eval' error: (void-variable wrs::keywords) for match: '(xml-escape wrs::keywords)'rcd-template-eval: `eval' error: (void-variable wrs::description) for match: '(xml-escape wrs::description)'rcd-template-eval: `eval' error: (void-variable wrs::description) for match: '(xml-escape wrs::description)'rcd-template-eval: `eval' error: (void-variable open-graph-type) for match: 'open-graph-type'rcd-template-eval: `eval' error: (void-variable areas_url) for match: 'areas_url'rcd-template-eval: `eval' error: (void-variable wrs::description) for match: '(xml-escape wrs::description)'rcd-template-eval: `eval' error: (void-variable headerstuff) for match: 'headerstuff'rcd-template-eval: `eval' error: (void-variable after_content) for match: 'after_content'rcd-template-eval: `eval' error: (void-variable inquiry) for match: 'inquiry'rcd-template-eval: `eval' error: (void-variable footerstuff) for match: 'footerstuff'Invalid face reference: mail-double-quoted-text-face Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/