]> git.lizzy.rs Git - uwu-lang.git/commitdiff
Document lazy evaluation
authorElias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com>
Mon, 28 Feb 2022 15:56:08 +0000 (16:56 +0100)
committerGitHub <noreply@github.com>
Mon, 28 Feb 2022 15:56:08 +0000 (16:56 +0100)
doc/syntax.md

index f87b279ca1102e60dda2d5fa86e2ec67c86c4abe..e7b8e43f93f4920ebd0e15f4e130ca25c1a01b13 100644 (file)
@@ -31,7 +31,7 @@ string literal
 - Function reference: `&function_name`
 - Function call: `function_name(args)` or just `function_name`, where args is a comma-separated list of expressions.
 
-**Important:** When passing arguments to a function, these arguments are not passed directly as values, but rather as expressions. Each argument is evaulated as the called function accesses it. This means that you can have constructs that would cause infinite recursion in other languages - a good example for a usecase of that are conditions: `bool.if(condition, if_true, else)` is just a regular function from the standard library. `if_true` is only evaluated if condition is truey, meaning that if condition is falsey and `if_true` is a function call, that function will not be called.
+**Important:** UwU is based on lazy evaluation. This means that when passing arguments to a function, these arguments are not passed directly as values, but rather as expressions. Each argument is evaulated as the called function accesses it. This means that you can have constructs that would cause infinite recursion in other languages - a good example for a usecase of that are conditions: `bool.if(condition, if_true, else)` is just a regular function from the standard library. `if_true` is only evaluated if condition is truey, meaning that if condition is falsey and `if_true` is a function call, that function will not be called.
 
 Function name syntax: