1
1
Fork 0
mirror of https://github.com/azur1s/bobbylisp.git synced 2024-10-16 02:37:40 -05:00
bobbylisp/example/strings.hz

17 lines
355 B
Plaintext
Raw Normal View History

2022-03-26 19:22:52 -05:00
fun main: void = do
2022-04-01 03:15:36 -05:00
let str: string = "Hello, World"
2022-03-26 19:22:52 -05:00
-- Matching string(s)
match str with
2022-04-01 03:15:36 -05:00
| "Hello, World" -> @write("yes\n")
| else @write("no\n")
end
2022-03-26 19:22:52 -05:00
-- Indexing character in string
2022-04-01 03:15:36 -05:00
let foo: string = @get(str, 0)
2022-03-26 19:22:52 -05:00
match foo with
2022-04-01 03:15:36 -05:00
| "H" -> @write("still yes")
| else @write("no H")
end
end