aboutsummaryrefslogtreecommitdiff
path: root/docs/langs.md
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-06 14:20:18 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-06 14:20:18 -0400
commit2bb2ff871fa1761478442bec5f6a32c9428360a1 (patch)
tree9b73df7a0c50c02353ae7bca7c2cd54788ef0077 /docs/langs.md
parent59845e610f2c90474f34079d27b5f1e07071ded4 (diff)
Change method calls to use `foo.baz()` instead of `foo:baz()`
Diffstat (limited to 'docs/langs.md')
-rw-r--r--docs/langs.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/langs.md b/docs/langs.md
index d7225ae5..aec9cfa9 100644
--- a/docs/langs.md
+++ b/docs/langs.md
@@ -11,7 +11,7 @@ where a different type of string is needed.
```tomo
lang HTML:
convert(t:Text -> HTML):
- t = t:translate({
+ t = t.translate({
"&" = "&amp;",
"<" = "&lt;",
">" = "&gt;",
@@ -75,14 +75,14 @@ instead of building a global function called `execute()` that takes a
```tomo
lang Sh:
convert(text:Text -> Sh):
- return Sh.from_text("'" ++ text:replace("'", "''") ++ "'")
+ return Sh.from_text("'" ++ text.replace("'", "''") ++ "'")
func execute(sh:Sh -> Text):
...
dir := ask("List which dir? ")
cmd := $Sh@(ls -l @dir)
-result := cmd:execute()
+result := cmd.execute()
```
## Conversions
@@ -94,12 +94,12 @@ another type's block or at the top level.
```tomo
lang Sh:
convert(text:Text -> Sh):
- return Sh.from_text("'" ++ text:replace("'", "''") ++ "'")
+ return Sh.from_text("'" ++ text.replace("'", "''") ++ "'")
struct Foo(x,y:Int):
convert(f:Foo -> Sh):
return Sh.from_text("$(f.x),$(f.y)")
convert(texts:[Text] -> Sh):
- return $Sh" ":join([Sh(t) for t in texts])
+ return $Sh" ".join([Sh(t) for t in texts])
```