search for: badfunct

Displaying 4 results from an estimated 4 matches for "badfunct".

Did you mean: adjunct
2007 Jun 15
2
model.frame: how does one use it?
...nction <- function(mydata, myformula, myweight) { hyp <- rpart(myformula, data=mydata, weights=myweight, method="class") prev <- hyp } goodFunction(mydata, myformula, myweight) cat("Ok\n") ## now remove myweight and try to compute it inside a function rm(myweight) badFunction <- function(mydata, myformula) { myweight <- abs(rnorm(nrow(mydata))) mf <- model.frame(myformula, mydata, myweight) print(head(df)) hyp <- rpart(myformula, data=mf, weights=myweight, method="class") prev <- hyp } ba...
2018 Feb 21
1
Checking for a proper "stop" statement...
Folks: Consider the following two use cases: goodfunction <- function() { stop("Something went wrong..." } # vs. badfunction <- function() { notgood() } Is there a way for me to test if the functions make use of a stop() statement WITHOUT modifying the stop() output (assume I can't mod the function containing the stop() statement itself)? For "goodfunction" the answer is TRUE, for "badfunction&...
2020 Jul 17
3
[FileCheck] RFC: Add support for line anchors.
...e from the fact it can't start with '$'. - When referring to an anchor in a check use the same numeric variable syntax that FileCheck already supports: `CHECK: [[#ANCHOR_NAME]][[#ANCHOR_NAME+1]]` Here is a brief (contrived) example of the usage of this: ``` #define BAD_FUNCTION() badFunction() // LINE-ANCHOR: BAD_FUNC // Further down in the file BAD_FUNCTION(); CHECK-NOTES: [[@LINE-1]]:3: warning: called a bad function CHECK-NOTES :[[#BAD-FUNC]]:3: note: expanded from macro 'BAD_FUNCTION' ``` Regards, Nathan James
2020 Jul 17
2
[cfe-dev] [FileCheck] RFC: Add support for line anchors.
...here they were defined. > > I think something like this could be useful. However, I think it > would be more useful to have a general directive for defining > FileCheck variables inline without trying to capture from input. For > example: > > ``` > #define BAD_FUNCTION() badFunction() // CHECK-DEFINE: > [[#BAD_FUNC:@LINE]] > // Further down in the file > BAD_FUNCTION(); > CHECK-NOTES: [[@LINE-1]]:3: warning: called a bad function > CHECK-NOTES :[[#BAD_FUNC]]:3: note: expanded from macro > 'BAD_FUNCTION' > ``` > > The exact syntax is deb...