Sha256: df50a30bc68e0569f9fc40911126100ab090445735bc8009f2c215957b18d2bf
Contents?: true
Size: 530 Bytes
Versions: 36
Compression:
Stored size: 530 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