all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean-Christophe Helary <brandelune@gmail.com>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: evaluating numbers
Date: Thu, 14 Nov 2019 08:02:09 +0900	[thread overview]
Message-ID: <3396E071-2338-43A2-AB7D-62A5022F5FAD@traduction-libre.org> (raw)
In-Reply-To: <jwvpni0s5yl.fsf-monnier+emacs@gnu.org>

> On Nov 10, 2019, at 13:47, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> 
>>>>> Characters are just integers in Emacs.
>>>> I know that. You're not really answering the above question. When people
>>>> expect a character to be returned, they expect a character and not
>>>> a code point.
>>> Emacs can't know what the user expects.
>> Developers can know.
>>>> How useful is:
>>>> (decode-char 'emacs 345)
>>>> 345 (#o531, #x159)
>>> And the code that displays "345 (#o531, #x159)" doesn't know that this
>>> 345 is coming out of a function which is expected to return characters.
>> Considering the documentation of decode-char ("returns a character"), that's
>> either an implementation error or a documentation error...
> 
> So you're suggesting that the eval-expression function should look at
> the `car` of the expression that it evaluated, then fetch its docstring
> and see if it claims to return a character?

No. I'm suggesting that the developer who wrote that code and that documentation is creating expectations by using the word "character" and thus could have implemented the function so that it returns a "character", or a "glyph" (which are synonymous) and not only its code point. That's what I mean when I write "Developers can know" vs your "Emacs can't know".

> [ Side note: I'm the guy who wrote the code that displays those ?<char>
> thingies, and I'm a great fan of them (and I remove the
> eval-expression-print-maximum-character limit).  But I'll also note
> that if you want to see the char, you can simply wrap your expression
> inside a `string` call, as in M-: (string (decode-char 'emacs 345)) RET ]

As I replied to Eli on the 10th:

> For "discoverability" (or "cognitive gap reduction") purposes, I'd rather have something like
> 
> 1114111 (#o4177777, #x10ffff, t)
> 
> 232 (#o350, #xe8, t)
> 
> or something similar where t is the value of characterp for that integer when the integer is above the value of eval-expression-print-maximum-character.
> 
> That way I *know* when an integer is a character and when it is not. And I can find ways to look for it separately.
> 
> Would that break things ?


Would that break things ?


Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune





  reply	other threads:[~2019-11-13 23:02 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07  9:43 evaluating numbers Jean-Christophe Helary
2019-11-07  9:57 ` Stephen Berman
2019-11-07 10:20   ` Jean-Christophe Helary
2019-11-07 10:30     ` Stephen Berman
2019-11-07 10:40       ` Jean-Christophe Helary
2019-11-07 14:39         ` Eli Zaretskii
2019-11-08  0:36           ` Jean-Christophe Helary
2019-11-08 10:03             ` Eli Zaretskii
2019-11-08 12:23               ` Jean-Christophe Helary
2019-11-08 13:22                 ` Stefan Monnier
2019-11-09  0:20                   ` Jean-Christophe Helary
2019-11-09  7:24                     ` Eli Zaretskii
2019-11-08 13:49                 ` Eli Zaretskii
2019-11-09  0:15                   ` Jean-Christophe Helary
2019-11-09  7:22                     ` Eli Zaretskii
2019-11-09 11:18                       ` Jean-Christophe Helary
2019-11-09 11:48                         ` Eli Zaretskii
2019-11-10  0:59                           ` Jean-Christophe Helary
2019-11-10  8:06                             ` Andreas Schwab
2019-11-10 20:52                               ` Juri Linkov
2019-11-12 20:28                                 ` Juri Linkov
2019-11-12 22:05                                   ` Drew Adams
2019-11-12 22:21                                     ` Eli Zaretskii
2019-11-12 23:30                                       ` Drew Adams
2019-11-13  8:10                                         ` Eli Zaretskii
2019-11-13 14:47                                           ` Drew Adams
2019-11-14 12:45                                   ` Eli Zaretskii
2019-11-14 22:50                                     ` Juri Linkov
2019-11-14 23:40                                       ` Noam Postavsky
2019-11-15  8:14                                       ` Eli Zaretskii
2019-11-14  9:22                             ` Eli Zaretskii
2019-11-14  9:46                               ` Yuri Khan
2019-11-14 11:36                                 ` Jean-Christophe Helary
2019-11-14 13:55                                 ` Stefan Monnier
2019-11-14 13:59                                   ` Noam Postavsky
2019-11-14 14:17                                     ` Stefan Monnier
2019-11-14 21:44                                     ` Juanma Barranquero
2019-11-14 14:03                                   ` Andreas Schwab
2019-11-14 14:10                                 ` Eli Zaretskii
2019-11-14 17:10                                   ` Paul Eggert
2019-11-14 18:32                                     ` Eli Zaretskii
2019-11-14 18:39                                     ` Eli Zaretskii
2019-11-15  8:32                                       ` Štěpán Němec
2019-11-15 14:54                                       ` Robert Pluim
2019-11-15 15:16                                         ` Eli Zaretskii
2019-11-15 15:32                                           ` Eli Zaretskii
2019-11-15 15:55                                             ` Robert Pluim
2019-11-15 16:00                                               ` Robert Pluim
2019-11-15 16:11                                                 ` Lars Ingebrigtsen
2019-11-15 16:33                                                   ` Robert Pluim
2019-11-15 16:13                                               ` Eli Zaretskii
2019-11-17  2:15                                             ` Richard Stallman
2019-11-17 20:02                                               ` Robert Pluim
2019-11-18 16:25                                                 ` Eli Zaretskii
2019-11-18 16:54                                                   ` Robert Pluim
2019-11-18 17:05                                                     ` Eli Zaretskii
2019-11-20 13:00                                                       ` Robert Pluim
2019-11-20 16:40                                                         ` Eli Zaretskii
2019-11-20 17:09                                                           ` Robert Pluim
2019-11-20 17:45                                                             ` Eli Zaretskii
2019-11-19  6:08                                                 ` Richard Stallman
2019-11-19  9:50                                                   ` Robert Pluim
2019-11-15 15:53                                           ` Robert Pluim
2019-11-15 16:13                                             ` Eli Zaretskii
2019-11-15 16:43                                               ` Robert Pluim
2019-11-15 16:59                                                 ` Eli Zaretskii
2019-11-16 20:40                                       ` Juri Linkov
2019-11-17 17:34                                         ` Eli Zaretskii
2019-11-17 21:16                                           ` Juri Linkov
2019-11-14 22:56                                 ` Juri Linkov
2019-11-09 16:03                         ` Stefan Monnier
2019-11-10  0:22                           ` Jean-Christophe Helary
2019-11-10  4:47                             ` Stefan Monnier
2019-11-13 23:02                               ` Jean-Christophe Helary [this message]
2019-11-14 13:52                                 ` Stefan Monnier
2019-11-14  9:20                             ` Eli Zaretskii
2019-11-14 11:35                               ` Jean-Christophe Helary
2019-11-14 13:37                                 ` Noam Postavsky
2019-11-14 14:20                                 ` Eli Zaretskii
2019-11-15 10:36                                   ` Jean-Christophe Helary
2019-11-15 13:03                                     ` Eli Zaretskii
2020-04-28 14:52                                       ` Jean-Christophe Helary
2020-04-28 15:05                                         ` Eli Zaretskii
2020-04-28 17:28                                           ` Paul Eggert
2020-04-28 23:16                                           ` Jean-Christophe Helary
2020-04-29  0:08                                             ` Paul Eggert
2020-04-29  0:21                                               ` Jean-Christophe Helary
2020-04-29  7:08                                             ` Eli Zaretskii
2020-04-29  8:00                                               ` Jean-Christophe Helary
2020-04-29  3:23                                           ` Richard Stallman
2020-04-29  3:49                                             ` Jean-Christophe Helary
2020-04-29  3:51                                             ` Stefan Monnier
2020-04-29 10:09                                               ` Po Lu
2020-04-30  2:34                                               ` Richard Stallman
2020-04-30  3:04                                                 ` Stefan Monnier

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=3396E071-2338-43A2-AB7D-62A5022F5FAD@traduction-libre.org \
    --to=brandelune@gmail.com \
    --cc=emacs-devel@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.