unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Rusi <rustompmody@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: [OFFTOPIC] Re: Invoking a function from a list of functions
Date: Wed, 28 Nov 2018 21:37:15 -0800 (PST)	[thread overview]
Message-ID: <22fbcbc1-66ea-44a7-8948-871d3c3ad3eb@googlegroups.com> (raw)
In-Reply-To: <mailman.4820.1543432126.1284.help-gnu-emacs@gnu.org>

On Thursday, November 29, 2018 at 12:38:49 AM UTC+5:30, Yuri Khan wrote:

> (I was recently informed that web browsers allow the use of
> compatibility characters in domain names, and compatibility-decompose
> them before resolving, so U+338F “kilogram” becomes Kyrgyzstan and
> milliliter maps to Mali.

I am being troublesome but (hopefully!) not malicious
Add some good ol badness as hot peppers to the cake
https://en.wikipedia.org/wiki/IDN_homograph_attack

> That *is* madness.)

Precisely my point

On Thursday, November 29, 2018 at 12:27:46 AM UTC+5:30, Eli Zaretskii wrote:
> > From: Yuri Khan 
> > 
> > > That's debatable: the Unicode Standard says to act according to
> > > canonical equivalence only in text, whereas the above are symbol
> > > names.  We do display them the same (if the font supports that), but
> > > we aren't under any obligation to map them to the same symbols, IMO.
> > 
> > Standard Annex 31 deals with identifiers in programming languages, and
> > recommends considering identifiers equivalent if they are the same
> > under Normalization Form C for case-sensitive languages (such as
> > Python and Elisp).
> 
>   "Implementations that take normalization and case into account have
>   two choices: to treat variants as equivalent, or to disallow
>   variants."
> 
> So there's a choice.

And if you ask me, disallow is the reasonable default
Earlier I compared python3 and elisp — a nuanced comparison
A more basic comparison would be between python 2 and 3 


$ cat simple.py 
A = 1
A = 2
print("A, A, A==A : %s, %s, %s\n" % (A,A,A==A))


$ cat homoglyph.py 
A = 1
А = 2
print("A, А, A==А : %s, %s, %s\n" % (A,А,A==А))

$ python2 simple.py 
A, A, A==A : 2, 2, True

$ python3 simple.py 
A, A, A==A : 2, 2, True

$ python3 homoglyph.py 
A, А, A==А : 1, 2, False

$ python2 homoglyph.py 
  File "homoglyph.py", line 2
SyntaxError: Non-ASCII character '\xd0' in file homoglyph.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details


IMHO python 2 is doing the right thing not python3 
As I am sure elisp would be doing if we could get a 25 year old version

We could sharpen the error if we liked:

$ cat homoglyphE.py 
# -*- coding: utf-8 -*-
A = 1
А = 2
print("A, А, A==А : %s, %s, %s\n" % (A,А,A==А))



$ python2 homoglyphE.py 
  File "homoglyphE.py", line 3
    А = 2
    ^
SyntaxError: invalid syntax


  parent reply	other threads:[~2018-11-29  5:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3677.1541718983.1284.help-gnu-emacs@gnu.org>
2018-11-12  5:39 ` Invoking a function from a list of functions Rusi
2018-11-12 15:19   ` [OFFTOPIC] " Stefan Monnier
     [not found]   ` <mailman.3921.1542036006.1284.help-gnu-emacs@gnu.org>
2018-11-16  2:48     ` Rusi
2018-11-16 16:40       ` James K. Lowden
2018-11-17 15:59         ` Rusi
2018-11-19 22:23           ` James K. Lowden
2018-11-19 23:11             ` Stefan Monnier
2018-11-20  6:15               ` Amin Bandali
2018-11-21 15:05                 ` Stefan Monnier
2018-11-23  3:41                   ` Amin Bandali
     [not found]               ` <mailman.4291.1542694542.1284.help-gnu-emacs@gnu.org>
2018-11-28 14:14                 ` Rusi
2018-12-11 18:48                   ` Amin Bandali
     [not found]             ` <mailman.4280.1542669123.1284.help-gnu-emacs@gnu.org>
2018-11-28 14:10               ` Rusi
2018-11-28 16:31                 ` Eli Zaretskii
2018-11-28 18:15                   ` Yuri Khan
2018-11-28 18:57                     ` Eli Zaretskii
2018-11-28 19:08                       ` Yuri Khan
     [not found]                       ` <mailman.4820.1543432126.1284.help-gnu-emacs@gnu.org>
2018-11-29  5:37                         ` Rusi [this message]
2018-11-16 16:40       ` James K. Lowden
2018-11-16 17:15         ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22fbcbc1-66ea-44a7-8948-871d3c3ad3eb@googlegroups.com \
    --to=rustompmody@gmail.com \
    --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.
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).