diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-12-07 16:04:25 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-12-07 16:04:25 -0500 |
| commit | 37f3e91f6c95d46f161dbde05b0a005fe7e7c17a (patch) | |
| tree | c6e080ebbe7aed267b8ca0c5aec80fece51a5f65 /examples | |
| parent | a201939a8150bc4c2f221925797ea2751c74b77c (diff) | |
Rename "NONE" to "none"
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/base64/base64.tm | 4 | ||||
| -rw-r--r-- | examples/http/http.tm | 4 | ||||
| -rw-r--r-- | examples/learnxiny.tm | 6 | ||||
| -rw-r--r-- | examples/threads/threads.tm | 2 | ||||
| -rw-r--r-- | examples/tomo-install/tomo-install.tm | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/examples/base64/base64.tm b/examples/base64/base64.tm index bed94ac1..52af6e89 100644 --- a/examples/base64/base64.tm +++ b/examples/base64/base64.tm @@ -59,10 +59,10 @@ lang Base64: output[dest+2] = _EQUAL_BYTE output[dest+3] = _EQUAL_BYTE - return Base64.without_escaping(Text.from_bytes(output) or return NONE) + return Base64.without_escaping(Text.from_bytes(output) or return none) func decode_text(b64:Base64 -> Text?): - return Text.from_bytes(b64:decode_bytes() or return NONE) + return Text.from_bytes(b64:decode_bytes() or return none) func decode_bytes(b64:Base64 -> [Byte]?): bytes := b64.text_content:bytes() diff --git a/examples/http/http.tm b/examples/http/http.tm index f36fac60..425a7ba5 100644 --- a/examples/http/http.tm +++ b/examples/http/http.tm @@ -78,7 +78,7 @@ func _send(method:_Method, url:Text, data:Text?, headers=[:Text] -> HTTPResponse return HTTPResponse(Int(code), "":join(chunks)) func get(url:Text, headers=[:Text] -> HTTPResponse): - return _send(GET, url, NONE, headers) + return _send(GET, url, none, headers) func post(url:Text, data="", headers=["Content-Type: application/json", "Accept: application/json"] -> HTTPResponse): return _send(POST, url, data, headers) @@ -89,7 +89,7 @@ func put(url:Text, data="", headers=["Content-Type: application/json", "Accept: func patch(url:Text, data="", headers=["Content-Type: application/json", "Accept: application/json"] -> HTTPResponse): return _send(PATCH, url, data, headers) -func delete(url:Text, data=NONE:Text, headers=["Content-Type: application/json", "Accept: application/json"] -> HTTPResponse): +func delete(url:Text, data=none:Text, headers=["Content-Type: application/json", "Accept: application/json"] -> HTTPResponse): return _send(DELETE, url, data, headers) func main(): diff --git a/examples/learnxiny.tm b/examples/learnxiny.tm index af7a55f6..5315b034 100644 --- a/examples/learnxiny.tm +++ b/examples/learnxiny.tm @@ -108,17 +108,17 @@ func main(): >> table["two"] = 2 : Int? - # The value returned is optional because NONE will be returned if the key + # The value returned is optional because none will be returned if the key # is not in the table: >> table["xxx"]! - = NONE : Int? + = none : Int? # Optional values can be converted to regular values using `!` (which will # create a runtime error if the value is null): >> table["two"]! = 2 : Int - # You can also use `or` to provide a fallback value to replace NONE: + # You can also use `or` to provide a fallback value to replace none: >> table["xxx"] or 0 = 0 : Int diff --git a/examples/threads/threads.tm b/examples/threads/threads.tm index 8be568cd..16beb9bc 100644 --- a/examples/threads/threads.tm +++ b/examples/threads/threads.tm @@ -85,7 +85,7 @@ func main(): t := PThread.new(func(): say("In another thread!") - item := @NONE:Int + item := @none:Int while item[] != 30: g:guarded(func(): while queue.length == 0: diff --git a/examples/tomo-install/tomo-install.tm b/examples/tomo-install/tomo-install.tm index 998462dd..f769204f 100644 --- a/examples/tomo-install/tomo-install.tm +++ b/examples/tomo-install/tomo-install.tm @@ -38,7 +38,7 @@ func main(paths:[Path]): say("Already installed: $url") skip - alias := NONE:Text + alias := none:Text curl_flags := ["-L"] if github := url_without_protocol:matches($|github.com/{!/}/{!/}#{..}|): user := github[1] |
