vctrs icon indicating copy to clipboard operation
vctrs copied to clipboard

`obj_print*()` gain max argument

Open krlmlr opened this issue 4 years ago • 6 comments

This argument is also accepted by base::print(), but undocumented.

Closes #1355.

krlmlr avatar Oct 27 '21 05:10 krlmlr

also accepted by base::print(), but undocumented.

max is actually documented in ?print.default, if that is what you were referring to

DavisVaughan avatar Oct 28 '21 17:10 DavisVaughan

I don't understand why we don't slice in the generic?

lionel- avatar Feb 03 '22 09:02 lionel-

@lionel-: IIRC, to slice in the generic, we would have to pass both the sliced vector and the original lengths to the detail methods. Do you prefer this solution?

krlmlr avatar Aug 19 '22 01:08 krlmlr

Don't we pass the whole vector?

lionel- avatar Aug 19 '22 05:08 lionel-

Yes, right now we pass the whole vector.

Are you proposing the following logic:

  • we slice in the generic
  • the methods only ever see a truncated version of the vector
  • obj_print_footer() is no longer responsible for printing the informative line
  • the generic prints the informative line after all methods have been called

?

I rather like that.

krlmlr avatar Aug 19 '22 09:08 krlmlr

yup exactly

lionel- avatar Aug 19 '22 11:08 lionel-