Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for &rest parameters and apply as a built-in #301

Merged
merged 11 commits into from
Oct 1, 2024

Conversation

wwared
Copy link
Member

@wwared wwared commented Sep 13, 2024

This PR adds:

  • apply builtin: (apply f args) will call f passing the arguments from the args list. For example, (apply (lambda (x y) (+ x y)) (list 1 2))
  • Support for &rest parameters in function definitions, allowing for variadic functions. For example, (lambda (x &rest y) ...)

There is some unfortunate code duplication in apply, but this solution is better (in terms of columns and code complexity) for now. We might be able to simplify the duplication out in the future.

Manual update: argumentcomputer/user-manual#24

@wwared wwared force-pushed the rest-params branch 2 times, most recently from e489a45 to 6cf4d88 Compare October 1, 2024 15:10
@wwared wwared marked this pull request as ready for review October 1, 2024 17:16
Copy link
Member

@arthurpaulino arthurpaulino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@wwared wwared merged commit 1f76e56 into main Oct 1, 2024
3 checks passed
@wwared wwared deleted the rest-params branch October 1, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants