-
What are the rules of when a function with no arguments will be implicitly called? Is there a difference between I'm also confused about the "suspender" syntax. User manual says: (https://koka-lang.github.io/koka/doc/book.html#why-mingen)
But in this example, the suspended code is evaluated:
This program prints
According to the book section linked above, I would expect |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Variable declarations implicitly define a block scope so that you can use multiple lines to define the variable. This is how you can do:
Any place a block scope occurs adding explicit braces will not change the meaning.
In all cases
|
Beta Was this translation helpful? Give feedback.
-
To answer my own question "when are nullary functions are implicitly called":
Example:
To call a function in a struct field, we need double
This is because the first |
Beta Was this translation helpful? Give feedback.
To answer my own question "when are nullary functions are implicitly called":
x.y
), so nullary functions are never implicitly called.x.y
selecting a field, then the field's value is not implicitly called, even if the types are right (i.e. the field's type is a nullary function).Example: