all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: no empty (zero) string predicate in Elisp
Date: Mon, 27 Apr 2015 03:00:25 +0200	[thread overview]
Message-ID: <87pp6qz8pi.fsf@debian.uxu> (raw)
In-Reply-To: mailman.1662.1430079142.904.help-gnu-emacs@gnu.org

Marcin Borkowski <mbork@mbork.pl> writes:

>>>> "Predicate" is a word from the grammars of human
>>>> languages, but I don't know its exact meaning,
>>>> neither there or in programming languages (until
>>>> now as for programming).
>>> AFAIK, "predicate" is a word from /logic/, and it
>>> means (more or less) a function which consumes one
>>> or more arguments of any type and gives back
>>> a truth-value.
>> Doesn't all functions in logic do that?
>
> First of all: IANAL (here L = logician;-)). But...
>
> For starters, in propositional calculus (AFAIK, also
> in first-order logic) there are no "functions" per
> se, since there are no /sets/. Furthermore, in the
> logic systems usually used by us mathematicians
> there are no /types/. AFAIK, the analogue of "type
> mismatch" in these systems is just a plain old
> "syntax error".
>
> What you probably refer to is the fact that in these
> simple logic systems both predicates and logical
> connectives "generate" truth-values. However, there
> are other possibilities; analogues of "functions" in
> these systems are called "terms".

I just looked it up in one of my favorite books,
namely

    @book{oxford-dictionary-of-computing,
      title      = {Oxford Dictionary of Computing},
      author     = {John Daintith and Edmund Wright (editors)},
      publisher  = {Oxford University Press},
      year       = 2010,
      ISBN       = 0199234000
    }

and your are absolutely right! A predicate is
a boolean function of n-arity: if n = 0
(i.e., no arguments) the function is called
a "statement" as the function value cannot change.

I also looked up "unary" but it wasn't included in the
"unary operator" sense, i.e. a function that accepts
a single input argument, e.g. f(x) or the suggested
zero-string predicate.

However, "unary operation" was included: a function

    f: D -> R

where the input domain equals the output range:

    f: S -> S

- which is *not* what we have here as here the input
set is all strings, while the output ditto is the mere

    { t, nil }

So all is clear, but it is error-prone and can be
confusion as well. So next time I'll just say "a
function with a single argument". Maybe.

By the way, "UNIX" (the name) is (?) a pun/joke on
this. It's predecessor was Multics, which was planned
to be a multiuser system, hence the name. But that
never materialized. UNIX, on the other hand, would
conquer the world a multiprogram, multiuser, and
time-sharing system...

-- 
underground experts united
http://user.it.uu.se/~embe8573


  parent reply	other threads:[~2015-04-27  1:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25  3:44 no empty (zero) string predicate in Elisp Emanuel Berg
2015-04-25  9:26 ` Nicolas Petton
2015-05-16  9:23   ` Nicolas Petton
2015-05-16 13:22     ` Bozhidar Batsov
2015-05-16 13:28       ` Bozhidar Batsov
2015-05-16 13:36         ` Bozhidar Batsov
2015-05-16 13:46           ` Eli Zaretskii
2015-05-16 16:17             ` Bozhidar Batsov
2015-05-16 13:43     ` Stefan Monnier
2015-05-16 15:27     ` Drew Adams
     [not found] ` <mailman.1583.1429954907.904.help-gnu-emacs@gnu.org>
2015-04-25 11:22   ` Emanuel Berg
2015-04-25 13:30 ` Stefan Monnier
     [not found] ` <mailman.1591.1429968677.904.help-gnu-emacs@gnu.org>
2015-04-25 14:48   ` Pascal J. Bourguignon
2015-04-26  2:52     ` Stefan Monnier
2015-04-27 10:28       ` zerop: compiler macro vs defsubst (was: no empty (zero) string predicate in Elisp) Nicolas Richard
2015-04-27 12:19         ` zerop: compiler macro vs defsubst Stefan Monnier
     [not found]     ` <mailman.1626.1430016741.904.help-gnu-emacs@gnu.org>
2015-04-26  4:06       ` no empty (zero) string predicate in Elisp Pascal J. Bourguignon
2015-04-26 21:25         ` Stefan Monnier
2015-04-26  4:26       ` Rusi
2015-04-26 12:36   ` Emanuel Berg
2015-04-26 15:03     ` Pascal J. Bourguignon
2015-04-26 18:34       ` Emanuel Berg
2015-04-26 18:59         ` Marcin Borkowski
     [not found]         ` <mailman.1658.1430074770.904.help-gnu-emacs@gnu.org>
2015-04-26 19:06           ` Emanuel Berg
2015-04-26 20:11             ` Marcin Borkowski
     [not found]             ` <mailman.1662.1430079142.904.help-gnu-emacs@gnu.org>
2015-04-27  1:00               ` Emanuel Berg [this message]
2015-04-26 17:28     ` Rusi
2015-04-26 18:39       ` Emanuel Berg

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=87pp6qz8pi.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --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.