Sha256: d05438ed7923279498dbf193088008c644f6b2d462d030abcf32457030928fbf
Contents?: true
Size: 528 Bytes
Versions: 36
Compression:
Stored size: 528 Bytes
Contents
| | fields = %w( foo bar foobar barfoo ) | | macro('field'){|name| "int #{ name };" } | | macro('setter') do |name| | <<-c | int set_#{ name }(self, value) | object * self; | int value; | { | return( self->#{ name } = value ); | } | c | end | | macro('getter') do |name| | <<-c | int get_#{ name }(self) | object * self; | { | return( self->#{ name } ); | } | c | end struct object { | | fields.each{|f| field f} | }; | | fields.each{|f| setter(f); getter(f); } |
Version data entries
36 entries across 36 versions & 3 rubygems