From ggrothendieck at gmail.com  Thu Oct 26 02:14:08 2006
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Wed, 25 Oct 2006 20:14:08 -0400
Subject: [Rd] how to determine if a function's result is invisible
Message-ID: <971536df0610251714u451cf80fy80bf38cb2f130734@mail.gmail.com>

Suppose we have a function such as the following

F <- function(f, x) f(x)+1

which runs function f and then transforms it.  I would like the
corresponding function which works the same except that
unlike F returns an invisible result if and only if f does.

Is there some way of determining whether f returns
an invisible result or not?

Thus we want this:

f <- function(x) x
g <- function(x) invisible(x)

> F(f, 1)
2
>

> F(g, 1)
>




[Rd] how to determine if a function's result is invisible
Gabor Grothendieck