unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: The function naming convention used by Emacs.
@ 2021-09-26 13:32 Pierpaolo Bernardi
  2021-09-26 13:35 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-09-26 17:26 ` [External] : " Drew Adams
  0 siblings, 2 replies; 4+ messages in thread
From: Pierpaolo Bernardi @ 2021-09-26 13:32 UTC (permalink / raw)
  To: Emanuel Berg, help-gnu-emacs@gnu org


Il giorno 26 settembre 2021, alle ore 13:49, Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> ha scritto:

>there is also the "f" suffix for "function", e.g. `cl-incf'
>and `cl-decf' ... 

The "f" in these cases stands for "field".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: The function naming convention used by Emacs.
  2021-09-26 13:32 The function naming convention used by Emacs Pierpaolo Bernardi
@ 2021-09-26 13:35 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-09-26 17:26 ` [External] : " Drew Adams
  1 sibling, 0 replies; 4+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-09-26 13:35 UTC (permalink / raw)
  To: help-gnu-emacs

Pierpaolo Bernardi wrote:

>> there is also the "f" suffix for "function", e.g. `cl-incf'
>> and `cl-decf' ...
>
> The "f" in these cases stands for "field".

That so, OK, thanks.

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [External] : Re: The function naming convention used by Emacs.
  2021-09-26 13:32 The function naming convention used by Emacs Pierpaolo Bernardi
  2021-09-26 13:35 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-09-26 17:26 ` Drew Adams
  2021-09-27  1:54   ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 4+ messages in thread
From: Drew Adams @ 2021-09-26 17:26 UTC (permalink / raw)
  To: Pierpaolo Bernardi, Emanuel Berg, help-gnu-emacs@gnu org

> >there is also the "f" suffix for "function", e.g. `cl-incf'
> >and `cl-decf' ...
> 
> The "f" in these cases stands for "field".

A suffix of `f' can stand for different things.
I think generally it stands loosely for "function".
The general idea is that some sort of function is
used to determine a generalized "place" that gets
updated in some way.

The most obvious and general case is `setf' whose
doc says that the first arg is a "function call
form" or it otherwise generally refers to a function.

And functions that are related to, or based on,
`setf' tend to use the `f' suffix.

Common Lisp uses lots of such "functions" (including
macros etc.) that are named with suffix `f'.

https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node80.html

There are also obvious exceptions where the `f'
isn't really a suffix.  E.g. `...aref', `...if',
`...of', `ldiff', `result-of', `svref'.

And less obvious exceptions, which are related
to `setf': `getf', `remf', `incf', `decf',
`rotatef', `shiftf'.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [External] : Re: The function naming convention used by Emacs.
  2021-09-26 17:26 ` [External] : " Drew Adams
@ 2021-09-27  1:54   ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 4+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-09-27  1:54 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams wrote:

> Common Lisp uses lots of such "functions" (including macros
> etc.) that are named with suffix `f'.

Let's pretend I got it from there ...

Because in Elisp there seems to be the spelled-out "-function"
convention that seems to be the one to use ...

Often it is variables that indicate one is to set it to
a function, e.g.

(setq browse-url-browser-function #'w3m-browse-url)

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-27  1:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-26 13:32 The function naming convention used by Emacs Pierpaolo Bernardi
2021-09-26 13:35 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-26 17:26 ` [External] : " Drew Adams
2021-09-27  1:54   ` Emanuel Berg via Users list for the GNU Emacs text editor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).