comment() and ls() / ls.str()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

comment() and ls() / ls.str()

François Pinard
Hi, people.

After I revisited some older .RData files this evening, I came to
consider that comment() might not be such a bad idea, after all! :-)

However, if I randomly visit such older files, it is unlikely that
I remember which objects got a comment attribute and which do not.

It would be nice if ls.str() was automatically showing comments for the
objects it lists (with maybe some parameter to turn this capability
off).  On the same vein, the more compact ls() output might use some
device to at least inform the user that a comment is available.

I have no satisfying suggestion to offer about what would be the best
way for ls() to yield this information.  (For example, suffixing listed
names with an hash or asterisk would defeat functions using the produced
list.)  Maybe someone else might have a good, clever, usable idea?

Fine enough, str() will show me the full comment.  However, users having
to explicitly call str on all objects, or make (easy) equivalent stunts,
is not fully in the spirit of a comment, which is to volunteer itself...

François Pinard

[hidden email] mailing list