Project

General

Profile

Feature #8264

define struct under the given namespace

Added by nobu (Nobuyoshi Nakada) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:54250]

Description

=begin
As commented in ((%struct.c%)), it's old style to define (({Struct::Foo})) automatically.

But there is no handy way to define a (({Struct})) under other namespaces, so I propose new C API to do it, (({rb_struct_define_under()})).
=end

0001-struct.c-rb_struct_define_under.patch (3.89 KB) 0001-struct.c-rb_struct_define_under.patch nobu (Nobuyoshi Nakada), 04/13/2013 11:39 AM

Associated revisions

Revision 042e5013
Added by nobu (Nobuyoshi Nakada) over 5 years ago

struct.c: rb_struct_define_under

  • struct.c (rb_struct_define_under): new function to define Struct under the given namespace, not under Struct. [Feature #8264]
  • ext/etc/etc.c: use rb_struct_define_under.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 42348
Added by nobu (Nobuyoshi Nakada) over 5 years ago

struct.c: rb_struct_define_under

  • struct.c (rb_struct_define_under): new function to define Struct under the given namespace, not under Struct. [Feature #8264]
  • ext/etc/etc.c: use rb_struct_define_under.

Revision 42348
Added by nobu (Nobuyoshi Nakada) over 5 years ago

struct.c: rb_struct_define_under

  • struct.c (rb_struct_define_under): new function to define Struct under the given namespace, not under Struct. [Feature #8264]
  • ext/etc/etc.c: use rb_struct_define_under.

Revision 42348
Added by nobu (Nobuyoshi Nakada) over 5 years ago

struct.c: rb_struct_define_under

  • struct.c (rb_struct_define_under): new function to define Struct under the given namespace, not under Struct. [Feature #8264]
  • ext/etc/etc.c: use rb_struct_define_under.

Revision 42348
Added by nobu (Nobuyoshi Nakada) over 5 years ago

struct.c: rb_struct_define_under

  • struct.c (rb_struct_define_under): new function to define Struct under the given namespace, not under Struct. [Feature #8264]
  • ext/etc/etc.c: use rb_struct_define_under.

Revision 42348
Added by nobu (Nobuyoshi Nakada) over 5 years ago

struct.c: rb_struct_define_under

  • struct.c (rb_struct_define_under): new function to define Struct under the given namespace, not under Struct. [Feature #8264]
  • ext/etc/etc.c: use rb_struct_define_under.

History

#1 Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

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


struct.c: rb_struct_define_under

  • struct.c (rb_struct_define_under): new function to define Struct under the given namespace, not under Struct. [Feature #8264]
  • ext/etc/etc.c: use rb_struct_define_under.

Also available in: Atom PDF