Why is Bosque moving away from regular generic syntax
Closed this issue ยท 4 comments
Regarding the following example:
function allOdd(...args: List[Int]): Bool {
return args.all(fn(x) => x % 2 == 1);
}
Both TypeScript and C# use <>
to define and consume generics while Bosque uses []
.
Is there any reason for it? Because all languages supported by Microsoft should have the same "syntax standards".
I mean, there are some differences between TypeScript and C# but the standards are still there:
- Generics
<>
- Arrays
[]
- Object initialization
{}
(e.g Anonymous functions for C#) - Etc...
Is there any constraint that requires Bosque to move away from the microsoft's "standards"?
Also []
seems confusing.
function allOdd(...args: List<Int>): Bool {
return args.all(fn(x) => x % 2 == 1);
}
Because Microsoft decided to take features from other languages and put them into one?
In the tic-tac-toe example, they have NSMain
(from Objective-C).
All the array syntax is the same too.. @[1, 2, 3, ...]
is the Objective-C array literal.
function foo(x: Int, y: Int): Int
is from Pascal.
They are inconsistent with how "this" is used.. "this.cells" vs. "this->getContent". I guess they're just trying to research different syntax and what people would like and not like..
Partially related -- I wonder why type unions are inconsistent.
T1 | T2 // Either T1 or T2
T1 + T2 // Must provide both T1 and T2 (why is it not T1 & T2)
@Brandon-T oh yeah I forgot this is still an experiment