-
Notifications
You must be signed in to change notification settings - Fork 0
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
17 changed files
with
54 additions
and
89 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,11 +1,8 @@ | ||
(* | ||
module : cleave.joy | ||
version : 1.7 | ||
date : 03/21/24 | ||
version : 1.8 | ||
date : 04/15/24 | ||
*) | ||
DEFINE sum == 0.0 [+] fold; | ||
average == [dup sum] [size] cleave /. | ||
|
||
[1.0 2.0 3.0] average 2 =. | ||
[4.0 5.0 6.0] average 5 =. | ||
[7.0 8.0 9.0] average 8 =. |
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,9 +1,6 @@ | ||
(* | ||
module : fold.joy | ||
version : 1.5 | ||
date : 03/21/24 | ||
version : 1.6 | ||
date : 04/15/24 | ||
*) | ||
DEFINE | ||
sum == 0 [+] fold. | ||
|
||
[1 2 3] sum 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,7 +1,7 @@ | ||
(* | ||
module : fopen.joy | ||
version : 1.4 | ||
date : 03/21/24 | ||
version : 1.5 | ||
date : 04/15/24 | ||
*) | ||
"fopen.joy" "r" fopen dup put '\n putch file. | ||
"fopen.joy" "r" fopen dup putln file. | ||
"exist" "r" fopen. |
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,6 +1,6 @@ | ||
(* | ||
module : fseek.joy | ||
version : 1.5 | ||
date : 03/21/24 | ||
version : 1.6 | ||
date : 04/15/24 | ||
*) | ||
"fseek.joy" "r" fopen 7 0 fseek not put '\n putch fgets 6 take "module" =. | ||
"fseek.joy" "r" fopen 7 0 fseek not putln fgets 6 take "module" =. |
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,17 +1,8 @@ | ||
(* | ||
module : gc2.joy | ||
version : 1.8 | ||
date : 03/21/24 | ||
version : 1.9 | ||
date : 04/15/24 | ||
*) | ||
DEFINE | ||
from-to == (* lo hi agg *) | ||
[] cons [pop pop] swap concat | ||
[over over >] swap | ||
[ [dup succ] dip ] | ||
[cons] | ||
linrec; | ||
from-to-list == [] from-to. | ||
|
||
__memorymax | ||
1 300 from-to-list pop gc | ||
__memorymax <. |
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,15 +1,6 @@ | ||
(* | ||
module : linrec.joy | ||
version : 1.9 | ||
date : 03/21/24 | ||
version : 1.10 | ||
date : 04/15/24 | ||
*) | ||
DEFINE | ||
from-to == (* lo hi agg *) | ||
[] cons [pop pop] swap concat | ||
[over over >] swap | ||
[ [dup succ] dip ] | ||
[cons] | ||
linrec; | ||
from-to-list == [] from-to. | ||
|
||
1 10 from-to-list [1 2 3 4 5 6 7 8 9 10] equal. |
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,18 +1,17 @@ | ||
(* | ||
module : put.joy | ||
version : 1.4 | ||
date : 03/21/24 | ||
version : 1.5 | ||
date : 04/15/24 | ||
*) | ||
DEFINE last == dup rest null [first] [rest last] branch; | ||
nl == '\n putch. | ||
DEFINE last == dup rest null [first] [rest last] branch. | ||
|
||
[pop] first put nl. | ||
[last] first put nl. | ||
true put nl. | ||
'A put nl. | ||
10 put nl. | ||
{1 2 3} put nl. | ||
"test" put nl. | ||
[1 2 3] put nl. | ||
3.14 put nl. | ||
stdin put nl. | ||
[pop] first putln. | ||
[last] first putln. | ||
true putln. | ||
'A putln. | ||
10 putln. | ||
{1 2 3} putln. | ||
"test" putln. | ||
[1 2 3] putln. | ||
3.14 putln. | ||
stdin putln. |
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,6 +1,6 @@ | ||
(* | ||
module : putch.joy | ||
version : 1.4 | ||
date : 03/21/24 | ||
version : 1.5 | ||
date : 04/15/24 | ||
*) | ||
'A putch '\n putch. | ||
'A putch. |
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,6 +1,6 @@ | ||
(* | ||
module : stderr.joy | ||
version : 1.4 | ||
date : 03/21/24 | ||
version : 1.5 | ||
date : 04/15/24 | ||
*) | ||
stderr dup put '\n putch file. | ||
stderr dup putln file. |
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,6 +1,6 @@ | ||
(* | ||
module : stdout.joy | ||
version : 1.4 | ||
date : 03/21/24 | ||
version : 1.5 | ||
date : 04/15/24 | ||
*) | ||
stdout dup put '\n putch file. | ||
stdout dup putln file. |
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,9 +1,8 @@ | ||
(* | ||
module : while.joy | ||
version : 1.4 | ||
date : 03/21/24 | ||
version : 1.5 | ||
date : 04/15/24 | ||
*) | ||
DEFINE prime == 2 [[[dup * >] nullary [rem 0 >] dip and] nullary] [succ] | ||
while dup * <. | ||
"numlib" libload. | ||
|
||
19 prime. |