--- /dev/null
+print('false and false: ')
+print(false and false)
+print('\n')
+print('false and true: ')
+print(false and true)
+print('\n')
+print('true and false: ')
+print(true and false)
+print('\n')
+print('true and true: ')
+print(true and true)
+print('\n')
+print('false or false: ')
+print(false or false)
+print('\n')
+print('false or true: ')
+print(false or true)
+print('\n')
+print('true or false: ')
+print(true or false)
+print('\n')
+print('true or true: ')
+print(true or true)
--- /dev/null
+false and false: false
+false and true: false
+true and false: false
+true and true: true
+false or false: false
+false or true: true
+true or false: true
+true or true: true
\ No newline at end of file
+++ /dev/null
-print('1 < 2 < 2: ')
-print(1 < 2 < 2)
-print('\n')
-print('2 < 2 < 2: ')
-print(2 < 2 < 2)
-print('\n')
-print('1 < 2 < 3: ')
-print(1 < 2 < 3)
-print('\n')
-print('2 < 2 < 3: ')
-print(2 < 2 < 3)
+++ /dev/null
-1 < 2 < 2: false
-2 < 2 < 2: false
-1 < 2 < 3: true
-2 < 2 < 3: false
\ No newline at end of file
+++ /dev/null
-print('false and false: ')
-print(false and false)
-print('\n')
-print('false and true: ')
-print(false and true)
-print('\n')
-print('true and false: ')
-print(true and false)
-print('\n')
-print('true and true: ')
-print(true and true)
-print('\n')
-print('false or false: ')
-print(false or false)
-print('\n')
-print('false or true: ')
-print(false or true)
-print('\n')
-print('true or false: ')
-print(true or false)
-print('\n')
-print('true or true: ')
-print(true or true)
+++ /dev/null
-false and false: false
-false and true: false
-true and false: false
-true and true: true
-false or false: false
-false or true: true
-true or false: true
-true or true: true
\ No newline at end of file
--- /dev/null
+print('Hello, world\n')
+print(42, '\n')
--- /dev/null
+Hello, world
+42
--- /dev/null
+def get_answer() do
+ 42
+end
+
+print(get_answer())
--- /dev/null
+42
\ No newline at end of file
+++ /dev/null
-print('Hello, world\n')
-print(42, '\n')
+++ /dev/null
-Hello, world
-42
+++ /dev/null
-def get_answer() do
- 42
-end
-
-print(get_answer())
+++ /dev/null
-42
\ No newline at end of file
--- /dev/null
+def return_zero() do
+ print('This should not print\n')
+ 2
+end
+
+def return_one() do
+ print('This should only print once.\n')
+ 1
+end
+
+def return_true() do
+ print('This should print exactly twice.\n')
+ true
+end
+
+def return_false() do
+ print('This should print exactly twice.\n')
+ false
+end
+
+0 < return_one() < 2
+0 < 0 < return_zero()
+return_true() or return_true()
+return_false() and return_false()
--- /dev/null
+This should only print once.
+This should print exactly twice.
+This should print exactly twice.
--- /dev/null
+# Furface is a great cat
+print('Hello, world\n')
--- /dev/null
+Hello, world
+++ /dev/null
-def return_zero() do
- print('This should not print\n')
- 2
-end
-
-def return_one() do
- print('This should only print once.\n')
- 1
-end
-
-def return_true() do
- print('This should print exactly twice.\n')
- true
-end
-
-def return_false() do
- print('This should print exactly twice.\n')
- false
-end
-
-0 < return_one() < 2
-0 < 0 < return_zero()
-return_true() or return_true()
-return_false() and return_false()
+++ /dev/null
-This should only print once.
-This should print exactly twice.
-This should print exactly twice.
--- /dev/null
+def outer() do
+ hi = 'Hello, world\n'
+
+ def inner() do
+ hi
+ end
+
+ inner
+end
+
+get_greeting = outer()
+
+print(get_greeting())
+
+
--- /dev/null
+Hello, world
+++ /dev/null
-# Furface is a great cat
-print('Hello, world\n')
+++ /dev/null
-Hello, world
+++ /dev/null
-def outer() do
- hi = 'Hello, world\n'
-
- def inner() do
- hi
- end
-
- inner
-end
-
-get_greeting = outer()
-
-print(get_greeting())
-
-
+++ /dev/null
-Hello, world
--- /dev/null
+# Environment A is created here
+
+# outer references environment A
+def outer() do
+ # Environment B is created here referencing A
+
+ # middle references environment B
+ def middle() do
+ # Environment C is created here referencing B
+
+ # inner references environment C
+ def inner() do
+ # This is never executed
+ 42
+ end
+
+ inner
+ # At this point, environment C falls out of scope
+ # However, environment C is still referenced by inner, which is being returned
+ end
+
+ variable = middle()
+ # Now environment B -> variable -> inner -> C -> B
+
+ 42
+ # Nothing from the cycle is returned and B falls out of scope
+ # All references are lost, but reference counts are still > 0 because of the cycle
+end
+
+print(outer())
--- /dev/null
+42
\ No newline at end of file
--- /dev/null
+def increment(n) do
+ n + 1
+end
+
+def add(a, b) do
+ a + b
+end
+
+print(increment(41), '\n')
+print(add(40, 2), '\n')
+++ /dev/null
-# Environment A is created here
-
-# outer references environment A
-def outer() do
- # Environment B is created here referencing A
-
- # middle references environment B
- def middle() do
- # Environment C is created here referencing B
-
- # inner references environment C
- def inner() do
- # This is never executed
- 42
- end
-
- inner
- # At this point, environment C falls out of scope
- # However, environment C is still referenced by inner, which is being returned
- end
-
- variable = middle()
- # Now environment B -> variable -> inner -> C -> B
-
- 42
- # Nothing from the cycle is returned and B falls out of scope
- # All references are lost, but reference counts are still > 0 because of the cycle
-end
-
-print(outer())
+++ /dev/null
-42
\ No newline at end of file
+++ /dev/null
-def increment(n) do
- n + 1
-end
-
-def add(a, b) do
- a + b
-end
-
-print(increment(41), '\n')
-print(add(40, 2), '\n')
--- /dev/null
+def make_incrementer(increment_amount) do
+ def result(i) do
+ increment_amount + i
+ end
+
+ result
+end
+
+increment_by_one = make_incrementer(1)
+increment_by_two = make_incrementer(2)
+
+print(increment_by_one(41), '\n')
+print(increment_by_two(40), '\n')
+++ /dev/null
-def make_incrementer(increment_amount) do
- def result(i) do
- increment_amount + i
- end
-
- result
-end
-
-increment_by_one = make_incrementer(1)
-increment_by_two = make_incrementer(2)
-
-print(increment_by_one(41), '\n')
-print(increment_by_two(40), '\n')
--- /dev/null
+def make_incrementer(increment_amount) do
+ def result(i) do
+ increment_amount + i
+ end
+
+ result
+end
+
+print((make_incrementer(1))(41), '\n')
+print((make_incrementer(2))(40), '\n')
--- /dev/null
+def make_incrementer(increment_amount) do
+ def result(i) do
+ increment_amount + i
+ end
+
+ result
+end
+
+print(make_incrementer(1)(41), '\n')
+print(make_incrementer(2)(40), '\n')
+++ /dev/null
-def make_incrementer(increment_amount) do
- def result(i) do
- increment_amount + i
- end
-
- result
-end
-
-print((make_incrementer(1))(41), '\n')
-print((make_incrementer(2))(40), '\n')
+++ /dev/null
-def make_incrementer(increment_amount) do
- def result(i) do
- increment_amount + i
- end
-
- result
-end
-
-print(make_incrementer(1)(41), '\n')
-print(make_incrementer(2)(40), '\n')
--- /dev/null
+first_greeting = if true do
+ 'Hello, world'
+else
+ 'Goodnight, moon'
+end
+
+second_greeting = if false do
+ 'Hello, world'
+else
+ 'Goodnight, moon'
+end
+
+print(first_greeting, '\n')
+print(second_greeting, '\n')
--- /dev/null
+Hello, world
+Goodnight, moon
+++ /dev/null
-first_greeting = if true do
- 'Hello, world'
-else
- 'Goodnight, moon'
-end
-
-second_greeting = if false do
- 'Hello, world'
-else
- 'Goodnight, moon'
-end
-
-print(first_greeting, '\n')
-print(second_greeting, '\n')
+++ /dev/null
-Hello, world
-Goodnight, moon
--- /dev/null
+greetings = [
+ 'Hello, world',
+ 'Goodnight, moon',
+]
+
+print(greetings[0], '\n')
+print(greetings[1], '\n')
--- /dev/null
+Hello, world
+Goodnight, moon
+++ /dev/null
-greetings = [
- 'Hello, world',
- 'Goodnight, moon',
-]
-
-print(greetings[0], '\n')
-print(greetings[1], '\n')
+++ /dev/null
-Hello, world
-Goodnight, moon
--- /dev/null
+print('Hello' ++ ', ' ++ 'world' ++ '\n')
--- /dev/null
+Hello, world
--- /dev/null
+print("Don't stop me now\n")
+print('"Cogito ergo sum." --Descartes\n')
--- /dev/null
+Don't stop me now
+"Cogito ergo sum." --Descartes
+++ /dev/null
-print('Hello' ++ ', ' ++ 'world' ++ '\n')
+++ /dev/null
-Hello, world
+++ /dev/null
-print("Don't stop me now\n")
-print('"Cogito ergo sum." --Descartes\n')
+++ /dev/null
-Don't stop me now
-"Cogito ergo sum." --Descartes
--- /dev/null
+expressions = (
+ greeting: 'Hello',
+ farewell: 'Goodbye',
+)
+
+print(expressions.greeting, '\n')
+print(expressions.farewell, '\n')
--- /dev/null
+Hello
+Goodbye
--- /dev/null
+def get_divided_answer() do
+ 42 // 0
+end
+
+print(get_divided_answer())
--- /dev/null
+DivisionByZeroError on line 2
+ in get_divided_answer
+ in __main__
+++ /dev/null
-expressions = (
- greeting: 'Hello',
- farewell: 'Goodbye',
-)
-
-print(expressions.greeting, '\n')
-print(expressions.farewell, '\n')
+++ /dev/null
-Hello
-Goodbye
+++ /dev/null
-def get_divided_answer() do
- 42 // 0
-end
-
-print(get_divided_answer())
+++ /dev/null
-DivisionByZeroError on line 2
- in get_divided_answer
- in __main__