Skip to content
Prev 35972 / 63424 Next

Best style to organize code, namespaces

As you mention ease of debugging basically precludes subfunctions so
style 1 is left.

Functions can be nested in environments rather than in other functions
and this will allow debugging to still occur.

The proto package which makes it particularly convenient to nest
functions in environments giving an analog to #3 while still allowing
debugging.  See http//:r-proto.googlecode.com
debugging in: get("f", env = p, inherits = TRUE)(p, ...)
debug: .$a <- .$a + 1
Browse[2]>
exiting from: get("f", env = p, inherits = TRUE)(p, ...)
[1] 2
[1] 2
On Mon, Feb 22, 2010 at 9:49 PM, Ben <misc7 at emerose.org> wrote: