search for: unquote

Displaying 20 results from an estimated 250 matches for "unquote".

Did you mean: unquoted
2010 May 07
0
A fix that for 'bquote' that may work (PR#14031)
...hz.ch, R-bugs at r-project.org > Date: Friday, 6 November, 2009, 11:42 PM > On Thu, 5 Nov 2009, suharto_anggono at yahoo.com > wrote: > > > This is a fix for 'bquote' that may work. > > > > function (expr, where =3D parent.frame())=20 > > { > >? ? unquote <- function(e) { > >? ? ? ? if (length(e) <=3D 1 || > !is.language(e))=20 > >? ? ? ? ? ? e > >? ? ? ? else if (e[[1]] =3D=3D > as.name("."))=20 > >? ? ? ? ? ? eval(e[[2]], > where) > >? ? ? ? else as.call(lapply(e, > unquote)) > >? ? }...
2006 Aug 20
3
unquoting
...his: > A <- matrix(1:6, nrow = 2, ncol=3) > AF <- as.data.frame(A) > names(AF) <- c("First","Second","Third") > AF First Second Third 1 1 3 5 2 2 4 6 > names(AF)[2] [1] "Second" > attach(AF) > unquote(names(AF)[2]) [1] 3 4 Of course what I actually get is Error: couldn't find function "unquote" The reason that I want to do this is that I have a frame with a rather large number of variables and I would like to loop over the names and print out various descriptive summaries of t...
2017 Oct 16
3
[PATCH v2 0/2] daemon: add and use split_key_value_strings helper
Changes from v1 to v2: - split the "simple unquoting" as helper - pass the unquoting function to split_key_value_strings - use right unquoting function when applying split_key_value_strings Pino Toscano (2): daemon: add split_key_value_strings helper daemon: use split_key_value_strings daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++---------------------------- daemon/md.ml
2020 Mar 17
3
new bquote feature splice does not address a common LISP @ use case?
Dear R-devel, There is a new feature in R-devel, which explicitly refers to LISP @ operator for splicing. > The backquote function bquote() has a new argument splice to enable splicing a computed list of values into an expression, like ,@ in LISP's backquote. Although the most upvoted SO question asking for exactly LISP's @ functionality in R doesn't seems to be addressed by this
2017 Oct 16
3
[PATCH v3 0/2] daemon: add and use parse_key_value_strings helper
Changes from v2 to v3: - split_key_value_strings renamed to parse_key_value_strings Changes from v1 to v2: - split the "simple unquoting" as helper - pass the unquoting function to split_key_value_strings - use right unquoting function when applying split_key_value_strings Pino Toscano (2): daemon: add split_key_value_strings helper daemon: use parse_key_value_strings
2017 Oct 16
2
Re: [PATCH v2 1/2] daemon: add split_key_value_strings helper
On Mon, Oct 16, 2017 at 05:58:10PM +0200, Pino Toscano wrote: > Add a simple helper to turn a list of strings into key/value pairs, > splitting by '=', with the possibility to apply a function to unquote > values. > > Add also a simple unquote function. > --- > daemon/utils.ml | 16 ++++++++++++++++ > daemon/utils.mli | 11 +++++++++++ > 2 files changed, 27 insertions(+) > > diff --git a/daemon/utils.ml b/daemon/utils.ml > index d87ad75db..865936280 100644 > ---...
2009 Oct 29
0
In the result of applying 'bquote' to function definition with 2 or more arguments, first function argument disappears (PR#14031)
...ted differently. They are printed identically when useSource=FALSE. The first argument disappears, error when 'eval'-ed. But, apparently, if the function has one or zero argument, applying 'bquote' results fine. I try to debug. In the definition of 'bquote', there is 'unquote' function. > bquote function (expr, where = parent.frame()) { unquote <- function(e) { if (length(e) <= 1) e else if (e[[1]] == as.name(".")) eval(e[[2]], where) else as.call(lapply(e, unquote)) } unquote(substitut...
2017 Mar 17
2
RFC: (in-principle) native unquoting for standard evaluation
...e breaks this however. * itself would have been a nice operator for this were it not prone to ambiguity (`a * *b` vs `a**b`, from which @ does not suffer). Would this extension require that function authors explicitly enable auto-quoting support? I somewhat envisioned functions seeing the resolved unquoted object (within their calling scope) so that they could retain their standard defintions when not using @. In my mutate example, mutate itself could simply be the NSE version, so mutate(mtcars, z = mpg) would work as normal, but x = "mpg" mutate(mtcars, z = @x) would produ...
2017 Mar 17
4
RFC: (in-principle) native unquoting for standard evaluation
...be extremely useful. Several alternatives have been incorporated into packages (most recently work on tidyeval) none of which appear to fully match the simplicity of the above, and some of which cut a forceful path through the syntax tree. The exact syntax isn't my concern at the moment (@ vs unquote() or other, though the first requires user-supplied native prefix support within the language, as per [1]) and neither is the exact way in which this would be achieved (well above my pay grade). The practicality of @ being on the LHS of `=` is also of a lesser concern (likely greater complexity) th...
2017 Oct 16
0
[PATCH v2 1/2] daemon: add split_key_value_strings helper
Add a simple helper to turn a list of strings into key/value pairs, splitting by '=', with the possibility to apply a function to unquote values. Add also a simple unquote function. --- daemon/utils.ml | 16 ++++++++++++++++ daemon/utils.mli | 11 +++++++++++ 2 files changed, 27 insertions(+) diff --git a/daemon/utils.ml b/daemon/utils.ml index d87ad75db..865936280 100644 --- a/daemon/utils.ml +++ b/daemon/utils.ml @@ -229,3 +229...
2020 Mar 17
0
new bquote feature splice does not address a common LISP @ use case?
Hi Jan, In the lisp code you provide the operators are parsed as simple symbols in a pairlist. In the R snippet, they are parsed as left-associative binary operators of equal precedence. If you unquote a call in the right-hand side, you're artificially bypassing the left-associativity of these operators. To achieve what you're looking for in a general way, you'll need a more precise definition of the problem, and a solution that probably involves rotating the AST accordingly (see htt...
2017 Mar 19
0
RFC: (in-principle) native unquoting for standard evaluation
..., expanding calls like that is somewhat orthogonal >> to NSE. It would be nice in general to be able to write something like >> mean(x, extra_args...) without resorting to do.call(mean, c(list(x), >> extra_args)). If we had that then uqs() would just be the combination >> of unquote and expansion, i.e., mean(x, @extra_args...). The "..." >> postfix would not work since it's still a valid symbol name, but we >> could come up with something. > > > I've been trying to follow this proposal, though without tracking down > all the tweets, et...
2017 Mar 17
2
Support for user defined unary functions
Your example x = 5 exp = parse(text="f(uq(x)) + y +z") # expression: f(uq(x)) +y + z do_unquote(expr) # -> the language object f(5) + y + z could be done with the following wrapper for bquote my_do_unquote <- function(language, envir = parent.frame()) { if (is.expression(language)) { # bquote does not go into expressions, only calls as.expression(lapply(la...
2017 Mar 17
2
Support for user defined unary functions
>After off list discussions with Jonathan Carrol and with >Michael Lawrence I think it's doable, unambiguous, >and even imo pretty intuitive for an "unquote" operator. For those of us who are not CS/Lisp mavens, what is an "unquote" operator? Can you expression quoting and unquoting in R syntax and show a few examples where is is useful, intuitive, and fits in to R's functional design? In particular, what does it give us that the...
2017 Mar 19
3
RFC: (in-principle) native unquoting for standard evaluation
...ves have been incorporated into packages (most recently work > > on tidyeval) none of which appear to fully match the simplicity of the > > above, and some of which cut a forceful path through the syntax tree. > > > > The exact syntax isn't my concern at the moment (@ vs unquote() or other, > > though the first requires user-supplied native prefix support within the > > language, as per [1]) and neither is the exact way in which this would be > > achieved (well above my pay grade). The practicality of @ being on the > LHS > > of `=` is also of a...
2007 May 15
5
Trying to make tidy{} work
...assessment": age => "1w", backup => false, type => mtime, } ? It doesn''t appear to. Am I missing ''recurse => true''? What''s the syntax & quoting for ''age''? quoted, no space : "1w" unquoted, no space : 1w quoted, with space : "1 w" unquoted, with space: 1 w Can I wildcard the files to tidy? Note that the nice people who made Tomcat/Struts/whatever hide a "tldCache.ser" file in with all the stale "strts####.tmp" files and it''d be nic...
2010 Nov 03
2
How to unquote string in R
...t; table = rbind(s,a) write.table(table,paste("blah",".PROPERTIES",sep = ""),row.names = FALSE,col.names = FALSE) In my table, how do I output only the words and not the words with the quotations? -- View this message in context: http://r.789695.n4.nabble.com/How-to-unquote-string-in-R-tp3025654p3025654.html Sent from the R help mailing list archive at Nabble.com.
2017 Mar 19
0
RFC: (in-principle) native unquoting for standard evaluation
...y_ evaluation). For the uqs() thing, expanding calls like that is somewhat orthogonal to NSE. It would be nice in general to be able to write something like mean(x, extra_args...) without resorting to do.call(mean, c(list(x), extra_args)). If we had that then uqs() would just be the combination of unquote and expansion, i.e., mean(x, @extra_args...). The "..." postfix would not work since it's still a valid symbol name, but we could come up with something. Michael On Sat, Mar 18, 2017 at 7:39 PM, Hadley Wickham <h.wickham at gmail.com> wrote: > Would this return a quosure?...
2017 Mar 17
0
RFC: (in-principle) native unquoting for standard evaluation
...veral > alternatives have been incorporated into packages (most recently work > on tidyeval) none of which appear to fully match the simplicity of the > above, and some of which cut a forceful path through the syntax tree. > > The exact syntax isn't my concern at the moment (@ vs unquote() or other, > though the first requires user-supplied native prefix support within the > language, as per [1]) and neither is the exact way in which this would be > achieved (well above my pay grade). The practicality of @ being on the LHS > of `=` is also of a lesser concern (likely gr...
2017 Mar 19
3
RFC: (in-principle) native unquoting for standard evaluation
...the uqs() thing, expanding calls like that is somewhat orthogonal > to NSE. It would be nice in general to be able to write something like > mean(x, extra_args...) without resorting to do.call(mean, c(list(x), > extra_args)). If we had that then uqs() would just be the combination > of unquote and expansion, i.e., mean(x, @extra_args...). The "..." > postfix would not work since it's still a valid symbol name, but we > could come up with something. I've been trying to follow this proposal, though without tracking down all the tweets, etc. that are referenced. I...