all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Passing optional arguments for use with internal functions
Date: Thu, 03 Aug 2023 01:24:45 +0200	[thread overview]
Message-ID: <87h6phkoxu.fsf@dataswamp.org> (raw)
In-Reply-To: -3N3ToZTUg2mUqmpgTYmAX8LUtMKCkCb5CLWN1q1gJxpBpcd_18KWXjL7lh51B6NXfrXEBNmRo7SwK5AClT6M1-NjD2DP1oInylqklgCF9Y=@proton.me

uzibalqa wrote:

> What had confused me initially was that descriptions
> customarily specified the difference in results between
> lexical and dynamic binding.

It is easier to understand it on a case-by-case basis, it is
`let' and `let*' and some other stuff as well - right now,
I don't remember ... ? but it wasn't a huge thing - that can
go either way based on `lexical-binding', the rest don't,
including this case (function argument variables) which is
always lexical/static.

> What I did not immediately realise was that within the
> context of function arguments, lexical binding is the
> default way to handle function arguments in Lisp and Emacs
> Lisp, notwithstanding the file binding specification.
>
> Although one has to say that it is also possible to
> implement dynamic binding for function arguments in other
> languages. Is it possible to impose dynamic binding for
> function arguments in Emacs Lisp though?

You can write your own function-defining function, maybe.

But no, you can't do that in an easy way that I'm aware
of anyway.

And why would you want that? I don't see it makes a lot of
sense. For example, the familiar f(x) = y ... what does that
mean, if x and y are defined outside of that? But should still
influence it? DNC

> Looks as if dynamic binding in Emacs Lips was affecting
> global variables.

It affects how `let' and `let*' behaves, there is a dynamic
let and and a lexical let, and which you get is determined by
the variable you mentioned.

Note that the lexical let, in the presence of
a global/special/dynamic variable with the same name, does not
override it and make a new one that is lexical, no, it will
still be same global and dynamic variable, it just sets
(changes) its value for everything that uses it, within
the let.

So only variables that don't exist get to be either dynamic
or lexical, depending on that setting - and again, we are
just talking `let' and `let*' here, it isn't anything more
than that, sorry :)

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2023-08-02 23:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 23:45 Passing optional arguments for use with internal functions uzibalqa
2023-07-28 10:51 ` Emanuel Berg
2023-07-28 16:42   ` Heime
2023-07-28 17:11     ` Emanuel Berg
2023-07-30 16:09       ` uzibalqa
2023-07-31 12:27         ` Emanuel Berg
2023-08-02 18:01           ` uzibalqa
2023-08-02 18:20             ` Emanuel Berg
2023-08-02 19:24               ` uzibalqa
2023-08-02 19:53                 ` uzibalqa
2023-08-02 23:24                   ` Emanuel Berg [this message]
2023-08-03 15:25                   ` Emanuel Berg
2023-08-03 15:35                   ` Emanuel Berg
2023-08-03 15:46                   ` Emanuel Berg
2023-07-28 20:02   ` [External] : " Drew Adams
2023-07-28 20:42     ` uzibalqa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6phkoxu.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.