search for: frobnicate

Displaying 5 results from an estimated 5 matches for "frobnicate".

2007 Dec 24
2
Build a cmdline for exec from optional parameters
How can I do this?: foo { name: $bar => "frob" } define foo( $bar = false, $baz = false ) { if #$bar and $baz both defined $cmd = "frobnicate --bar=$bar --baz=$baz ${name}" else if #$bar defined $cmd = "frobnicate --bar=$bar ${name}" else if #$baz defined $cmd = "frobnicate --baz=$baz ${name}" else $cmd = "frobnicate ${name}" } This works for 2 optional paramete...
2024 Feb 18
1
Capturing Function Arguments
...ion in R and I want to record all the arguments > passed to it, including default values and missing values. This is hard if not impossible to implement for the general case because the default arguments are evaluated in the environment of the function as it is running: f0 <- function(arg = frobnicate()) { frobnicate <- switch( sample.int(3, 1), function() environment(), function(n=1) runif(n), function() alist(a=)$a ) arg } (And some arguments aren't meant to be evaluated at all.) Even starting with rlang::call_match(call = NULL, defaults = TRUE) is doomed to a certain exten...
2006 Aug 14
14
A mock which extends rather than replaces a class?
While running tests, we would like to instrument some of the classes under test. We still want the classes to do exactly what they currently do, but we would like them to do more when running in the test environment. Clearly we can (and currently do) just extend the objects "on the fly" where necessary, but this is a bit messy - we''d like some centralised way to always
2024 Feb 17
2
Capturing Function Arguments
I'm wrapping a function in R and I want to record all the arguments passed to it, including default values and missing values. I want to be able to snoop on function calls in sourced scripts as part of a unit testing framework. I can capture the values fine, but I'm having trouble evaluating them as if `force()` had been applied to each of them. Here is a minimal example: f0 <-
2006 Sep 25
4
Tightening the rules for literal `[` and `]` chars in link ids
So here's an interesting bug I just discovered: [Like this][d]: [here][h]. [d]: foo [h]: bar The output here should be: <a href="foo">Like this</a>: <a href="bar">here</a>. But instead the output is completely empty. I see this bug in both Markdown.pl and PHP Markdown. The problem is that all three lines are being