mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
Compare commits
No commits in common. "47fbb70b8da4a724aded3d72b75cbd0fa88608a4" and "8cfeb61549c2767c01d93a6f1c02da524ba28e72" have entirely different histories.
47fbb70b8d
...
8cfeb61549
|
@ -2,7 +2,7 @@
|
|||
Programming language that compiles to Typescript!
|
||||
|
||||
```sml
|
||||
fun main : void = do
|
||||
fun main : void = do
|
||||
@write("Hello, World!")
|
||||
end
|
||||
```
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
fun map_ (vec: [int]) (fn: |int| -> int) (current: int): void = do
|
||||
fun iter_ (vec: [int]) (fn: |int| -> int) (current: int): void = do
|
||||
if current == @len(vec) then
|
||||
do end
|
||||
else
|
||||
|
@ -8,16 +8,16 @@ fun map_ (vec: [int]) (fn: |int| -> int) (current: int): void = do
|
|||
|> @write(_)
|
||||
@write("\n")
|
||||
|
||||
map_(vec, fn, current + 1)
|
||||
iter_(vec, fn, current + 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
fun map (vec: [int]) (fn: |int| -> int): void = map_(vec, fn, 0)
|
||||
fun iter (vec: [int]) (fn: |int| -> int): void = iter_(vec, fn, 0)
|
||||
|
||||
fun mul10 (x: int): int = x * 10
|
||||
|
||||
fun main: void = do
|
||||
let foo: [int] = [69, 420, 727, 1337, 42069, 69420]
|
||||
map(foo, mul10)
|
||||
end
|
||||
iter(foo, mul10)
|
||||
end
|
Loading…
Reference in a new issue