I personally hate all operators.
a⌐b
A problem with using non-ASCII Unicode characters as operator names is
that they can be difficult to type -- and the way you type them is inconsistent across systems.
There's nothing wrong with using identifiers as operator names.
C already does this with "sizeof" et al.
Fun fact: Python’s operator precedence rules differ from C’s ones in one subtle little way, that actually reduces the need for parentheses in real- world code.
While Python and C++ let you define new overloads for standard operators, very few languages allow you to define entirely new operators. Algol 68
did (from a limited character set).
There is no "Compose" key on the keyboard I'm using to type this.
There is a key labeled "Alt Gr", but it doesn't appear to behave in
any consistent or useful way.
(I'm using a Windows laptop; "Alt Gr"
doesn't appear to do anything useful even in Windows PowerShell.)
If there's an easy way to type non-ASCII characters like '·' that
works across different systems, including all the various terminal
emulators used on Windows and Linux (as well as MacOS, but I don't
happen to use it), I'd love to know about it.
(I obtained that
'·' character by opening vim, entering the Ctrl-K . M digraph,
and copy-and-pasting into this window -- not something I'd be
willing to do every time I want to type an operator symbol.)
People who use non-English languages typically have keyboards with
accented letters and so forth.
There's nothing wrong with using identifiers as operator names.
C already does this with "sizeof" et al.
Except they add to your list of reserved words.
That's not much of a problem if they're designed into the language from
the beginning. (I'm not suggesting adding new keyword operator symbols
to C -- though C has been acquiring new keywords, including alignof
which is an operator and typeof which resembles one.)
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Wed, 28 Aug 2024 12:46:55 -0700, Keith Thompson wrote:
A problem with using non-ASCII Unicode characters as operator names is
that they can be difficult to type -- and the way you type them is
inconsistent across systems.
The best way is the Compose key available on *nix systems. This is the
closest to a mnemonic-based system that reduces the burden on your
memory.
<https://wiki.wlug.org.nz/ComposeKey>
There is no "Compose" key on the keyboard I'm using to type this.
People who use non-English languages typically have keyboards with
accented letters and so forth.
On Wed, 28 Aug 2024 14:17:49 -0000 (UTC), Blue-Maned_Hawk wrote:
I personally hate all operators.
Operators are great. They’re popular in maths because they avoid parenthesis clutter, leaving the structure of the expression clearer.
Fun fact: Python’s operator precedence rules differ from C’s ones in one subtle little way, that actually reduces the need for parentheses in real- world code.
While Python and C++ let you define new overloads for standard operators, very few languages allow you to define entirely new operators. Algol 68
did (from a limited character set). You can kind of simulate it in Python, too.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Wed, 28 Aug 2024 12:46:55 -0700, Keith Thompson wrote:
A problem with using non-ASCII Unicode characters as operator names is
that they can be difficult to type -- and the way you type them is
inconsistent across systems.
The best way is the Compose key available on *nix systems. This is the
closest to a mnemonic-based system that reduces the burden on your memory. >>
<https://wiki.wlug.org.nz/ComposeKey>
There is no "Compose" key on the keyboard I'm using to type this.
There is a key labeled "Alt Gr", but it doesn't appear to behave in
any consistent or useful way. (I'm using a Windows laptop; "Alt Gr"
doesn't appear to do anything useful even in Windows PowerShell.)
If there's an easy way to type non-ASCII characters like '·' that
works across different systems, including all the various terminal
emulators used on Windows and Linux (as well as MacOS, but I don't
happen to use it), I'd love to know about it. (I obtained that
'·' character by opening vim, entering the Ctrl-K . M digraph,
and copy-and-pasting into this window -- not something I'd be
willing to do every time I want to type an operator symbol.)
People who use non-English languages typically have keyboards with
accented letters and so forth.
There's nothing wrong with using identifiers as operator names.
C already does this with "sizeof" et al.
Except they add to your list of reserved words.
That's not much of a problem if they're designed into the language from
the beginning. (I'm not suggesting adding new keyword operator symbols
to C -- though C has been acquiring new keywords, including alignof
which is an operator and typeof which resembles one.)
On 29.08.2024 02:04, Keith Thompson wrote:
If there's an easy way to type non-ASCII characters like '·' that
works across different systems, including all the various terminal
emulators used on Windows and Linux (as well as MacOS, but I don't
happen to use it), I'd love to know about it.
I don't think there can be a portable or consistent way to create
that character. Incidentally (I just tried a few keys) I can get
the '·' by typing "Alt GR" and ',' (on my DE keyboard). [...]
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
On 29.08.2024 04:07, Janis Papanagnou wrote:
On 29.08.2024 02:04, Keith Thompson wrote:
If there's an easy way to type non-ASCII characters like '·' that
works across different systems, including all the various terminal
emulators used on Windows and Linux (as well as MacOS, but I don't
happen to use it), I'd love to know about it.
I don't think there can be a portable or consistent way to create
that character. Incidentally (I just tried a few keys) I can get
the '·' by typing "Alt GR" and ',' (on my DE keyboard). [...]
Keith, what does your keyboard produce when typing <Alt>-<7> ?
On my US keyboard it produces the '·'. Don't know whether that
is reliable, though. (I don't think it is; e.g. my Thunderbird
doesn't expand any character when entering <Alt> combinations.)
It produces the two-character sequence Escape 7.
On Thu, 29 Aug 2024 09:59:49 -0700
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
On 29.08.2024 04:07, Janis Papanagnou wrote: =20=20
On 29.08.2024 02:04, Keith Thompson wrote: =20
=20
If there's an easy way to type non-ASCII characters like '=C2=B7' that >> >>> works across different systems, including all the various terminal
emulators used on Windows and Linux (as well as MacOS, but I don't
happen to use it), I'd love to know about it. =20
I don't think there can be a portable or consistent way to create
that character. Incidentally (I just tried a few keys) I can get
the '=C2=B7' by typing "Alt GR" and ',' (on my DE keyboard). [...] =20
Keith, what does your keyboard produce when typing <Alt>-<7> ?
On my US keyboard it produces the '=C2=B7'. Don't know whether that
is reliable, though. (I don't think it is; e.g. my Thunderbird
doesn't expand any character when entering <Alt> combinations.) =20
It produces the two-character sequence Escape 7.
=20
Which 7? The one on numeric pad produces =E2=80=A2 in quite a lot of contex= >ts.
The character appears after release of Alt key.
Michael S <already5chosen@yahoo.com> writes:
On Thu, 29 Aug 2024 09:59:49 -0700
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
On 29.08.2024 04:07, Janis Papanagnou wrote: =20=20
On 29.08.2024 02:04, Keith Thompson wrote: =20
=20
If there's an easy way to type non-ASCII characters like
'=C2=B7' that works across different systems, including all
the various terminal emulators used on Windows and Linux (as
well as MacOS, but I don't happen to use it), I'd love to know
about it. =20
I don't think there can be a portable or consistent way to
create that character. Incidentally (I just tried a few keys) I
can get the '=C2=B7' by typing "Alt GR" and ',' (on my DE
keyboard). [...] =20
Keith, what does your keyboard produce when typing <Alt>-<7> ?
On my US keyboard it produces the '=C2=B7'. Don't know whether
that is reliable, though. (I don't think it is; e.g. my
Thunderbird doesn't expand any character when entering <Alt>
combinations.) =20
It produces the two-character sequence Escape 7.
=20
Which 7? The one on numeric pad produces =E2=80=A2 in quite a lot of >contex= ts.
The character appears after release of Alt key.
The numeric pad ALT-'7' produces <esc>[H (home cursor).
On Thu, 29 Aug 2024 20:18:20 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
contex= ts.
The character appears after release of Alt key.
The numeric pad ALT-'7' produces <esc>[H (home cursor).
It looks like your usenet client displays my post quite differently from
my client. In order to establish a common ground please look at my post
I don't often need to type non-ASCII characters; when I do,
my most common approach is to use vim digraphs.
Michael S <already5chosen@yahoo.com> writes:
On Thu, 29 Aug 2024 20:18:20 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
contex= ts.
The character appears after release of Alt key.
The numeric pad ALT-'7' produces <esc>[H (home cursor).
It looks like your usenet client displays my post quite differently
from my client. In order to establish a common ground please look at
my post
Perhaps you could avoid unnecessary UTF-8 instead...
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Thu, 29 Aug 2024 13:41:35 -0700, Keith Thompson wrote:
I don't often need to type non-ASCII characters; when I do,
my most common approach is to use vim digraphs.
Does it let you type (part or all of) Unicode names?
I don't think so.
a·b·····
middle dot - terribly nice and good loking
On Wed, 28 Aug 2024 17:04:46 -0700, Keith Thompson wrote:
There is no "Compose" key on the keyboard I'm using to type this.
Remember, you can assign your own keys on *nix GUIs.
I use Caps Lock for this purpose.
People who use non-English languages typically have keyboards with
accented letters and so forth.
As I have mentioned before, the idea that only “non-English languages” needs such symbols demonstrates a certain ... naïveté.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (1 / 15) |
Uptime: | 155:51:39 |
Calls: | 10,384 |
Calls today: | 1 |
Files: | 14,056 |
Messages: | 6,416,464 |