From: "ara.t.howard" Date: 2008-05-31T06:31:25+09:00 Subject: Re: Proc multiple returns? On May 30, 2008, at 6:22 AM, Ryan Lewis wrote: > You dont understand, I'm making a simple HTML module for easy document > creating. > The code will look like this: > HTML::body { > "blahblah" > HTML::h1 { > "zomg headers" > } > } > > Assuming HTML::h1 returns "

zomg headers

", HTML::body will > only > return "

zomg headers

". > But I need it to return ["blahblah", "

zomg headers

"] it's already written for you: cfp:~ > cat a.rb require 'rubygems' require 'tagz' ### gem install tagz @ http://codeforpeople.com/lib/ruby/tagz/tagz-4.2.0/README def HTML(*a, &b) Tagz(*a, &b) end html = HTML do |html| body_{ html << "blahblah" h1_(:color => "red"){ "zomg headers" } } end puts html cfp:~ > ruby a.rb blahblah

zomg headers

if you really feel like reinventing the wheel read the code to see how it's done, it's < 200 loc http://codeforpeople.com/lib/ruby/tagz/tagz-4.2.0/lib/tagz.rb cheers. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama