report arity errors in terms of the public API#100
Conversation
|
Does this fix #103 as well? |
| (procedure-rename | ||
| (λ (formal ... [message #f]) | ||
| (λ (#:location [location (list 'unknown #f #f #f #f)] | ||
| #:expression [expression 'unknown]) |
There was a problem hiding this comment.
Would it make sense to flip these two lambdas, making it more like:
(λ (#:location [location (list 'unknown #f #f #f #f)]
#:expression [expression 'unknown])
(procedure-rename
(λ (formal ... [message #f])
..stuff..)
'pub))
?
It would simplify the id case of the name macro below.
There was a problem hiding this comment.
I don't see how that would be simpler by itself. Wouldn't we just go from this:
((apply check-impl args) #:loc .... #:expr ....)
to this:
(apply (check-impl #:loc .... #:expr ....) args)
... maybe its best to remove #:location and #:expression and have define-check expand to code that updates current-check-info manually
There was a problem hiding this comment.
I mean the id case could be simplified from this:
#'(λ args
((apply check-impl args)
#:location (syntax->location #'loc)
#:expression 'chk))
To this:
#'(check-impl
#:location (syntax->location #'loc)
#:expression 'chk)
(λ args ((apply check-impl args) #:loc .... #:expr ....))initially.(λ args (apply (check-impl #:loc .... #:expr ....) args))after flipping the lambdas.(check-impl #:loc .... #:expr ....)after eta-reducing further.
There was a problem hiding this comment.
It also has the benefit of (procedure-arity check-equal?) returning (list 2 3) instead of (arity-at-least 0).
|
yes this fixes #103 |
|
I'm planning to merge this tomorrow night |
|
To me, this looks good now. |
|
wow, great timing! |
change the internal procedures for `check-true` and others, so that: - their arity matches the documentation - their `object-name` names match the documentation
Fix for #99
Now this program:
Errors with:
This still needs a regression test. (EDIT: added a test)
But also, I'm not happy adding an extra
lambdato get the keyword arguments. Suggestions welcome.