no :: in func decls
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# Milestone 5 foundation: booleans, comparisons, logical ops, if/else if/else.
|
||||
|
||||
printf :: c_func(format *c_char, ...) c_int
|
||||
printf c_func(format *c_char, ...) c_int
|
||||
|
||||
# Returns a distinct code per range using if / else if / else and comparisons.
|
||||
classify :: func(n i32) i32 {
|
||||
classify func(n i32) i32 {
|
||||
if n < 0 {
|
||||
return 1
|
||||
} else if n == 0 {
|
||||
@@ -17,12 +17,12 @@ classify :: func(n i32) i32 {
|
||||
|
||||
# A bool-returning function with a visible side effect, used to prove
|
||||
# short-circuit evaluation: it must only print when actually evaluated.
|
||||
noisy :: func() bool {
|
||||
noisy func() bool {
|
||||
_ = printf("rhs-evaluated\n")
|
||||
return true
|
||||
}
|
||||
|
||||
main :: func() i32 {
|
||||
main func() i32 {
|
||||
total i32 = 0
|
||||
|
||||
# comparisons drive if / else if / else
|
||||
|
||||
Reference in New Issue
Block a user