-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
640 additions
and
172 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
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
Binary file not shown.
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,2 +1,7 @@ | ||
val c = Buffer() | ||
c.get() | Rtimer(3000) >> c.put(3) >> stop | ||
|
||
{- | ||
OUTPUT: | ||
3 | ||
-} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,13 @@ def downfrom(n) = | |
then 0 | ||
else (n | downfrom(n-1)) | ||
|
||
downfrom(5) | ||
downfrom(5) | ||
{- | ||
OUTPUT: | ||
5 | ||
4 | ||
3 | ||
2 | ||
1 | ||
0 | ||
-} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,10 @@ a.set(1, 1) >> | |
a.set(2, 2) >> | ||
a.set(3, 3) >> | ||
a.slice(1,4) >b> | ||
each(b) | ||
each(b) | ||
{- | ||
OUTPUT: | ||
1 | ||
2 | ||
3 | ||
-} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'Twas brillig, and the slithy toves | ||
Did gyre and gimble in the wabe; | ||
All mimsy were the borogoves, | ||
And the mome raths outgrabe. |
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,2 +1,7 @@ | ||
println(cat(Null())) >> stop | ||
| Null() | ||
| Null() | ||
{- | ||
OUTPUT: | ||
null | ||
null | ||
-} |
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
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,5 +1,10 @@ | ||
-- Using '!' to publish matching results as they match. | ||
-- Note: '!' will only release these publications if the whole pattern succeeds. | ||
-- Output: 2 and true and (2,2) | ||
|
||
{- | ||
OUTPUT: | ||
true | ||
2 | ||
(2, 2) | ||
-} | ||
( (1,2,true) | (2,5,true) ) >(1,!x,!true)> (x,x) |
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,4 +1,8 @@ | ||
-- Filter using literal match, push | ||
-- Output: 4 and 6 | ||
{- | ||
OUTPUT: | ||
4 | ||
6 | ||
-} | ||
( (1,4) | (2,5) | (1,6) ) >(1,x)> x | ||
|
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,4 +1,7 @@ | ||
-- Filter using literal match, pull | ||
-- Output: Either 4 or 6 | ||
x <(1,x)< ( (1,4) | (2,5) | (1,6) ) | ||
{- | ||
OUTPUT: | ||
4 | ||
-} | ||
x <(1,x)< ( (1,4) | (2,5) | (1,6) ) | ||
|
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,4 +1,8 @@ | ||
-- Filter using size match, push | ||
-- Output: (6,5) and (2,1) | ||
{- | ||
OUTPUT: | ||
(2, 1) | ||
(6, 5) | ||
-} | ||
( (1,2) | (1,2,3) | (5,6) | (5,6,7) ) >(x,y)> (y,x) | ||
|
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,4 +1,7 @@ | ||
-- Filtration based on list structure | ||
-- Output: (1,2,[3]) and (4,5,[]) | ||
|
||
{- | ||
OUTPUT: | ||
(4, 5, []) | ||
(1, 2, [3]) | ||
-} | ||
( [1,2,3] | [4,5] | [6] | [] ) >a:b:c> (a,b,c) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
-- Pattern matching on a list | ||
-- Output: ([4],3,2,1) | ||
{- | ||
OUTPUT: | ||
([4], 3, 2, 1) | ||
-} | ||
[1,2,3,4] >a:t> t >b:c:u> (u,c,b,a) |
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,4 +1,7 @@ | ||
-- Using 'as' to capture sub-patterns | ||
-- Output: (1,2,3,(2,3)) and (4,5,6,(5,6)) | ||
|
||
( (1,(2,3)) | (4,(5,6)) | (7,8,9) ) >(a,(b,c) as d)> (a,b,c,d) | ||
{- | ||
OUTPUT: | ||
(1, 2, 3, (2, 3)) | ||
(4, 5, 6, (5, 6)) | ||
-} | ||
( (1,(2,3)) | (4,(5,6)) ) >(a,(b,c) as d)> (a,b,c,d) |
Oops, something went wrong.