-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get rid of the inelegant variadic flag. Introduce a function calling convention where a symbol enveloped in a list means apply should set it to the list of remaining arguments. This implements the rest argument idiom found in many languages out there including other lisps. Update existing tests to match. Add new tests for the new idiom.
- Loading branch information
1 parent
674f9c3
commit f89692e
Showing
18 changed files
with
94 additions
and
50 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
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
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
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
(import (lone lambda set print)) | ||
|
||
(set variadic (lambda ((arguments)) (print arguments))) | ||
|
||
(variadic) | ||
(variadic 1) | ||
(variadic 1 2) | ||
(variadic 1 2 3) | ||
(variadic 1 2 3 4) | ||
(variadic 1 2 3 4 5) | ||
(variadic 1 2 3 4 5 6) |
File renamed without changes.
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,13 @@ | ||
(import (lone lambda set print)) | ||
|
||
(set variadic | ||
(lambda (x (arguments)) | ||
(print x) | ||
(print arguments))) | ||
|
||
(variadic 1) | ||
(variadic 1 2) | ||
(variadic 1 2 3) | ||
(variadic 1 2 3 4) | ||
(variadic 1 2 3 4 5) | ||
(variadic 1 2 3 4 5 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
1 | ||
nil | ||
1 | ||
(2) | ||
1 | ||
(2 3) | ||
1 | ||
(2 3 4) | ||
1 | ||
(2 3 4 5) | ||
1 | ||
(2 3 4 5 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(import (lone lambda set print)) | ||
|
||
(set variadic | ||
(lambda (x y (arguments)) | ||
(print x) | ||
(print y) | ||
(print arguments))) | ||
|
||
(variadic 1 2) | ||
(variadic 1 2 3) | ||
(variadic 1 2 3 4) | ||
(variadic 1 2 3 4 5) | ||
(variadic 1 2 3 4 5 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
1 | ||
2 | ||
nil | ||
1 | ||
2 | ||
(3) | ||
1 | ||
2 | ||
(3 4) | ||
1 | ||
2 | ||
(3 4 5) | ||
1 | ||
2 | ||
(3 4 5 6) |