all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Lexical vs. dynamic: small examples?
Date: Mon, 10 Jan 2022 14:10:18 +0100	[thread overview]
Message-ID: <87y23nspmt.fsf@zoho.eu> (raw)
In-Reply-To: SJ0PR10MB54882B8C44A1C867C6EA1E90F34F9@SJ0PR10MB5488.namprd10.prod.outlook.com

Drew Adams wrote:

>> But here it also has a functional value. Or to be even more
>> precise, the functional value is also what is appealing,
>> since I think it started in that end.
>
> tl;dr:
> 1. It can be useful.  2. It's not foolproof.
> ___
>
> I guess you're referring to this (from the
> `dyna-show.el' Commentary)?
>
>  [I]f a function has the same name as a dynamic
>  variable, then its occurrences are also
>  highlighted, as if they were occurrences of
>  the variable.
>
> For example `font-lock-mode' is a variable as
> well as a function.  Both kinds of occurrences
> of that symbol are highlighted the same.
>
> Whether this is considered a feature or a
> limitation, the reason is that it requires no
> analysis of the code (which would anyway be
> problematic and limited) to determine how each
> occurrence is used.  
>
> The Commentary calls it out as a limitation.
> And the sentence above comes right after this
> additional caveat:
>
>   The simple built-in test `special-variable-p' is used.
>   That test is not 100% reliable. It doesn't respect vacuous
>   `defvar' sexps, which declare a variable to be special in
>   a given context, without assigning a value to the
>   variable. Instead, it uses `defvar',`defconst', and
>   `defcustom' sexps with a value arg present.

Well, yes, that's a good example, but actually the functional
gain starts with the programmer thinking "hey, what should it
be called?" - "obey tradition" (follow the convention) and
even at that point the harsh reality of a programmer gets
a little "bit" easier ;)

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




  reply	other threads:[~2022-01-10 13:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09 17:40 Lexical vs. dynamic: small examples? Drew Adams
2022-01-10 13:10 ` Emanuel Berg via Users list for the GNU Emacs text editor [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-08-14  3:34 Eduardo Ochs
2021-08-14  3:56 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14  4:12   ` Eduardo Ochs
2021-08-14  7:35 ` tomas
2021-08-14 16:00   ` Eduardo Ochs
2021-08-14 19:41     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14 20:42     ` tomas
2021-08-14 19:31   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14 20:31     ` tomas
2021-08-14 21:26       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14 21:29         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14 19:00 ` Gregory Heytings
2021-08-14 20:16   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14 20:23     ` Gregory Heytings
2021-08-14 21:05       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14 21:13         ` tomas
2021-08-14 21:28           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14 20:41   ` tomas

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=87y23nspmt.fsf@zoho.eu \
    --to=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /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.