From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.devel Subject: Re: evaluating numbers Date: Thu, 14 Nov 2019 08:02:09 +0900 Message-ID: <3396E071-2338-43A2-AB7D-62A5022F5FAD@traduction-libre.org> References: <875zjw2emg.fsf@gmx.net> <618B38D9-CD34-4200-8CA1-1A6B0922A83A@traduction-libre.org> <871ruk2d3f.fsf@gmx.net> <3C929D7B-1C10-4713-9EDA-55C80FC36AD8@traduction-libre.org> <835zjvg385.fsf@gnu.org> <83sgmyd6rw.fsf@gnu.org> <835zjucwbz.fsf@gnu.org> <628A3663-BDD3-47C5-B4F4-E260FD900691@traduction-libre.org> <83o8xla50f.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="73562"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 14 00:12:11 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iV1o1-000Iyw-6l for ged-emacs-devel@m.gmane.org; Thu, 14 Nov 2019 00:12:09 +0100 Original-Received: from localhost ([::1]:52222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iV1nz-0002VI-EC for ged-emacs-devel@m.gmane.org; Wed, 13 Nov 2019 18:12:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41392) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iV1eT-0001Zl-HK for emacs-devel@gnu.org; Wed, 13 Nov 2019 18:02:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iV1eS-0000ij-AG for emacs-devel@gnu.org; Wed, 13 Nov 2019 18:02:17 -0500 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:37585) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iV1eS-0000hH-3x for emacs-devel@gnu.org; Wed, 13 Nov 2019 18:02:16 -0500 Original-Received: by mail-pg1-x529.google.com with SMTP id z24so2337697pgu.4 for ; Wed, 13 Nov 2019 15:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=Dfvifefa2bx0y6NPijpVoO38nVuCcDnuqkgg9pt72Ws=; b=K72GAAh+yInDIVfWV6DtmchSDGpKD9nUVWhAIMAtr6oFJgpiDO46hlEhFltyGKn2LC LGoomPzP1lvYuw7+nsdHVLoOxfmzDx5EVB2X6wfiD++hJkP8b17T99tZcGtdOBYRN52s PtVHB/5MNjym2PSYJA/SS+2jJulnglI27h1uXS36+IAHc/lDTWGxGV84QjnyP1rDLNlk OyyRvHIwmJLhKNyd78vPcz1Y+VNXTwgimgpNYNIIdjxLiUtn8a8uWdqTgpeGpmpca2ft 1HXjiN0EGlkJLAsW4mc6Sl1pEmJ4F+CRHGhyWYP5GMWMJohNHTLnBzbR2Q0RHCrTiX1i c/mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=Dfvifefa2bx0y6NPijpVoO38nVuCcDnuqkgg9pt72Ws=; b=NqnCi1pjLTX6eubn6C2QhzCKNjwt9Sw7+pEgPjkYrYyOtbgMZrK0RP+Sr3mlXvpy52 qpGk4d4DQYqpBpZjq8ggeJSFOI2MvsmU5VC0QynkUKe70dUhRnSvW7E3xWttCjvW7NQS Ra1BGTzafZMVnskXdOA0Jry6estsUAvR7nsLcSNJPrXWQFb31dpEkkoh5ro4YD5BLmKN G6LFdB6YiFLjXcsecdrZPgkW+X50ueKbVPNCgyJ2NQdS6jgEEMW0kCGx88wN4tMkZkgC BG1iOkRgVQsegI6HCdjB45Ajs/BJKKSqVUE8ltEFYhfAY0V7Wc7i8F1IV6xbgqxlyxhJ TiWQ== X-Gm-Message-State: APjAAAWDRfKbT4xxtr5jao4YtB3bUm1iyOwGIliH4azzhfs8HadtPBTC dUq2lGsFI1QhdjsZt9BzsbaikWs7 X-Google-Smtp-Source: APXvYqxONJa7jaBSB56Qt1t0UoN5PYhzaa0Iexh31OfhXqoVnXZmDBZ46if+wdxdCg7tHmwkr6L0XQ== X-Received: by 2002:a17:90a:bd0c:: with SMTP id y12mr8372169pjr.108.1573686133757; Wed, 13 Nov 2019 15:02:13 -0800 (PST) Original-Received: from [10.251.103.133] ([210.160.37.44]) by smtp.gmail.com with ESMTPSA id m14sm3999748pgn.41.2019.11.13.15.02.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Nov 2019 15:02:12 -0800 (PST) X-Google-Original-From: Jean-Christophe Helary In-Reply-To: X-Mailer: Apple Mail (2.3601.0.10) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::529 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242131 Archived-At: > On Nov 10, 2019, at 13:47, Stefan Monnier = wrote: >=20 >>>>> 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... >=20 > 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 = ? > 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 >=20 > 1114111 (#o4177777, #x10ffff, t) >=20 > 232 (#o350, #xe8, t) >=20 > 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. >=20 > 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. >=20 > Would that break things ? Would that break things ? Jean-Christophe Helary ----------------------------------------------- http://mac4translators.blogspot.com @brandelune