diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-03-27 15:22:46 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-03-27 15:22:46 -0700 |
| commit | a1849da175765350e013bdeecfa4e0ad3c066937 (patch) | |
| tree | 616a115790271757148044e2b3228fb715c00726 /examples/how_do_i.nom | |
| parent | bb07e6724118c431c3beed4060776678128905a1 (diff) | |
Autoformat (mostly just to do with the new
blank-line-after-end-of-multi-indent-block rule
Diffstat (limited to 'examples/how_do_i.nom')
| -rw-r--r-- | examples/how_do_i.nom | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/how_do_i.nom b/examples/how_do_i.nom index cdd8a07..9cfc0dc 100644 --- a/examples/how_do_i.nom +++ b/examples/how_do_i.nom @@ -1,5 +1,4 @@ #!/usr/bin/env nomsu -V7.0.0 - ### How do I... ### Write a comment? Put a # and go till the end of the line ### How do I write a multi-line comment? @@ -199,6 +198,7 @@ say both "Hello" and also "world!" $f2 = $tmp if ($f2 > $n): return $f2 + say (first fibonacci above 10) ### Actions can have aliases, which may or may not have the arguments in different order @@ -290,6 +290,7 @@ say "The square root of 2 is \(square root of 2)" ") ..else: return (Lua "-- (debug code removed for production)") + $DEBUG_ENABLED = (yes) ### Constants can be defined as macros @@ -318,6 +319,7 @@ debug only: $key = ($key_fn $item) if (($best == (nil)) or ($key > $best_key)): [$best, $best_key] = [$item, $key] + return $best ### Function literals look like: $x -> ($x * $x) @@ -338,6 +340,7 @@ say (best of [2, -3, 4, -8] according to $($ squared)) $key = $key_expr if (($best == (nil)) or ($key > $best_key)): [$best, $best_key] = [$item, $key] + return $best ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -352,4 +355,5 @@ say $key = ($x * $x) if (($best == (nil)) or ($key > $best_key)): [$best, $best_key] = [$x, $key] + return $best
\ No newline at end of file |
