diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-10-09 13:26:28 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-10-09 13:26:28 -0400 |
| commit | 074cf22ad462eafe963e4a749b2b74cab51211a1 (patch) | |
| tree | e1d7f938f2d949cc5dcf67ca648f200663e36562 /docs/langs.md | |
| parent | 47fca946065508cff4151a32b3008c161983fd9d (diff) | |
Change function syntax from `func(args)->ret` to `func(args -> ret)`
Diffstat (limited to 'docs/langs.md')
| -rw-r--r-- | docs/langs.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/langs.md b/docs/langs.md index 0eecb3cd..31ce275e 100644 --- a/docs/langs.md +++ b/docs/langs.md @@ -10,7 +10,7 @@ where a different type of string is needed. ```tomo lang HTML: - func escape(t:Text)->HTML: + func escape(t:Text -> HTML): t = t:replace_all({ $/&/: "&", $/</: "<", @@ -20,7 +20,7 @@ lang HTML: }) return HTML.without_escaping(t) - func paragraph(content:HTML)->HTML: + func paragraph(content:HTML -> HTML): return $HTML"<p>$content</p>" ``` @@ -74,10 +74,10 @@ instead of building a global function called `execute()` that takes a ```tomo lang Sh: - func escape(text:Text)->Sh: + func escape(text:Text -> Sh): return Sh.without_escaping("'" ++ text:replace($/'/, "''") ++ "'") - func execute(sh:Sh)->Text: + func execute(sh:Sh -> Text): ... dir := ask("List which dir? ") |
