KScript documentazione
IT

Lingua

Tradotto automaticamente dall’inglese, che è la versione originale.

Per iniziare

Funzioni

<fn name="greet" params="who: string, greeting = 'Hello'">
  <return value="$greeting + ', ' + $who + '!'" />
</fn>
<fn name="square" params="n: number" value="$n * $n" />

<echo>{ @greet('World') }</echo>
<echo>{ @greet('Kyle', greeting: 'Hi') }</echo>
<echo>{ 7 |> @square() }</echo>
fn greet(who: string, greeting = 'Hello') {
  return $greeting + ', ' + $who + '!'
}
fn square(n: number) => $n * $n

echo "{ @greet('World') }"
echo "{ @greet('Kyle', greeting: 'Hi') }"
echo "{ 7 |> @square() }"

Le tue funzioni e i comandi integrati vengono entrambi richiamati con @. Gli argomenti possono avere un nome, come greeting: 'Hi'.

Edit this page on GitHub