From 5ca4d7acb5545050a731b0adc2e39b3ed65b7fc9 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 15 Apr 2017 13:40:17 +0200 Subject: Add README.md, example --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..83cb867 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# slang + +…a experimental Forth-like stack language implemented in D. + +## Example + + 1 i $ + § incr dup @ 1 + swp $ ; + § print @ . pop ; + § withinBounds @ 10 < ; + § loop i withinBounds if i print i incr loop then else ; + loop + +The above _slang_ code to be entered in the repl prints the numbers from 1 to 9. The repl may be compiled and executed using `dub run` in the project directory. -- cgit v1.2.3