Non-ASCII in the future in the lexer

Danni Coy danni.coy at gmail.com
Thu Jun 1 08:08:53 UTC 2023


On Thu, Jun 1, 2023 at 4:35 PM Walter Bright via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On 5/31/2023 8:13 AM, H. S. Teoh wrote:
> > This is all great, but as someone else has already said, the input
> > method could be a problem area.  On my PC, I've set up XKB input with a
> > compose key such that many of these symbols are relatively easily
> > accessible; for example, Compose + < + = produces ≤; and Compose + v + /
> > produces √.  However, some symbols are more tricky to input, and some
> > are not accessible this way.
>
> I've struggled with that, too. On MicroEmacs, I fixed ^X-U to scroll through the
> various incarnations of a letter. So, placing the cursor on a, and hitting ^X-U,
> changes it to a with an umlaut, a with an accent, etc. On a -, it scrolls
> through the various - variations. On ", it scrolls through the quoting symbols.
>
> Of course, this is pretty limited.
>

The compose key on X windows (Linux) is user configurable.
You can use it to do basically whatever you want.
there are extra bindings available online for the greek alphabet and
mathematical symbols.
it's controlled from a configuration file for which the syntax looks
something like this.
<Multi_key> <asciitilde> <asciitilde>          : "≈"

On windows there is at least one addon that adds this functionality
and is user configurable.
I don't know what the situation is on Mac or on Wayland.

As low hanging fruit I would like to see constants such as MATH_PI
defined as by the symbol (eg π).
I think one of the most important qualities of code is readability and
getting the balance between verlbosity and terseness is important.

I would also like to see syntax like the following be possible

if ( 0 < x ≤ 8) {}  (lowers to if ( x > 0 && x <= 8) {} )



More information about the Digitalmars-d mailing list