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

Simplify function definitions #3689

Conversation

jackfirth
Copy link
Sponsor Contributor

This is an automated change generated by resyntax.

This change simplifies function definitions using shortcuts for define forms whose right-hand-side is either a lambda expression or a case-lambda expression equivalent to a function with a default argument.

This is an automated change generated by [`resyntax`](https://github.com/jackfirth/resyntax).

This change simplifies function definitions using shortcuts for `define` forms whose right-hand-side is either a lambda expression or a `case-lambda` expression equivalent to a function with a default argument.
Copy link
Sponsor Member

@samth samth left a comment

Choose a reason for hiding this comment

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

This broadly looks good to me but it changes a lot of code so I'm not sure who the right person to review it is.

(cons (format " ~e"
(car args))
(loop (cdr args)))))))))))
(define (((make-not-available id)) . args)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

This might be less clear in the new version -- maybe 0-argument functions should be a special case?

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

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

I think that makes sense. Opened jackfirth/resyntax#61 for this.

@jackfirth
Copy link
Sponsor Contributor Author

I could split it up into separate pull requests, would that be easier?

@rfindler
Copy link
Member

I looked through all of the contract files and the changes seem good to me. I didn't check that the test suites still pass (although it seems very likely they would). If someone has it installed, running racket -l tests/racket/contract/all runs them.

@samth
Copy link
Sponsor Member

samth commented Feb 17, 2021

The contract tests run in the CI so we can see that they pass.

@jackfirth
Copy link
Sponsor Contributor Author

Closing this pull request for a few reasons:

  1. It's too large. I think these kinds of pull requests should probably be in the range of a couple hundred lines instead, at least while Resyntax is still in such an experimental state.
  2. I'd like to fix Function definition suggestions less than helpful for zero-argument curried functions jackfirth/resyntax#61 first.
  3. It's been a while and now there's merge conflicts.

@jackfirth jackfirth closed this Apr 15, 2021
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.

None yet

3 participants