similar to: Can a function know what other function called it?

Displaying 20 results from an estimated 10000 matches similar to: "Can a function know what other function called it?"

2005 Nov 02
2
Anything like associative arrays in R?
Let me preface my question by stressing that I am much less interested in the answer than in learning a way I could have *found the answer myself*. (As helpful as the participants in this list are, I have far too many R-related questions to resolve by posting here, and as I've written before, in my experience the R documentation has not been very helpful, but I remain hopeful that I may have
2016 Oct 03
4
On implementing zero-overhead code reuse
Hi Frederick, I described what I meant in the post I sent to R-help (https://stat.ethz.ch/pipermail/r-help/2016-September/442174.html), but in brief, by "zero overhead" I mean that the only thing needed for library code to be accessible to client code is for it to be located in designed directory. No additional meta-files, packaging/compiling, etc. are required. Best, G. On Sun, Oct
2016 Oct 02
5
On implementing zero-overhead code reuse
I'm looking for a way to approximate the "zero-overhead" model of code reuse available in languages like Python, Perl, etc. I've described this idea in more detail, and the motivation for this question in an earlier post to R-help (https://stat.ethz.ch/pipermail/r-help/2016-September/442174.html). (One of the responses I got advised that I post my question here instead.) The
2016 Oct 03
3
On implementing zero-overhead code reuse
On Mon, Oct 3, 2016 at 10:18 AM, <frederik at ofb.net> wrote: > Hi Kynn, > > Thanks for expanding. > > I wrote a function like yours when I first started using R. It's > basically the same up to your "new.env()" line, I don't do anything > with environmentns. I just called my function "mysource" and it's > essentially a "source
2009 May 22
2
how to insert NULLs in lists?
I'm an experienced programmer, but learning R is making me lose the little hair I have left... > list(NULL) [[1]] NULL > length(list(NULL)) [1] 1 > x <- list() > x[[1]] <- NULL > x list() > length(x) [1] 0 >From the above experiment, it is clear that, although one can create a one-element list consisting of a NULL element, one can't get the same result by
2009 May 20
10
How to google for R stuff?
Hi! I'm new to R programming, though I've been programming in other languages for years. One thing I find most frustrating about R is how difficult it is to use Google (or any other search tool) to look for answers to my R-related questions. With languages with even slightly more distinctive names like Perl, Java, Python, Matlab, OCaml, etc., usually including the name of the language
2009 May 19
4
Qs: The list of arguments, wrapping functions...
Hi. I'm pretty new to R, but I've been programming in other languages for some time. I have a couple of questions regarding programming with function objects. 1. Is there a way for a function to refer generically to all its actual arguments as a list? I'm thinking of something like the @_ array in Perl or the arguments variable in JavaScript. (By "actual" I mean the ones
2014 Jun 02
3
[LLVMdev] -fvisibility=hidden, and typeinfo, and type-erasure
[Was initially posted on cfe-users, sorry.] Hi, I'm sorry my message is quite long, the TL;DR version is "g++ and clang++ seem to have different opinions on how RTTI, templates, and ELF visibility should interact". I can't tell whether this is a bug or not: I have found no relevant documentation that could help me decide whether this behavior is meant, or not. All I can say
2018 Mar 16
3
cat(fill=N)
Hi all, I expect I'm getting something wrong, but cat("foo bar baz foo bar baz foo bar baz", fill = 10) should be broken into lines of width 10, whereas I get: > cat("foo bar baz foo bar baz foo bar baz", fill = 10) foo bar baz foo bar baz foo bar baz This is on R 3.4.3, but I don't see mentions of it fixed in 3.4.4 or r-devel NEWS. Cheers, David
2009 Jul 26
1
Need help of exclusion options in rsync-3.0.6
Hi, I have a situation where I want to delete some of my excluded patterns but still want to preserve some other. For example consider below source and destination directory hierarchy. Source Dest ---------- --------- /foo/bar/ /foo/bar/ | -> baz | -> baz | -> xyz | -> xyz | ->
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
2006 May 02
2
Bug: invalid nesting of inline markup across link labels
Hi John, there?s a bug in Markdown.pl: [foo*bar](#) [baz*quux](#) This expands to the following: <p><a href="#">foo<em>bar</a> <a href="#">baz</em>quux</a></p> Those `*` should either be disregarded or the tags should nest correctly: 1. <p><a href="#">foo*bar</a> <a
2009 May 02
1
The --relative option on remote machine to source machine ???
Hi, I read below lines in rsync v3.0.5 for --relative option. if you used this command: rsync -av /foo/bar/baz.c remote:/tmp/ ... this would create a file named baz.c in /tmp/ on the remote machine. If instead you used rsync -avR /foo/bar/baz.c remote:/tmp/ then a file named /tmp/foo/bar/baz.c would be created on the remote machine, preserving its full path It is also possible to limit the
2006 Sep 11
2
unexpected behaviour when defining a function
Hi, I know S manuals used to warn against using the same names for a variable and a function, but I have never seen that cause problems in R, so I usually don't pay much attention to it. Which is why the following behaviour came as a surprise: > bar <- function() 1 > foo <- function(bar = bar()) { + bar + } > foo(9) [1] 9 > foo() Error in foo() : recursive default
2007 May 23
2
Markdown generates invalid html for a list immediately followed by a quote
Howdy, [Please preserve the CC to 424919-forwarded at bugs.debian.org on any replies.] The following bug in Markdown was reported to the Debian bug tracking system. In short, running both the released version of Markdown and the latest beta on * foo > bar > baz produces invalid HTML. ----- Forwarded message from Joey Hess <joeyh at debian.org> ----- From: Joey Hess <joeyh
2013 May 10
2
[LLVMdev] Access to command line from within a pass
Is it possible for a pass to get access to the command line options passed to it? That is, if I use the CommandLine library to define cl::opt<int> Foo("foo", ...); cl::opt<int> Bar("bar", ...); cl::opt<bool> Baz("baz", ...); and the user runs "opt -load mypass.so -foo=123 -std-compile-opts -baz", can I somehow get a string
2000 Dec 15
1
Preserving argument splitting with SSH
I'm using: % ssh -V SSH Version OpenSSH-1.2.3, protocol version 1.5. Compiled with SSL. % uname -a Linux gellar 2.2.13 #1 SMP Wed Dec 29 14:07:41 PST 1999 i686 unknown and am wondering whether it's a fundamental shortcoming of the SSH protocol that argument splitting is not preserved from client to server, but instead the argument list is re-split on whitespace. E.g., from my machine
2012 Oct 13
1
[LLVMdev] Accessing merged globals through PointerType
Hi, I am trying to create a pass that is similar to the GlobalMerge code found here: http://llvm.org/docs/doxygen/html/GlobalMerge_8cpp_source.html I am concerned with lines 149-163 of the above file. From the documentation at the top of the file, it will convert this: static int foo[N], bar[N], baz[N]; for (i = 0; i < N; ++i) { foo[i] = bar[i] * baz[i]; } Into something like this
2008 Jun 04
3
how to automatically create objects with names from a string list?
Suppose I have a string of objects names: name <- c("foo", "bar", "baz") and I would like to use a for loop to automatically create three objects called "foo", "bar" and "baz" accordingly. Then how can this be done" (so that in the workspace, foo = 1, bar = 2 and baz=3) for (i in name) { ..... } Thanks! Mark
2014 Aug 26
2
[LLVMdev] llvm-objdump
Hi Kev, I'm glad to hear llvm-objdump is getting attention. I'm unclear on how much output specialization one could (or should) do for ELF vs. Mach-O. If you're game, let's compare an example: $ cat labeltest.s .text foo: nop bar: bum: nop jmp bar jmp bum jmp baz nop baz: nop Assembling for x86 and llvm-objdump'ing, i get $ llvm-mc