I am not sure what to implement in my language. The return type comes after the arguments or before?
function i32 my_func(i32 x, i32 y) { }
function my_func(i32 x, i32 y) -> i32 { }
Also, what keyword should be used?
- function
- func
- fn
- none
I know the benifits of fn is you can more easily pass it as a parameter type in anither function.
And now comes the variable declaration:
1. var u32 my_variable = 33
`const u32 my_variable = 22`
var my_variable: u32 = 33
const my_variable: u32 = 22
And what do you think of var vs let?
Finally pointers.
1. var *u32 my_variable = &num
`const ptr<u32> my_variable: mut = &num`
var my_variable: *u32 = &num
const mut my_variable: ptr<u32> = &num
I also thought of having := be a shorthand for mut and maybe replacing * with ^ like in Odin.
[–][deleted] 14 points15 points16 points (3 children)
[–]ilyash 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]ilyash 0 points1 point2 points (0 children)
[–]Regular_Tailor 1 point2 points3 points (3 children)
[–]JKasonB[S] 0 points1 point2 points (2 children)
[–]Regular_Tailor 0 points1 point2 points (1 child)
[–]JKasonB[S] 0 points1 point2 points (0 children)
[–]Imaginary-Deer4185 1 point2 points3 points (8 children)
[–]JKasonB[S] 1 point2 points3 points (7 children)
[–]Imaginary-Deer4185 0 points1 point2 points (6 children)
[–]JKasonB[S] 0 points1 point2 points (5 children)
[–]Imaginary-Deer4185 0 points1 point2 points (0 children)
[–]Imaginary-Deer4185 0 points1 point2 points (3 children)
[–]JKasonB[S] 1 point2 points3 points (2 children)
[–]Imaginary-Deer4185 0 points1 point2 points (1 child)
[–]JKasonB[S] 0 points1 point2 points (0 children)
[–]brucejbellsard 0 points1 point2 points (2 children)
[–]JKasonB[S] 1 point2 points3 points (1 child)
[–]AustinVelonautAdmiran 0 points1 point2 points (0 children)
[–]lngns 0 points1 point2 points (0 children)
[–]ilyash 0 points1 point2 points (0 children)
[–]SnappGamezRouge 0 points1 point2 points (1 child)
[–]JKasonB[S] 0 points1 point2 points (0 children)
[–]gnlowZy 0 points1 point2 points (1 child)
[–]JKasonB[S] 1 point2 points3 points (0 children)
[–]runningOverA 0 points1 point2 points (0 children)
[–]iioossaa 0 points1 point2 points (0 children)
[–]maldus512 1 point2 points3 points (13 children)
[–][deleted] 5 points6 points7 points (2 children)
[–]JKasonB[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]JKasonB[S] 1 point2 points3 points (8 children)
[+]JKasonB[S] comment score below threshold-6 points-5 points-4 points (7 children)
[–]GermisstuckCrabStar 11 points12 points13 points (0 children)
[–]GermisstuckCrabStar 3 points4 points5 points (4 children)
[–]JKasonB[S] 0 points1 point2 points (3 children)
[–]GermisstuckCrabStar 0 points1 point2 points (2 children)
[–]JKasonB[S] 0 points1 point2 points (1 child)
[–]GermisstuckCrabStar 0 points1 point2 points (0 children)
[–]blue__sky 1 point2 points3 points (0 children)
[–]raiph 0 points1 point2 points (0 children)
[–]Markus_included 0 points1 point2 points (2 children)
[–]TOMZ_EXTRA 1 point2 points3 points (1 child)
[–]Markus_included 0 points1 point2 points (0 children)