Skip to content
Prev 85854 / 398503 Next

srt --- slope text with function?

Thank you, as always.

May I disagree with you and offer a suggestion?

In the best of worlds, a function should have multiple attributes.  In
addition to the function name and its argument list, two mandatory
attributes should be a filename and lineno.  If the function is
interactively created, perhaps we can call the filename "-" and the
lineno a count that could come from the history().   Yes, it will
*NOT* be perfect, but it would be a big improvement.

If functions can have attributes, in addition to keeping the filename
and lineno,  it would be great if it could have an immediate
association with a short documentation message?  This could be a neat
documentation crutch, useful, e.g., in ls.str() or a describe().  the
best syntax that I can think of just stinks, but maybe a standard
argument does the job and should be encouraged.
  xyz <- function(args, doc="xyz returns 0") { return(0); }
I do not think the following syntax would work stylewise:
  xyz <- function "xyz returns 0" (args) { return(0); }
but it would be nicer in noting the difference between a normal
argument and a short function descriptor.

regards,

/iaw

by traceback(), do you mean the gdb() like traceback of the R
internals?  This would not be too helpful to most users.  I would be
more interested in my R call stack, not my underlying C call stack.

[and thanks again for all the other info].

regards,

/iaw
On 2/6/06, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: