all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Always-true predicate?
@ 2021-02-17 12:01 Lars Ingebrigtsen
  2021-02-17 12:31 ` Andrea Corallo via Emacs development discussions.
                   ` (2 more replies)
  0 siblings, 3 replies; 51+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-17 12:01 UTC (permalink / raw)
  To: emacs-devel

Currently, Emacs has:

----
   Sometimes, when you call a functional, it is useful to supply a no-op
function as the argument.  Here are two different kinds of no-op
function:

 -- Function: identity argument
     This function returns ARGUMENT and has no side effects.

 -- Function: ignore &rest arguments
     This function ignores any ARGUMENTS and returns ‘nil’.
----

`identity' is kinda-sorta used as the opposite of `ignore' many places
where you're feeding predicates to functions, but takes only one
parameter and, of course, returns nil if you give it nil.

Would it make sense to add a function that's exactly the opposite of
`ignore' (for symmetry and convenience)?  If so, what would it be
called?

I've googled to see what other languages do.  Rust and NPM has "always",
and many more Java-inspired frameworks have "truePredicate", but this
isn't trivial to google for...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

end of thread, other threads:[~2021-02-22 23:07 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-17 12:01 Always-true predicate? Lars Ingebrigtsen
2021-02-17 12:31 ` Andrea Corallo via Emacs development discussions.
2021-02-17 12:40   ` Lars Ingebrigtsen
2021-02-17 16:59     ` Barry Fishman
2021-02-19 15:24   ` Stefan Kangas
2021-02-17 13:16 ` Basil L. Contovounesios
2021-02-17 18:56   ` Pip Cet
2021-02-17 19:19     ` Lars Ingebrigtsen
2021-02-17 19:31       ` Pip Cet
2021-02-17 19:37         ` Lars Ingebrigtsen
2021-02-17 20:18           ` Teemu Likonen
2021-02-17 22:25             ` [External] : " Drew Adams
2021-02-17 23:04               ` Basil L. Contovounesios
2021-02-17 23:13                 ` Drew Adams
2021-02-17 23:01             ` Stefan Monnier
2021-02-19 11:27               ` Pip Cet
2021-02-19 15:07                 ` Stefan Monnier
2021-02-19 19:04                   ` Pip Cet
2021-02-19 20:11                     ` Stefan Monnier
2021-02-20  9:40                       ` Pip Cet
2021-02-20 13:58                         ` Stefan Monnier
2021-02-19  5:39 ` Richard Stallman
2021-02-19  8:52   ` Robert Pluim
2021-02-19  9:10     ` Eli Zaretskii
2021-02-19 12:12       ` Eli Zaretskii
2021-02-19 12:52       ` Stefan Kangas
2021-02-19 13:00         ` Lars Ingebrigtsen
2021-02-19 13:34         ` Eli Zaretskii
2021-02-19 13:40           ` Lars Ingebrigtsen
2021-02-19 13:53             ` Eli Zaretskii
2021-02-19 14:05               ` Lars Ingebrigtsen
2021-02-19 18:04                 ` [External] : " Drew Adams
2021-02-19 14:42             ` Stefan Monnier
2021-02-20 12:47               ` Lars Ingebrigtsen
2021-02-20 12:49                 ` Lars Ingebrigtsen
2021-02-20 14:03                   ` Stefan Monnier
2021-02-20 14:20                     ` Lars Ingebrigtsen
2021-02-20 14:55                       ` Stefan Monnier
2021-02-20 15:05                         ` Lars Ingebrigtsen
2021-02-20 15:21                           ` Stefan Monnier
2021-02-21 12:50                             ` Robert Pluim
2021-02-21 13:04                             ` Lars Ingebrigtsen
2021-02-19 15:09           ` Stefan Kangas
2021-02-19 15:22             ` Eli Zaretskii
2021-02-19 18:17               ` [External] : " Drew Adams
2021-02-19 18:41                 ` Eli Zaretskii
2021-02-22  5:02       ` chad
2021-02-22 15:20         ` Eli Zaretskii
2021-02-22 23:07           ` chad
2021-02-21  6:12     ` Richard Stallman
2021-02-21 15:12       ` Eli Zaretskii

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.