From: Jamis Buck Date: 2003-12-30T06:54:50+09:00 Subject: Question about Ruby implementation I've been poking around the Ruby internals, trying to understand the black magic that makes the whole thing run. :) I think I finally understand the garbage collection stuff (and how it determines the roots from the stack and registers), but I have a question now about some of the macros I've seen: why do some macros wrap their contents in a "do { ... } while(0)"? Is this preferable to simply wrapping them in curly braces ("{...}")? Is it simply a matter of matz's programming style, or is there some subtler issue in effect here? A few macros that do this (for curious persons to reference) are JUMP_TAG (in eval.c) and RUBY_CRITICAL (in rubysig.h), though there are several others. Thanks! (And if there is a more appropriate list for posting questions regarding the implementation of Ruby, please direct me there. Thanks again!) -- Jamis Buck jgb3@email.byu.edu ruby -h | ruby -e 'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'