I should use : in function definitions instead since -> has higher priority and thus will conflict with using a comptime function RHS in the future
This commit is contained in:
parent
ab8568dcb1
commit
2f519337c9
1 changed files with 6 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
include("std.print")
|
||||
|
||||
# external print implementation ex ##
|
||||
print ( fmt : (compexpr | string) , values : any ... ) -> void {
|
||||
print ( fmt : (compexpr | string) , values : any ... ) : void {
|
||||
|
||||
last_n : int = 0
|
||||
|
||||
|
@ -14,9 +14,9 @@ print ( fmt : (compexpr | string) , values : any ... ) -> void {
|
|||
putstr( stdout, fmt[last_n : n] )
|
||||
|
||||
switch (value) {
|
||||
default: break
|
||||
case (int) -> putstr( stdout, to_str_from_int( int(value) ) )
|
||||
... <fill in rest>
|
||||
default : break
|
||||
case (int) : putstr( stdout, to_str_from_int( int(value) ) )
|
||||
case (float) : putstr( stdout, to_str_from_float( int(value) ) )
|
||||
}
|
||||
|
||||
last_n = n
|
||||
|
@ -26,7 +26,7 @@ print ( fmt : (compexpr | string) , values : any ... ) -> void {
|
|||
|
||||
|
||||
|
||||
test_func ( x : int , y : int ) -> int {
|
||||
test_func ( x : int , y : int ) : int {
|
||||
return ( x * y );
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ if ( x > 0 ) {
|
|||
print( "as expected; x = %\n" , x )
|
||||
}
|
||||
|
||||
main ( argc : int , argv : string[_] ) -> int {
|
||||
main ( argc : int , argv : string[_] ) : int {
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue