-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add basic support for iterators and lists * Added pretty functions and get_type_name function * Added printing of elements of lists
- Loading branch information
1 parent
0c29d76
commit 3c19651
Showing
4 changed files
with
104 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
# a jungle of random tests | ||
f = (x, [y, z]) => [&x..10, y..z] | ||
a = f(0, [0, 10]) | ||
[b, c] = a | ||
|
||
# functions | ||
# :> f | ||
|
||
# testing compound assignment operators | ||
a = 3 | ||
a += 2 | ||
a /= 5 | ||
# tuples | ||
# :> [1 > 0, [1, 0.0], f, b, c] | ||
|
||
b = 2.5 | ||
b *= 4.0 | ||
b -= a.5 # conversion | ||
# iterators | ||
# :> c :: i => [i, i.0, f, f(i-5, [0, 2])] | ||
|
||
f = () => ~b # conversion | ||
|
||
c = [1.0, 2, [3.0, 4]] # tuples | ||
|
||
[d, _, e] = c # tuple decomposition | ||
|
||
g = (-2)..2 # ranges | ||
|
||
# printing various types, float precision | ||
:> [b, 1 > 0, !(5 == ~5.0), [1.0, 2, [3.0, 4]], 1.0 / 3.0, f(), f, [f], g[1]] | ||
# lists | ||
:> b |
This file contains 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
This file contains 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
This file contains 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