August 06, 2015
On Thursday, 6 August 2015 at 13:27:34 UTC, Timon Gehr wrote:
> I can actually type ≠ and ≤ more quickly than != or <= in my editor.

Wow. The only way that I'd know how to get those characters would be to copy-paste them from somewhere. I'm sure that there's a far easier way to generate them, but if a symbol isn't actually on my keyboard, I wouldn't have a clue how to type it, and I would have thought that support for typing it would be editor-specific. In general, I would have expected it to be a total disaster if a language used any non-ASCII characters in its syntax.

- Jonathan M Davis
August 06, 2015
On 08/06/2015 04:14 PM, rsw0x wrote:
> On Thursday, 6 August 2015 at 11:26:10 UTC, Ola Fosheim Grøstad wrote:
>> But I would prefer "=", "≠","<" and "≤" for comparison and
>> constants... then have something else for variable assignment.
>
> :=, or ≔

← or ⇐ are also fine choices.
August 06, 2015
On Thu, 2015-08-06 at 14:14 +0000, Jonathan M Davis via Digitalmars-d wrote:
> On Thursday, 6 August 2015 at 13:27:34 UTC, Timon Gehr wrote:
> > I can actually type ≠ and ≤ more quickly than != or <= in my editor.
> 
> Wow. The only way that I'd know how to get those characters would be to copy-paste them from somewhere. I'm sure that there's a far easier way to generate them, but if a symbol isn't actually on my keyboard, I wouldn't have a clue how to type it, and I would have thought that support for typing it would be editor-specific. In general, I would have expected it to be a total disaster if a language used any non-ASCII characters in its syntax.
> 
> - Jonathan M Davis

As rsw0x said previously, compose keys and construction of non-ASCII Unicode codepoints have been around for decades. The fixation on "only ASCII characters" is a hang-over from the 1970s I'm afraid and now it is 2015 – supposedly.

A neat alternative to the compose key – well actually a strong accompaniment really – is to allow for multiple keyboard bindings. In particular I have Greek set up so I can switch from en (en_UK obviously since that is the only real form of en) to gr very quickly and then I am typing Greek characters on my UK keyboard. Damn useful for all this LaTeX maths (*) and general "calculating approximations to π" type stuff.

More programming languages should get with the Unicode programme.
Obviously not to allow the silly emoticon programs that did the rounds
on Swift's release, but exactly to allow for ≠ « »  ≤ ≥ ¨ etc., etc.,
etc. All the sensible stuff that would make reading programs easier.


(*) NB not math, that is an un-English diminutive :-)
-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


August 06, 2015
On Thu, 2015-08-06 at 16:20 +0200, Timon Gehr via Digitalmars-d wrote:
> On 08/06/2015 04:14 PM, rsw0x wrote:
> > On Thursday, 6 August 2015 at 11:26:10 UTC, Ola Fosheim Grøstad wrote:
> > > But I would prefer "=", "≠","<" and "≤" for comparison and constants... then have something else for variable assignment.
> > 
> > :=, or ≔
> 
> ← or ⇐ are also fine choices.

And indeed ones taken in Scala, <- can be ←, which looks so much nicer to read.
-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


August 06, 2015
On Thursday, 6 August 2015 at 15:09:01 UTC, Russel Winder wrote:
> Damn useful for all this LaTeX maths (*) and general "calculating approximations to π" type stuff.

\pi ? https://en.wikibooks.org/wiki/LaTeX/Mathematics#Greek_letters
August 06, 2015
On Thursday, 6 August 2015 at 15:31:25 UTC, Kagamin wrote:
> On Thursday, 6 August 2015 at 15:09:01 UTC, Russel Winder wrote:
>> Damn useful for all this LaTeX maths (*) and general "calculating approximations to π" type stuff.
>
> \pi ? https://en.wikibooks.org/wiki/LaTeX/Mathematics#Greek_letters

Using a compose key or alternate layout is much, *much* faster than the LaTeX notation.
August 06, 2015
On Thursday, 6 August 2015 at 15:09:01 UTC, Russel Winder wrote:
> More programming languages should get with the Unicode programme.
> Obviously not to allow the silly emoticon programs that did the rounds
> on Swift's release, but exactly to allow for ≠ « »  ≤ ≥ ¨ etc., etc.,
> etc. All the sensible stuff that would make reading programs easier.
>

A unicode DIP would be nice to see. Haskell offers Unicode support and is completely compatible with ASCII.
Would probably be simple to create a tool to quickly shift between the two.

It definitely does look much better.
August 06, 2015
On Thursday, 6 August 2015 at 15:11:59 UTC, Russel Winder wrote:
> On Thu, 2015-08-06 at 16:20 +0200, Timon Gehr via Digitalmars-d wrote:
>> ← or ⇐ are also fine choices.
>
> And indeed ones taken in Scala, <- can be ←, which looks so much nicer to read.

Yes, probably doesn't matter too much which way the arrow points, you can make up mnemonics for both. I.e. are you transferring a reference/value to the symbol or is the symbol pointing at/pinpointing an object/value. I guess the first one is the more common mnemonic, although for references maybe the latter is more in line with how you draw diagrams (the arrow pointing to the instance).

IIRC, in Beta you had this pipeline like assignment/function call notation

(s,t,v) => func1 => func2 => ((x,y,z), (a,b,c))

Which would be similar to the more conventional

((x,y,z), (a,b,c)) := func2(func1(s,t,v))

With arrows you can allow both directions. The conventional right to left is easier to read for short expressions. But the pipelining left to right is easier to read for longer expressions that go through multiple stages.

I think Rust also allows you to bind elements to a tuple using both "let" and "mut" in the same tuple expression, so that you can declare and bind both to variables and constants in a single expression.

If you have serveral visually distinct array types you probably could get a coherent and easy to remember syntax for function calls, value assignment, reference assignment, array assignment, ranges/dataflow pipelining etc.

August 06, 2015
On Thursday, 6 August 2015 at 14:14:30 UTC, Jonathan M Davis wrote:
> Wow. The only way that I'd know how to get those characters would be to copy-paste them from somewhere. I'm sure that there's a far easier way to generate them, but if a symbol isn't actually on my keyboard, I wouldn't have a clue how to type it, and I would have thought that support for typing it would be editor-specific. In general, I would have expected it to be a total disaster if a language used any non-ASCII characters in its syntax.

I think it is a big advantage if the default editor and syntax is developed in tandem, it can enable less cluttered syntax and a better editing experience. Some syntaxes can improve a lot by having sensible colouring/visual layout.

On many non-US keyboards the C-language syntax-characters are put in annoying positions too.

To get braces "{}" I have to type: alt-shift-8 alt-shift-9.

To get "<=" I have to type: < shift-0

To get "≤" I type: alt-<

August 06, 2015
On Thursday, 6 August 2015 at 14:14:30 UTC, Jonathan M Davis wrote:
> In general, I would have expected it to be a total disaster if a language used any non-ASCII characters in its syntax.

I still think it would be...not everyone uses the same editor. I had to look up how to do it in Notepad++. It requires knowing the Unicode key. Not exactly user-friendly. I wouldn't have an issue if the editor had a layout like Lyx.