-
Notifications
You must be signed in to change notification settings - Fork 116
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
r_ply repeats one too many times? #158
Comments
Doh. That's definitely a bug. |
is.function evaluates argument object as below
I came up this idea for checking the expression is function without evaluating it.
What do you think about this method? |
The
|
Thanks for your suggestion.
|
As crowding commented in #162,
|
The
Same for the other Tests can be added to verify the behavior for the three interesting cases ( |
How about this??
I know krlmlr's way would be good I think. But we have to decrease |
Here are some other "fun" test cases, along with the actual results from
I suspect there's not really a perfectly reliable way to solve the problem. |
@everpeace: If you insist on DRY, it's possible to write a function that returns a list of two components -- converted |
@everpeace @wch Right - I don't think it's possible to tell if something is a function without evaluating it, or righting something that is equivalent in complexity to the evaluator One option would be to add an argument that allows you to manually describe whether or not you're passing in a function or an expression, |
Especially the requirement to provide a consistent interface for all
The automatic solution is difficult to implement even for Perhaps the simplest thing would be just to require |
@krlmlr the main difference is that adding a parameter would not break any existing code, and being able to supply an expression to |
@hadley: Indeed, backward compatibility is at a premium for |
@hadley: I was surprised that you rejected my pull request #165 with the following comment:
I think that my solution shown in #165 solves the problem without breaking old code (short of making sure that exactly The implementation follows the "automatic solution" outline of my earlier comment. The expression is evaluated exactly
|
I'd expect this to replicate the expression once.
If this isn't a bug, could we change it for teaching purposes?
The text was updated successfully, but these errors were encountered: