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
Should is_list return TRUE for pairlists? #155
Comments
It really shouldn't because those are very different data structures.
You can use |
of course most of the time this doesn't matter ;) |
Cools, I was doing |
just out of curiosity, why are you using |
Heh. One of the things that I tell people is nice about R compared to SAS, is that you don't have to program via macros. No need for ampersands, percents and dots cluttering up your code. So it's ironic to see this design coming back into R. |
That's not a macro, it's evaluated at run time and works on runtime values.That's more like an syntactic operator, and R has many of them. If you don't want syntax, lisp is a better choice than R. But even lisp has syntax for unquoting and splicing, because it's normally much easier to reason about these operations syntactically. |
On the other hand I agree that the behaviour of |
This is about the syntax. Here's an example SAS macro (https://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_91/base_macro_6997.pdf)
Notice the proliferation of punctuation. I'm not a fan of introducing more punctuation into R, especially if you have to override the regular parser to do it. That said, I do think this new paradigm is much easier to work with than the previous dplyr method of |
In general I agree with you, but in the case of quasiquotation the semantics are so peculiar that it deserves special syntax to help reason about code. I think the fact that even lisps have syntax for quasiquotation is telling that it's the right way. Of course it's also a matter of taste, so we provided the functional form as well. |
@lionel- does the "Details" of |
oops I think we didn't update the documentation of tidy dots for the 0.2.0 release. @hadley probably worth to include this in the release? |
Yes please |
Because if it doesn't, you can't splice them. This makes it difficult to build lists of expressions for feeding to
invoke
and/ordo.call
.For example:
The text was updated successfully, but these errors were encountered: