Bug 8782 – D lexer do not understand unicode char … for variadic
Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-08T04:31:00Z
Last change time
2015-06-09T05:11:41Z
Assigned to
nobody
Creator
bioinfornatics
Comments
Comment #0 by bioinfornatics — 2012-10-08T04:31:10Z
D lexer do not understand unicode char … for variadic.
from some keayboard layout is faster to write … than ...
________________________________________
import std.stdio;
import std.algorithm;
import std.array;
void main( ){
immutable int[] a = [4, 6, 1, 2,];
immutable int[] b = cast(immutable) a.dup
.sort!( (x,y) => x < y )
.array;
writeln( b );
}
Comment #1 by bioinfornatics — 2012-10-08T04:32:24Z
(In reply to comment #0)
> D lexer do not understand unicode char … for variadic.
>
> from some keayboard layout is faster to write … than ...
> ________________________________________
>
> import std.stdio;
> import std.algorithm;
> import std.array;
>
> void main( ){
> immutable int[] a = [4, 6, 1, 2,];
> immutable int[] b = cast(immutable) a.dup
> .sort!( (x,y) => x < y )
> .array;
> writeln( b );
> }
oops bad paste sorry
________________________________________
import std.stdio;
void foo( int[] params … ){
foreach( param; params )
writeln( praram );
}
void main(){
foo( 1, 2, 3, 4 );
}
Comment #2 by bearophile_hugs — 2012-10-08T04:46:17Z
The idea of using unicode glyphs in source code is interesting, and I think the now dead Fortress shows it's useful if done well. But introducing such change in D, and requiring a smart editor, just for a single symbol is a bit too much for too much little.
Comment #3 by bugzilla — 2012-10-08T08:02:16Z
I agree with bearophile. While D is a fully unicode language, the rest of the programming ecosystem is not there yet, and it would just be grief to make such changes now.
Maybe in 10 years.