Totally lost when reading tutorial of "code-blocks-as-arguments"

2024-02-18 Thread Zoom
> It is possible to pass the last argument of a call expression in a separate > code block with indentation. For example, the following code example is a > valid (but not a recommended) way to call echo. `echo "Hello ":` is the same as `echo("Hello", foo)`, where foo is the result of the evalua

Totally lost when reading tutorial of "code-blocks-as-arguments"

2024-02-18 Thread janAkali
In this code example there are 2 concepts combined together: 1\. indented code block after `:` is evaluated and passed as the last argument to the procedure: proc foo(a, b: int) = echo "first argument is " & $a echo "second argument is " & $b foo 144: # first a

Totally lost when reading tutorial of "code-blocks-as-arguments"

2024-02-18 Thread Bosinski
> > I really don't know how to understand this code and the text, how is a & b > > called? `&` concats two strings, here `a` and `b`. Same as `echo a,b` The code-block gets executed and should print "Hello World!"

Totally lost when reading tutorial of "code-blocks-as-arguments"

2024-02-18 Thread felixfxu
echo "Hello ": let a = "Wor" let b = "ld!" a & b Run > It is possible to pass the last argument of a call expression in a separate > code block with indentation. For example,