An open API service indexing awesome lists of open source software.

https://github.com/kenny2github/py-arrow-lang

An implementation of Arrow (https://github.com/jacob-g/arrow-lang) in Python.
https://github.com/kenny2github/py-arrow-lang

Last synced: about 1 year ago
JSON representation

An implementation of Arrow (https://github.com/jacob-g/arrow-lang) in Python.

Awesome Lists containing this project

README

          

py-arrow-lang
-------------

An implementation of `Arrow `_ in Python.

Running Arrow code
==================

.. code-block:: text

$ arrow --help

usage: arrow [-h] [file]

positional arguments:
file A file to run. Use - for stdin without prompt.

optional arguments:
-h, --help show this help message and exit

Example Arrow program
=====================

.. code-block:: text

function
/--> int factorial(int n)
| require not (n < 0)
| int return
| /--< n != 0
| | return = 1
| \-->
| /--< n == 0
| | return = n * factorial(n - 1)
| \-->
^ return

main
int n
print "Enter number:"
n = input int
print "Factorial of", n, "is", factorial(n)

Which outputs:

.. code-block:: text

Enter number:
5
Factorial of 5 is 120