klass RBasic VALUE RArray ﬂags klass RBasic integer value Flags RObject built-in Object FIXNUM_FLAG : 1 simple ruby value RObject numiv ivptr VALUE ﬂags klass RBasic and RRegexp etc… built-in objects and Symbol ect… Simple values
Original is written in Japanese, and is translated into English. All contents are available at http://ruby-hacking- guide.github.io/ • Talking about very details on Ruby source code and implementation. • about Ruby ver. 1.7.3… old, but Very Very Useful!!
“How to read source codes” • making a method simple by cutting not essential code off. • understanding object structure before. • and many other wisdoms • It was written for C-programmers. But non C-programmer can learn Basic C essence for reading Ruby Implementation. essence
Ruby is improving. • While reading Ruby source code with RHG, you will ﬁnd a difference between the description and the current code. => This is a chance to know Why the source has been changed. It’s a trace of improvement of ruby. You can trace it by ChangeLog and <git log> with its commit message.
ﬁles. /defs/ … deﬁnition ﬁles such as keywords, errors… /ext/ … c extensions such as json, socket… /lib/ …ruby libraries such as csv, irb, yaml, rake… /missing/ …implements of C functions need for ruby, but not all Systems have. /test/ … test codes for ruby implementations. /spec/ … RubySpec will be downloaded here. Special directories.
\ 7"-6&BSZ ! BSZSC@BSZ@OFX@DBQB 3)"4)@4*;& IBTI SC@IBTI@GPSFBDI IBTI UP@B@J BSZ 0#+@*/'&$5 BSZ IBTI ! SFUVSOBSZ ^ SC@EFpOF@NFUIPE SC@D)BTI UP@B SC@IBTI@UP@B klass method_name function init arg function name is put on the head of line to search easily. make new array with hash size convert hash’s each pair to array Macro often deﬁned in ***.h. but I can imagine how work from name…