Hi, I'm working through "R-debug-tools.pdf" and on page 7 it describes doing: Browse[1]> debug(sum) ## Flag sum for debugging however, when I try this, I get: Browse[1]> debug(sum)Error in debug(fun) : argument must be a closure Does anyone know why I get this error, and how to work around it? Thanks. _________________________________________________________________ Hotmail: Powerful Free email with security by Microsoft. [[alternative HTML version deleted]]
On 10/10/2009 7:00 PM, Another Oneforyou wrote:> Hi, > I'm working through "R-debug-tools.pdf" and on page 7 it describes doing: > Browse[1]> debug(sum) ## Flag sum for debugging > however, when I try this, I get: > Browse[1]> debug(sum)Error in debug(fun) : argument must be a closure > Does anyone know why I get this error, and how to work around it?debug() only works on regular functions (which are called "closures"). sum() is a special built in function, because it is so frequently used, and because it needs to be fast. So you can't debug it. Whoever wrote those instructions should update them to use a different example. (Google suggests that the document was written in 2002, so someone may very well have already done so.) Duncan
Reasonably Related Threads
- Re: [PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
- Re: [libnbd] More thoughts on callbacks and more
- Re: [PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
- [LLVMdev] Efficient implementation of closures?
- [LLVMdev] Some question on LLVM design