search for: syntactic

Displaying 20 results from an estimated 1183 matches for "syntactic".

2011 Jun 30
2
Syntactically valid names
Hi all, Is there any easy way to tell if a string is a syntactically valid name? e.g. is.syntactic("X123") # TRUE is.syntactic("[[") # FALSE One implementation would be: is.syntactic <- function(x) x == make.names(x) but I wonder if there's a more elegant way. Thanks! Hadley -- Assistant Professor / Dobelman Family Junior Chai...
2017 Sep 03
0
[FORGED] Re: Block comment?
...bugging code, just >> call options(DEBUG_ISSUE_XYX=TRUE)). > > > (a) The foregoing is getting too subtle for my feeble brain. > > (b) A fundamental problem with the > > if(FALSE) { > ... > } > > paradigm is that the enclosed code must be syntactically valid, and > there are certainly situations in which one might wish to comment out > sections of code that are *not* syntactically valid. E.g. one might > wish to comment out *part* of a piece of syntactically valid code for > the purpose of experimenting with an alternative approa...
2017 Sep 03
2
[FORGED] Re: Block comment?
...s(DEBUG_ISSUE_XYX=TRUE)). >> >> >> (a) The foregoing is getting too subtle for my feeble brain. >> >> (b) A fundamental problem with the >> >> if(FALSE) { >> ... >> } >> >> paradigm is that the enclosed code must be syntactically valid, and >> there are certainly situations in which one might wish to comment out >> sections of code that are *not* syntactically valid. E.g. one might >> wish to comment out *part* of a piece of syntactically valid code for >> the purpose of experimenting with an al...
2017 Mar 23
0
[Bug 1137] New: Element "flow tables" should not be syntactically unique...
https://bugzilla.netfilter.org/show_bug.cgi?id=1137 Bug ID: 1137 Summary: Element "flow tables" should not be syntactically unique... Product: nftables Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 Component: kernel Assignee: pablo at netfilter.org...
2008 Jan 19
5
"should_not ==" vs "should !="
describe "should_not == vs. should !=" it do 5.should_not == 6 end # passes it do 5.should != 6 end # fails end # I''m running the rspec 1.1.2 gem with the corresponding Textmate bundle # The second failure surprises me. # Is != not supported? # I''d like to hear what you all think. -------------- next part -------------- An HTML attachment was
2004 May 09
0
[LLVMdev] Testing LLVM on OS X
...> On Tue, 4 May 2004, Chris Lattner wrote: > > I suspect that a large reason that LLVM does worst than a native C > > compiler with the CBE+GCC is that LLVM generates very low-level C code, > > and I'm not convinced that GCC is doing a very good job (ie, without > > syntactic loops). > > Yup, this is EXACTLY what is going on. > > I took this very simple C function: > > int Array[1000]; > void test(int X) { > int i; > for (i = 0; i < 1000; ++i) > Array[i] += X; > } > > Compile with -O3 on OS/X gave me this: > > _tes...
2017 Sep 02
2
[FORGED] Re: Block comment?
...ou > would not even have to change code to re-enable the debugging code, just > call options(DEBUG_ISSUE_XYX=TRUE)). (a) The foregoing is getting too subtle for my feeble brain. (b) A fundamental problem with the if(FALSE) { ... } paradigm is that the enclosed code must be syntactically valid, and there are certainly situations in which one might wish to comment out sections of code that are *not* syntactically valid. E.g. one might wish to comment out *part* of a piece of syntactically valid code for the purpose of experimenting with an alternative approach. cheers, Ro...
2023 Mar 01
1
tab-complete for non-syntactic names could attempt backtick-wrapping
...) The auto-complete mechanism will fill the buffer like so: x$a b This is not particularly helpful because this is now a syntax error. It seems to me there's a simple fix -- in utils:::specialCompletions(), we can wrap the result of utils:::specialOpCompletionsHelper() with backticks for non-syntactic names ([1]): comps <- specialOpCompletionsHelper(op, suffix, prefix) if (length(comps) == 0L) comps <- "" +non_syntactic <- make.names(comps) != comps +comps[non_syntactic] <- paste0("`", comps[non_syntactic], "`") sprintf("%s%s%s", prefix, op, c...
2003 Nov 16
3
?for
I have always been intrigued by why ?for (or ?if,?while,etc) leave R wanting for more: > ?for + I know the help for these is in ?Control, but I sometimes make the mistake of typing ?for instead. What is R expecting me to say to finish the statement? Thanks, Angel [[alternative HTML version deleted]]
2010 Nov 29
0
formulas with non-syntactic names and an Error() term
## This is an example where ``-quoted non-syntactic names work in ## simple formulas, but not in formulas with an Error() term. ## Is this intentional or an oversight when ``-quoted names were added? tmp <- data.frame(y=1:6, `x^1`=factor(c(1,2,1,2,1,2)), `x^2`=factor(c(1,1,2,2,3,3)), check.na...
2018 Oct 02
2
Reordering of load/stores using MemorySSA
Hello all, It seems that it is insufficient to rely on MemorySSA to correctly reorder load/stores. For example, we have this following code: v = load q store 10, p => store 10, p v = load q // This is incorrect if p and q may alias In the MemorySSA representation however, there's no syntactic dependency between load/store, because MemorySSA before transformation would look like this: USE(M0) // corresponding to `v = load q` M1 = DEF(M0) // corresponding to `store 10, p` Reordering these two nodes does not break syntactic dependency, hence additional flow-sensitive analysis is needed t...
2005 May 07
4
string syntactic sugar in R? - long post
...ble names embedded and replaced by values (converted to strings, lazy eval) before use. An example in R-syntax would be: >alpha <- 8; beta="xyz" >gstr <- "the result is ${alpha} with the comment ${beta}" >cat(gstr) the result is 8 with the comment xyz This syntactic sugar reduces significantly the number of mistakes made with normal string concatenations. Gstrings are used in ant and groovy - (for details see http://groovy.codehaus.org/Strings, jump to GStrings). They are particularly useful for creating readable and error-free SQL statements, but obviously th...
2019 Mar 29
2
Bug in the "reformulate" function in stats package
I suspect that the issue is addressed (obliquely) in the examples, which shows that variables with spaces in them (or otherwise 'non-syntactic', i.e. not satisfying the constraints of legal R symbols) can be handled by protecting them with backticks (``) ## using non-syntactic names: reformulate(c("`P/E`", "`% Growth`"), response = as.name("+-")) It seems to me there could be room for a *document...
2020 Aug 29
2
TableGen enhancements
It's interesting that you bring this up. I've seen a lot of TableGen error messages over the past couple of weeks and I don't recall being confused about any error or its location. I will give this a closer look. I agree that syntactic enhancements aren't particularly exciting by themselves. I was wondering whether some new features coupled with new backends would pave the way for additional uses for TableGen in the area of code generation (or any other areas, for that matter). At 8/29/2020 06:50 PM, Chris Lattner wrote: &gt...
2013 Oct 27
1
[LLVMdev] Add support for ldr pseudo instruction in ARM integrated assembler
So, it seems there are enough people on the plus side, I just wanted to make sure we evaluate all sides before taking a decision to add syntactic sugar to LLVM assembler. My main concern is still the same as earlier this year: the integrated assembler for ARM is still not complete, and the more extensions we add to the back-end, the harder it'll be to get it into production quality. That said... On 27 October 2013 01:02, Chris Lattne...
2023 Mar 01
1
tab-complete for non-syntactic names could attempt backtick-wrapping
...'ve started a patch: https://bugs.r-project.org/show_bug.cgi?id=18479 On Wed, Mar 1, 2023 at 1:56 AM Ivan Krylov <krylov.r00t at gmail.com> wrote: > > ? Wed, 1 Mar 2023 01:36:02 -0800 > Michael Chirico via R-devel <r-devel at r-project.org> ?????: > > > +comps[non_syntactic] <- paste0("`", comps[non_syntactic], "`") > > There are a few more corner cases. For example, comps could contain > backticks (which should be escaped with backslashes) and backslashes > (which should also be escaped). Thankfully, \uXXXX-style Unicode escape >...
2004 May 20
1
R 1.8.1 - 1.9.0 incompatability: Underscore in syntactically valid names
Dear R-gang, I have a question about handling underscores in names in R 1.8.1 and 1.9.0. I recently installed 1.9.0 on a machine and found that many codes no longer work as a result of the changed behavior in make.names. I have numerous data files that have dashes, periods and underscores in the header row. I've got numerous R codes that read those files with read.table and read.csv and
2020 Aug 29
3
TableGen enhancements
...bit, I'd like to solicit suggestions for improving and enhancing it. Perhaps there are some lexical changes that could improve readability of .td files (e.g., I'm planning to enhance the lexer to allow an apostrophe as a digit group separator in integers, a la C++). Perhaps there are some syntactic enhancements that would make .td files easier to read and write. Perhaps there are common portions of .td files that can be factored out to reduce future duplications, as with Automaton.td and SearchableTable.td. Perhaps there are common portions of TableGen backends that can be factored out to r...
2017 Apr 03
2
Debugging Docs and llvm.org/docs/
Hi -- I've recently added some documentation to the LLVM docs subdirectory, and was wondering about a couple of things: - How should I best debug whether the docs (in RST) are syntactically correct? Are there recommended practices for doing a sanity check on the docs? - How often do the documents get built and uploaded to the website? Cheers -- Dean
2023 Mar 02
3
tab-complete for non-syntactic names could attempt backtick-wrapping
There turn out to be a few more things to fix. One problem is easy to solve: vapply() needs a third argument specifying the type of the return value. (Can we have unit tests for tab completion?) The other problem is harder: `comps` defaults to an empty string, and you can't have a symbol consisting of an empty string, because this value is internally reserved for missing function arguments.