Bug #7890

Data class should have documentation

Added by Matthew Mongeau about 1 year ago. Updated about 1 year ago.

[ruby-core:52549]
Status:Closed
Priority:Normal
Assignee:Zachary Scott
Category:doc
Target version:-
ruby -v:2.0.0 Backport:

Description

This class is confusing without knowing where to lookup information. I've attached a patch that points developers to README.ext

I'm assigning this to zzak, hopefully if this is the wrong person to assign it to he can assign it to someone else.

Associated revisions

Revision 39330
Added by Zachary Scott about 1 year ago

  • object.c: Document Data class [Bug #7890] Patch by Matthew Mongeau

History

#1 Updated by Matthew Mongeau about 1 year ago

I have a lack of experience with redmine. I don't see my patch attached, so just incase:

Index: object.c

--- object.c (revision 39327)
+++ object.c (working copy)
@@ -3115,6 +3115,12 @@
rbcData = rbdefineclass("Data", rbcObject);
rbundefallocfunc(rbcData);

  • /*
  • * Document-class: Data
  • *
  • * This is a recommended base class for use by C extensions using DataMakeStruct/DataWrapStruct, see README.EXT for details.
  • */ + rbcTrueClass = rbdefineclass("TrueClass", rbcObject); rbdefinemethod(rbcTrueClass, "tos", truetos, 0); rbdefinealias(rbcTrueClass, "inspect", "tos");

#2 Updated by Zachary Scott about 1 year ago

  • Status changed from Open to Closed

This issue was solved with changeset r39330.
Matthew, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • object.c: Document Data class [Bug #7890] Patch by Matthew Mongeau

#3 Updated by Nobuyoshi Nakada about 1 year ago

I've supposed removal of Data in Ruby level.

#4 Updated by Matthew Mongeau about 1 year ago

nobu (Nobuyoshi Nakada) wrote:

I've supposed removal of Data in Ruby level.

It's my understanding that a lot of people feel that way, might be worth deprecating because I'd be uncertain as to how many C extensions use this. I know ruby std-lib has it in curses, iconv, raddrinfo, stringio, tcltklib, and win32ole. The core has it in marshal, transcode, and error. I don't currently understand the functionality behind TypedDataMakeStruct and DataWrapStruct so I'm not sure how these libraries would be affected.

Also available in: Atom PDF