4 ms·
Can you clarify a few things, these are bikeshed issues but they bother me none the less. * Why was fn foo(bar: int) -> int chosen and not fn foo(bar:int): int
by nwmcsween 15y ago
Can you clarify a few things, these are bikeshed issues but they bother me none the less.
* Why was fn foo(bar: int) -> int chosen and not fn foo(bar:int): int?
* Why annotations within comments? Annotations aren't comments it smells of C bolt-on. Why not keyword annotations?
- brson 15y agoAnnotations don't live within comments. The syntax for annotations is #[annotation]. They are part of the grammar.
- mhitza 15y agoBecause with the arrow syntax for results it makes it cleaner for functions that return functions? fn (x:int) -> fn@(y:int, z:int) -> int
- fzzzy 15y agoAlso passing functions to functions: fn foo(bar: fn(baz: int) -> int) -> int Instead of fn foo(bar: fn(baz: int) : int) : int