This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tests/test_for_loop.zion:1:4: test_for_loop.main = (λ_.let __v16 = (std.iter let __range_min__v13 = 1 in let __range_next__v14 = (std.+ 1 __range_min__v13) in let __range_max__v15 = 10 in (std.Range __range_min__v13 (std.- __range_next__v14 __range_min__v13) __range_max__v15)) in (while std.True match (__v16 ()) (std.Just(x) std.print x) (std.Nothing (break!)))) :: () -> std.ExitCode | |
| src/parser.cpp:411:1: std.+ = __builtin_add_int :: Int -> Int -> Int | |
| src/parser.cpp:393:1: std.- = __builtin_subtract_int :: Int -> Int -> Int | |
| tests/test_for_loop.zion:2:16: std.Range = (λ__v10.return! (λ__v11.return! (λ__v12.return! ((__v10, __v11, __v12) as! std.Range Int)))) :: Int -> Int -> Int -> std.Range Int | |
| tests/test_for_loop.zion:2:11: std.True = ((1,) as! std.Bool) :: std.Bool | |
| tests/test_for_loop.zion:2:11: std.iter = (λri.let index = (std.Ref (std.__get_range_min ri)) in (return! (λ_.let cur_index = (std.load_value index) in (if (std.<= cur_index (std.__get_range_max ri)) then ({__builtin_store index (std.+ cur_index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module _ | |
| type Vec has { | |
| x float | |
| y float | |
| z float | |
| } | |
| fn main() { | |
| var positions [int: Vec] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module _ | |
| # test: pass | |
| # expect: pass with 5 | |
| # expect: pass with 6 | |
| def main() | |
| x := 5 | |
| foo := def (y int) | |
| print("pass with " + (x + y)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global | |
| type OwningBuffer C has | |
| let raw *C | |
| let length uint | |
| def __finalize__(owning_buffer OwningBuffer any) | |
| posix.free(owning_buffer.raw) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| from contextlib import contextmanager | |
| from Queue import Queue | |
| from threading import Thread | |
| class ThreadStop(Exception): | |
| pass | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:if (1) { | |
| var node = document.createElement('style'); | |
| node.innerHTML = "body { font-family: Georgia; width: 35em; line-height:1.5; margin-left: auto; margin-right: auto; } p { margin-top: 1em; }"; | |
| document.head.appendChild(node); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module tee | |
| get sys | |
| get file | |
| def main() | |
| if len(sys.args) == 2 | |
| newline := "\n" | |
| f := file.open(sys.args[1], "w") | |
| state := f.state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module _ | |
| def gimme_bool() bool | |
| return true | |
| def main() | |
| static_print(7) | |
| static_print("hello") | |
| static_print(gimme_bool()) | |
| static_print(gimme_bool() ? "foo" : 4.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Run this after your AMI comes online | |
| private_hostname=ip-$(curl http://169.254.169.254/latest/meta-data/local-ipv4 2>/dev/null | sed s/\\./-/g) | |
| sudo su - -c "grep $private_hostname /etc/hosts || echo 127.0.0.1 $private_hostname >> /etc/hosts" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module _ | |
| # test: pass | |
| type C{T} is | |
| Ax(T, int, float) or | |
| Bx(int, T, float) or | |
| Cx(int, float, T) | |
| def main() | |
| a_int := Ax(4, 5, 2.1) |