Skip to content

Commit d9f9304

Browse files
committed
Quine in Bon
1 parent 9fcc1a6 commit d9f9304

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ I have three policies:
1515
Languages
1616
---
1717

18-
Now, implemented in 262 programming languages!
18+
Now, implemented in 263 programming languages!
1919

2020
<details>
2121
<summary>Languages List</summary>
@@ -282,6 +282,7 @@ Now, implemented in 262 programming languages!
282282
- [Konoha](https://github.com/konoha-project/konoha3)
283283
- [Pyret](https://www.pyret.org)
284284
- [Phix](http://phix.x10.mx)
285+
- [Bon](https://github.com/FBMachine/bon)
285286

286287
</details>
287288

quine.bon

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cdef putchar(ch:int) -> int;
2+
3+
def loop(xs, ys)
4+
match xs
5+
[] => print("loop(" ++ list_to_string(ys) ++ ", [])")
6+
x :: xs => loop(xs, ys ++ [putchar(x)])
7+
end
8+
end
9+
10+
loop([99, 100, 101, 102, 32, 112, 117, 116, 99, 104, 97, 114, 40, 99, 104, 58, 105, 110, 116, 41, 32, 45, 62, 32, 105, 110, 116, 59, 10, 10, 100, 101, 102, 32, 108, 111, 111, 112, 40, 120, 115, 44, 32, 121, 115, 41, 10, 32, 32, 109, 97, 116, 99, 104, 32, 120, 115, 10, 32, 32, 32, 32, 91, 93, 32, 61, 62, 32, 112, 114, 105, 110, 116, 40, 34, 108, 111, 111, 112, 40, 34, 32, 43, 43, 32, 108, 105, 115, 116, 95, 116, 111, 95, 115, 116, 114, 105, 110, 103, 40, 121, 115, 41, 32, 43, 43, 32, 34, 44, 32, 91, 93, 41, 34, 41, 10, 32, 32, 32, 32, 120, 32, 58, 58, 32, 120, 115, 32, 61, 62, 32, 108, 111, 111, 112, 40, 120, 115, 44, 32, 121, 115, 32, 43, 43, 32, 91, 112, 117, 116, 99, 104, 97, 114, 40, 120, 41, 93, 41, 10, 32, 32, 101, 110, 100, 10, 101, 110, 100, 10, 10], [])

0 commit comments

Comments
 (0)