[#54640] bRuby? — Austin Ziegler <austin@...>
Can anyone explain to me what Yuya's package bRuby
On Fri, Nov 01, 2002 at 11:40:51AM +0900, Austin Ziegler wrote:
In article <20021107151904lBE13F@ohmsha.co.jp>,
%% Are there other Ruby parsers out there?
In article <NCEJJNLDMEJLEJHKNGNHOEKLFDAA.robert.calco@verizon.net>,
[#54671] amrita/cgikit/iowa/others? — ahoward <ahoward@...>
[#54704] Ruby Hosting — loats205@... (loats205)
Eh, i don't mean to spam, but i'm really just polling demand for such a thing.
Scripsit illud loats205 <loats205@aol.com>:
ruby occupies more than one proccess? im looking for sugestions, so feel free
[#54721] Snowhite is a virus: Do not open it — Bob Toxen <bob@...>
The email sent to the ruby-talk@ruby-lang.org list with the subject
[#54726] TkOptionMenuButton — "Alan (Ursus Major)" <ursus@...>
'tk.rb. contains a class named TkOptionMenuButton. Does anyone know of an
On Saturday 02 November 2002 11:58 pm, Alan (Ursus Major) wrote:
On Mon, Nov 04, 2002 at 03:58:43AM +0900, Alan (Ursus Major) wrote:
[#54728] substitution problem — Daniel Bretoi <lists@...>
Hi All,
[#54749] Namespace hygenie — Michael Schuerig <schuerig@...>
[#54768] someone needs to be unsubscribed — Albert Wagner <alwagner@...>
Some guy at ibraheem@localhost(?) needs to be unsubscribed. I keep getting
[#54782] Dynamic message dispatch? — paul@... (Paul J. Sanchez)
Suppose I have methods foo and bar. How can I read a string from ARGV
[#54839] rubyconf notes — Pat Eyler <pate@...>
On Saturday Night, I recommended that attendees of Ruby Conf send off
In article <Pine.LNX.4.44.0211041222580.17736-100000@petrol.whirlycott.com>,
Below is my pieced together summary of matz's roundtable summary. It's
From: "TAKAHASHI Masayoshi" <maki@rubycolor.org>
Me too. I had a suspicion when I saw Joseph Smith as the sample name on the
[#54842] IE source code — "Tommy" <basti.steiner@...>
Hi,
[#54862] A vision for Parrot — Daniel Pfeiffer <occitan@...>
Hi,
Daniel Pfeiffer wrote:
In article <aqa2oa$8o1$1@news.ox.ac.uk>, Frodo Morris <""> wrote:
[#54885] Newbie Problem with Shell#transact — Xandy Johnson <xandy@...>
Back from the conference and eager to learn Ruby, I'm trying to write a
[#54889] PGP on the list (was: Re: Matz Roundtable Summary) — Eric Hodel <drbrain@...7.net>
Paul Duncan (pabs@pablotron.org) wrote:
* Eric Hodel (drbrain@segment7.net) wrote:
> I was asked not to sign my messages because it either looks funny
[#54906] Win32 support issues — "Gavin Sinclair" <gsinclair@...>
<quote source="roundtable">
Gavin Sinclair wrote:
I don't think its 'fork' the command, but fork-like behavior. Its weird
[#54919] UDPSocket - bidirectional communication through one socket? — Wejn <lists+rubytalk@...>
Hi,
>>>>> "W" == Wejn <lists+rubytalk@box.cz> writes:
[#54939] XML::RPC encryption — Daniel Berger <djberge@...>
Hi all,
[#54968] Integrating Mac OS X's native Ruby with fink libraries — adamon@... (Damon)
I am happily running OS 10.2.1 on my Mac, using the default OS X
On Tuesday, November 5, 2002, at 07:24 PM, Damon wrote:
>
[#54996] How to get ruby interactive when some condition or error ocurred? — Radek Hnilica <Radek@...>
Hello,
In article <20021106134943.GQ17694@ns>,
On 6 Nov 2002, Phil Tomson wrote:
On Thu, 7 Nov 2002 04:05:51 +0900, ahoward wrote:
[#55000] Handling FAQs - was "Thoughts on Ruby" — "Gavin Sinclair" <gsinclair@...>
From: "Massimiliano Mirra" <list@NOSPAMchromatic-harp.com>
[#55022] Where's rubycentral???? — montana <montana@...99.bsd.st>
Anyone know what happened to:
[#55025] Alternate locations for online pickaxe? — ptkwt@...1.aracnet.com (Phil Tomson)
[#55035] Problem posting to ML — "Gennady F. Bystritsky" <gfb@...>
I have a strange problem -- very often when posting to ruby-talk I get an error from Mailer-Daemon@ignoramus.co.uk (see attachment). Nevertheless my post gets delivered anyway. Any ideas?
[#55044] CGI::Session::FileStore question — "Chris" <nemo@...>
Hello,
[#55053] tail recursion — mirian@... (Mirian Crzig Lennox)
Greetings, Ruby hackers!
[#55091] PGP signatures — "Gavin Sinclair" <gsinclair@...>
From: "Paul Duncan" <pabs@pablotron.org>
From: "Carl Youngblood" <carl@ycs.biz>
-----BEGIN PGP SIGNED MESSAGE-----
[#55093] understanding modules/classes — Eric Schwartz <emschwar@...>
I've written a test harness (in Perl, but I may convert it to Ruby, if
On Thu, 7 Nov 2002 10:27:02 +0900, Eric Schwartz wrote:
[#55094] Changing ruby warning level — "Carl Youngblood" <carl@...>
Does anyone know how to change the warning level in Ruby?
[#55143] ATTN: Mailing list admin — Tom Gilbert <tom@...>
Hi,
[#55149] Making Instace Variables Private/Local — William Djaja Tjokroaminata <billtj@...>
Hi Matz,
Hi,
From: "William Djaja Tjokroaminata" <billtj@y.glue.umd.edu> [snipped]
Let's see: Dave Thomas gave a presentation on a 26kloc production
[#55189] v.polar = rho, theta — Hans Fugal <hans@...>
Hi, I'm using the Vector class and needed a way to set the vector with
[#55221] CPAN Style installer — Tom Clarke <tom@...2i.com>
Hi all,
In article <Pine.LNX.4.44.0211071926160.7998-100000@localhost.localdomain>,
On Fri, 8 Nov 2002, Phil Tomson wrote:
>
On Sat, 9 Nov 2002, JamesBritt wrote:
> From: tom [mailto:tom@u2i.com]
JamesBritt (james@jamesbritt.com) wrote:
why the lucky stiff <ruby-talk@whytheluckystiff.net> writes:
On Sat, 9 Nov 2002 07:24:10 +0900, Yohanes Santoso wrote:
Tom Clarke (tom@u2i.com) wrote:
-----BEGIN PGP SIGNED MESSAGE-----
[#55258] Beginner Question (Idiomatic way to subset an array — "Booth, Peter" <Peter.Booth@...>
I'm wondering if there is a more idiomatic way to do the following?
On Fri, 8 Nov 2002, Booth, Peter wrote:
Hi --
On Sun, 10 Nov 2002 dblack@candle.superlink.net wrote:
On Sat, Nov 09, 2002 at 12:52:24AM +0900, ahoward wrote:
On Sun, 10 Nov 2002, Brian Candler wrote:
Hi --
processInfo.select{|x| process['realm'] == realm}
[#55278] Basic CGI question — Mark Probert <probertm@...>
[#55317] help - redirect/flush/sync problem — ahoward <ahoward@...>
>>>>> "a" == ahoward <ahoward@fsl.noaa.gov> writes:
On Sat, 9 Nov 2002, ts wrote:
[#55319] Multi-dimensional (like 2) arrays in Ruby — "Ted" <ted@...>
Does Ruby support other than 1 dimensional arrays?
[#55328] Re: Multi-dimensional (like 2) arrays in Ruby — "Ted" <ted@...>
All of the replies say the same thing -- this is good.
[#55361] Lighting Rod — Eric Armstrong <eric.armstrong@...>
I love Ruby's smalltalk features. I really do.
----- Original Message -----
[#55369] Why use 'include' — Eric Schwartz <emschwar@...>
As requested, here's a FAQ question & answer on the usage of modules
[#55372] Random idea: Procedural CGI?? — "Hal E. Fulton" <hal9000@...>
I've been musing about something today,
----- Original Message -----
On Sat, 9 Nov 2002 16:39:24 +0900, Hal E. Fulton wrote:
On Sat, 2002-11-09 at 09:29, Austin Ziegler wrote:
[#55385] Ruby syntax file in vim and implied hashes — Philip Mak <pmak@...>
If I write this:
[#55386] An alternative HTML generation syntax — Philip Mak <pmak@...>
I'm using Ruby to output HTML a lot these days. I know of these
On Saturday 09 November 2002 03:47 am, Philip Mak wrote:
I was really wowed by Narf at RubyConf. It's got built in templating,
[#55415] groking roach/error starting — ahoward <ahoward@...>
[#55430] Problem with installation -- error in readline.c — John Feezell <JohnFeezell@3wplace.com>
My name is John Feezell and I am just starting to studying about and use
>>>>> "J" == John Feezell <JohnFeezell@3wplace.com> writes:
[#55442] Recording of the Ruby segement on LL2 — Yohanes Santoso <ysantoso@...>
Hi all,
In article <87wunmqpni.fsf@jenny-gnome.dyndns.org>,
Hi,
[#55461] www.ruby-doc.org — " JamesBritt" <james@...>
Jim Freeze's presentation at RubyConf 2002 mentioned, among other things, the
* JamesBritt (james@jamesbritt.com) wrote:
[#55523] Does Ruby1.6.7 for Windows support ncurses? — Jim Freeze <jim@...>
Hi
[#55534] Klass.method(:new).arity == -1 violates my POLS! — coma_killen@...
Hi,
[#55536] ANN: MiniWikiRuby does graphs, remote links, etc. — Phlip <phlipcpp@...>
<posted & mailed>
[#55541] Ruby Weekly News — Dave@...
[#55563] EuRuKo: European Ruby conference — Armin Roehrl <armin@...>
Hi all,
----- Original Message -----
On Tue, Nov 12, 2002 at 02:46:50PM +0900, Hal E. Fulton wrote:
[#55571] ruby-dev summary 18613-18710 — TAKAHASHI Masayoshi <maki@...>
Hi all,
In article <20021112020739J.maki@rubycolor.org>, TAKAHASHI Masayoshi wrote:
Hi --
In article <Pine.LNX.4.44.0211142157370.25867-100000@candle.superlink.net>,
Hi --
On 2002-11-15 21:37:46 +0900, dblack@candle.superlink.net wrote:
Hi --
On 2002-11-16 06:07:50 +0900, dblack@candle.superlink.net wrote:
[#55578] Threading in I/O libraries — Brian Candler <B.Candler@...>
I'd like to ask: how integrated is threading in Ruby's I/O libraries?
[#55585] More fun with modules — Eric Schwartz <emschwar@...>
Okay, I *thought* I understood modules. Then I try to factor out some
[#55599] What the...? — tokikenshi@... (Johan Persson)
Take a look on the snippet below
[#55616] Problem with a select in Oracle — mavallad@... (Manuel Valladares)
Hello,
[#55620] setting LD_LIBRARY_PATH doesn't seem to work? — Eric Schwartz <emschwar@...>
On a linux system, I've developed a extension to STAF (see previous
On 11 Nov 2002, Eric Schwartz wrote:
[#55637] eruby0.9.8/winxp/apache1.3.27 - eruby don't parse my files — "sven" <sven.rosner@...>
my configurations is
You can see your code working at 3wplace.com/rb/GetEnv.rhtml
thx for this but i have now another problem.
[#55648] ANN: rdep (Ruby Dependency Tool) — "Hal E. Fulton" <hal9000@...>
I recently did a small rewrite of a tool
[#55686] request for help — Pat Eyler <pate@...>
Hi all,
[#55723] How do module functions work? — "Gavin Sinclair" <gsinclair@...>
Rubyists,
[#55726] Re: Keyword arguments? — ahoward <ahoward@...>
On Tue, 12 Nov 2002, Vis Mike wrote:
On Wed, 13 Nov 2002 19:17:14 +0900, ahoward wrote:
Austin Ziegler wrote:
On Thu, 14 Nov 2002 05:10:40 +0900, Joel VanderWerf wrote:
[#55728] Where is RubyCentral? — "Aleksei Guzev" <aleksei.guzev@...>
I cannot navigate to the site. Help, please.
[#55729] Ruby.NET ?? — "Markus Hahn" <mh@...>
Hi all,
[#55735] What's your favorite Ruby book? <eom> — christopher.j.meisenzahl@...
[#55750] Another Newbie question regarding instance variables? — montana <montana@...99.bsd.st>
The value of an instance variable is only available to the instance of the class, whereas the value of the class variable is available to all instances of the class? Is this correct?
I thought that I knew Ruby pretty well until I came accross this thread
[#55754] FW: Fox include question — "Rich Kilmer" <rich@...>
Why does this work:
[#55769] Re: Where is RubyCentral? — Andrew Hunt <andy@...>
>Actually, can someone tell me what is going on with the DNS?
[#55795] Re: FXRuby issue — "lyle@..." <lyle@...>
[#55815] RubyConf 2002 Slides for FreeRIDE Presentation — "Curt Hibbs" <curt@...>
I finally got the slides online from Rich Kilmer's FreeRIDE presentation at
>
JamesBritt wrote:
Jim Freeze wrote:
"Curt Hibbs" <curt@hibbs.com> wrote in message news:<INEGJNJOFAMNDPNEABNEKEEEFDAA.curt@hibbs.com>...
Damon (adamon@mailandnews.com) wrote:
Curt Hibbs wrote:
Extensibility IN RUBY was the key thing for us. We wanted the IDE to be
From: "Robert McGovern" <tarasis@btopenworld.com>
> c) Emacs...well if you are an Emacs user there will never be anything
[#55818] regex help — "Shashank Date" <sdate@...>
Using ruby 1.7.3 (2002-10-12) [i386-mswin32] on Win XP (Home)
[#55842] Ruby equivalent to Python's map()? — wolfoxbr@... (Roberto Amorim)
Hi...
In article <82c04a2.0211140526.115c9413@posting.google.com>,
[#55883] understanding continuations — ahoward <ahoward@...>
On 15 Nov 2002 at 3:20, ahoward wrote:
[#55891] Array#next - Enumerable#next ? — ahoward <ahoward@...>
[#55909] Syntactic Sugar Question — oinkoink+unet@... (Bret Jolly)
Ruby has the nifty syntactic sugar by which
[#55913] Problem writing to file after closing $stdout & $stderr — Eric Schwartz <emschwar@...>
So I have a program now that starts off tests on remote machines, and
[#55925] Howot redirect STDOUT to a string within a script? — ptkwt@...1.aracnet.com (Phil Tomson)
Let's say I've got some strings with Ruby code to be eval'ed, like:
[#55950] Regexp: What does //o do? — Jim Freeze <jim@...>
Hi:
Jim Freeze <jim@freeze.org> writes:
On Saturday, 16 November 2002 at 2:03:24 +0900, Matt Armstrong wrote:
[#55990] Newbie questions regarding getter/setter methods... — christopher.j.meisenzahl@...
Just working my way through the pickaxe book.
[#56007] urgent DRb help — ahoward <ahoward@...>
[#56045] Not really a ruby question, but this is a smart group. Win32 file.write timing. — jcb@... (MetalOne)
I am trying to write non-compressed video to a file at 40 fps.
Arg!! I feel like such an idiot.
Hi,
Hmmm. Thanks for the suggestion... but it doesn't change anything. This doesn't surprise me as just running
[#56048] Read a file... — "Ted" <ted@...>
It seems so simple, but eludes me.
[#56051] Ruby compiler — Daniel Carrera <dcarrera@...>
Hello,
[#56059] Re: Read a file... — "Ted" <ted@...>
Thanks so much for the solution. It worked, first time.
[#56060] sorting partially ordered objects in 1.7.3 fails — Joel VanderWerf <vjoel@...>
>>>>> "J" == Joel VanderWerf <vjoel@PATH.Berkeley.EDU> writes:
[#56098] Windows bitbucket equivalent? — Brian Wisti <brian@...>
Hi all,
[#56119] ruby-dev summary 18711-18810 — Minero Aoki <aamine@...>
Hi all,
On Mon, Nov 18, 2002 at 06:13:12PM +0900, Minero Aoki wrote:
Hi --
Hi,
Hi --
Hi --
On "zip":
[#56131] identing ruby in vim — Maur兤io <briqueabraque@...>
Hi,
From: "Michael Brailsford" <brailsmt@yahoo.com>
Wed, 20 Nov 2002 08:19:11 +0900: Gavin Sinclair ("Gavin Sinclair"
[#56147] irb difficulties. — "Ted" <ted@...>
Just updated Ruby from CVS, compiled it, and started up irb.
[#56158] install.rb/setup.rb question — ptkwt@...1.aracnet.com (Phil Tomson)
I want to install a script that will be run as an executable which isn't a
On Tuesday, 19 November 2002 at 5:09:27 +0900, Phil Tomson wrote:
In article <20021118153749.A13574@freeze.org>,
[#56183] Allow *array expansion anywhere in list — David Robins <dbrobins@...>
Regarding the proposal mentioned in the subject (see also
[#56219] How to write BLOBs in a Postgres DB? — Stefan Scholl <stefan.scholl@...>
Are there any (working) examples of writing a BLOB into a
[#56247] Writer and researcher requests your help. — Steve Lawler <practice@...>
Dear Colleague,
[#56250] Need help dynamically creating classes. — pgregory@... (Paul Gregory)
I have a system at the moment where I create 'things' based on a base
[#56273] Symbol usage help — ahoward <ahoward@...>
[#56296] Learning Ruby — Daniel Carrera <dcarrera@...>
Hi,
[#56297] Defining <=> — "Tim Hunter" <cyclists@...>
I need to define <=> in a class. What is the appropriate thing to do when
[#56300] untainted, unfrozen, honest-to-god session data! — "Chris" <nemo@...>
Hello,
[#56319] RUBYLIB="" causes load problems in 1.7.3 — Joel VanderWerf <vjoel@...>
[#56325] eRuby & MySQL — "Jostein Berntsen" <jostein.berntsen@...>
Hi,
[#56328] Problem installing testunit 0.1.4 on OSX — Ross Shaw <rshaw1961@...>
Hi
[#56348] Questions about embedding Ruby in C — tokikenshi@... (Johan Persson)
I have some questions regarding how to embed Ruby into C apps:
[#56370] O() notation for Arrays operations and why is there no List class — jcb@... (MetalOne)
Is there any documentation of the O() notation for Array operations.
[#56376] Interpreted vs compiled [FAQ] defining methods anywhere — Daniel Carrera <dcarrera@...>
Hello,
* Daniel Carrera (dcarrera@math.umd.edu) [21 Nov 2002 16:07]:
On Thursday, 21 November 2002 at 14:18:12 +0900, Iain 'Spoon' Truskett wrote:
Please explain how methods in an explicit class are different than
Mark Wilson <mwilson13@cox.net> writes:
On Thursday, 21 November 2002 at 14:42:35 +0900, Dave Thomas wrote:
>>>>> "J" == Jim Freeze <jim@freeze.org> writes:
[#56388] Ruby is too slow — jcb@... (MetalOne)
I have been writing some image processing algorithms that run on incoming
"Bulat Ziganshin" <bulatz@integ.ru> wrote in message news:<36275642663.20021121125533@integ.ru>...
On Thu, 2002-11-21 at 18:56, MetalOne wrote:
How slow really *is* Ruby?
[#56440] Multiple constructors? — christopher.j.meisenzahl@...
On Fri, Nov 22, 2002 at 12:06:36AM +0900, christopher.j.meisenzahl@citicorp.com wrote:
[#56469] The ultimate Application — "Dat Nguyen" <thucdat@...>
[#56543] find arguments... is this possible — "Michael Hale" <mhale@...>
I want to get the names of the arguments that are passed into a method.
[#56555] Defining <=> — "Tim Hunter" <cyclists@...>
At Gavin's request here is a summary of my question and the answers I
From: "Dave Thomas" <Dave@PragmaticProgrammer.com>
Hi --
[#56585] Ruby/PHP security — "Ted" <ted@...>
Someone made a comment (I paraphrase) like "PHP can do it, but with complete insecurity", and opined that Ruby is more secure than PHP.
[#56593] Ruby idom needed — Robert Cowham <rc@...>
What's the best ruby idiom for the following Perl:
Hi --
Ross Shaw <rshaw1961@yahoo.com.au> wrote in message news:<rshaw1961-> Robert Cowham <rc@vaccaperna.co.uk> wrote:
[#56618] Not supposed behaviour of Array.new(2,[]) — gminick <gminick@...>
Hi,
[#56633] Things That Newcomers to Ruby Should Know (11/24/02) — William Djaja Tjokroaminata <billtj@...>
Hi,
Hi,
> 9. Ruby has no pre/post increment/decrement operator. For instance, x++
Tue, 26 Nov 2002 06:30:36 +0900: Daniel Carrera (Daniel Carrera
Okay, "very convenient" was a stupid way of putting it. I like "x++"
From: "Simon Cozens" <simon@simon-cozens.org>
On Tue, 26 Nov 2002 09:21:48 +0900, Daniel Carrera wrote:
> It's applicable to a small subset of the total set of classes.
[snip]
Hi --
> You're not changing the letter 'a' itself; you're
----- Original Message -----
OK... I get it... I understood your argument (although
Jason Persampieri <helgaorg@yahoo.com> wrote:
Hi --
[#56638] list comprehension and default argument name — "Bulat Ziganshin" <bulatz@...>
Hello ruby-talk,
On Mon, 25 Nov 2002 15:32:38 +0900, Bulat Ziganshin wrote:
[#56643] ruby-dev summary 18811-18923 — Takaaki Tateishi <ttate@...>
Hello,
On Mon, Nov 25, 2002 at 09:10:32PM +0900, Takaaki Tateishi wrote:
[#56652] Q: mod_ruby may be NPH? — kwatch@... (kwatch)
I have a trouble with using mod_ruby 1.0.1.
[#56665] FXRuby on Mandrake 8.2 — Ludo <coquelle@...>
Hi, could someone help a beginner rubyer please ?
>>>>> "L" == Ludo <coquelle@enib.fr> writes:
On Mon, 2002-11-25 at 18:28, ts wrote:
>>>>> "L" == Ludo <coquelle@enib.fr> writes:
On Mon, 2002-11-25 at 18:43, ts wrote:
[#56708] Default value of property — Tim Bates <tim@...>
I have an object, with a method that returns another object, or nil under
On Tue, 26 Nov 2002, Tim Bates wrote:
On Tue, Nov 26, 2002 at 10:44:50AM +0900, ahoward wrote:
Hi --
From: <dblack@candle.superlink.net>
----- Original Message -----
[#56719] each_with_index & collect_with_index? — Tim Bates <tim@...>
Array.each (and others) have an alternative .each_index which passes the index
Hi --
> As for the second.... I recently appointed myself President of
On Wed, 27 Nov 2002, Gordon Miller wrote:
Gordon Miller (gmiller@promisemark.com) wrote:
> It would be really cool if, instead of having a
Hi --
On Wed, Nov 27, 2002 at 01:49:10PM +0900, dblack@candle.superlink.net wrote:
> (Aw, don't put it that way :-)
[#56745] Re: Difference between puts and print — Stephen Neu <sneu@...>
You can also say
From: "andrew delboy" <andrew@cyber.com.au>
Ok, let me see if I have gotten my head around this.
[#56772] RCR: Stack, Queue alias methods in Array — Martin DeMello <martindemello@...>
Rationale: Ruby arrays can be easily used as stacks and queues, but it's
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
Hi,
[#56824] The names of a method — Klaus Fabritius <kfk@...>
Hello!
Hi,
[#56858] Ruby and Expect/Tcl — Minh Tang <minhtang@...>
[#56882] set operation — "Shannon Fang" <xrfang@...>
Hi,
[#56898] Knowledge Base (Re: set operation) — "Shannon Fang" <xrfang@...>
Hi,
[#56907] explicit destroy — Ludo <coquelle@...>
Hi,
[#56948] Array#and? and Array#or? methods? — Jeff de Vries <jdevries@...>
Is there some reason the following methods on Array aren't included as
[#56958] Does any have the reference library that was on http://www.rubycentral.com — "Paquerette" <paquerette@...>
I can't display this site anymore and there online doc was very usefull...
[#56960] Vim and Ruby — Michael Brailsford <brailsmt@...>
There was a recent post to the vim ML about including ruby support in
[#56967] call-by-reference problem again — Shannon Fang <xrfang@...>
Hi there,
Shannon Fang <xrfang@hotmail.com> wrote:
William Djaja Tjokroaminata <billtj@y.glue.umd.edu> writes:
Another problem about reference is that,
Hi --
[#57006] inf-ruby.el broken in version 1.7.3? — Jeff de Vries <jdevries@...>
I use emacs and run an inferior irb process within emacs (inf-ruby.el).
[#57015] simple regexp question — Shannon Fang <xrfang@...>
Hi
[#57032] A lesson learned — "Gavin Sinclair" <gsinclair@...>
Folks,
[#57043] UTF-8 "bug": not in accordance with the unicode-3 specs — "Paul Melis" <paul@...>
Hello,
[#57052] root directory — Emmanuel Touzery <emmanuel.touzery@...>
Hello,
[#57058] Re: RCR: Stack, Queue alias methods in Array — "Pe, Botp" <botp@...>
[snipped lots of good args by kent and martin]
[#57060] loop starting not from beginning — "Pe, Botp" <botp@...>
Hi Ruby friends,
[#57084] A LOGIC ANSWER TO A LOGIC PROBLEM — The Oil Group <winmillon@...>
World Events are affecting the way we live.
[#57102] Spreadsheet/Excel distro fix — Daniel Berger <djberg96@...>
All,
[#57126] Ruby Document — Shannon Fang <xrfang@...>
Hi All,
[#57131] Re: Ruby Document — "Shannon Fang" <xrfang@...>
Thanks Ts. Still not sure. Please read below:
[#57138] Re: Ruby Document — "Shannon Fang" <xrfang@...>
Hi TS,
[#57146] Ruby ++, the one element and generators — "MikkelFJ" <mikkelfj-anti-spam@...>
The problem is simple:
> No, we couldn't! The only reason anyone wants a "++" operator is because
[#57167] Scalars — Daniel Carrera <dcarrera@...>
In Ruby, do you use the world "scalar" as it's used in Perl? (variables
Hi --
> > In Ruby, do you use the world "scalar" as it's used in Perl? (variables
[#57172] Numerical Ruby — Olivier Saut <Olivier.Saut@...>
Hi all,
Things That Newcomers to Ruby Should Know (11/24/02)
Hi,
This is the (approximately) monthly posting of this list. I just added
minor examples to Items 11 and 17. Also note that since currently
there is some DNS problem with the "Ruby Central" site, please see the
instruction at http://www.ruby-lang.org/en/.
This list is also available in HTML format at
http://www.glue.umd.edu/~billtj/ruby.html.
Regards,
Bill
=============================================================================
Things That Newcomers to Ruby Should Know
Table of Contents
* Resources
1. Using warnings
2. Interactive shell
3. On-screen documentation
4. Class#method notation
5. Getting characters from a String
6. Array and Hash default values
7. Mutable Hash keys
8. Reading numerals from a file
9. Pre/Post Increment/Decrement Operators
10. Lexical scoping in blocks
11. Two sets of logical operators
12. The === operator and case statements
13. White space
14. The "dot" method call operator
15. Range objects
16. Boolean values
17. Variables, references, and objects
18. Deep copy
19. Class variables
20. Substituting Backslashes
* Things That Are Good to Know :-)
_________________________________________________________________
* Resources:
+ HOME PAGE: http://www.ruby-lang.org/en/
+ FAQ: http://www.rubycentral.com/faq/ (original) or
http://www.rubygarden.org/iowa/faqtotum (latest)
+ PITFALL:
http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=pitfall
+ ONLINE TUTORIAL/DOC/BOOK: http://www.rubycentral.com/book/
+ VERY USEFUL HINTS:
o "Programming Ruby" book by David Thomas and Andrew Hunt,
"When Trouble Strikes" Chapter, "But It Doesn't Work"
Section
o "The Ruby Way" book by Hal Fulton, Chapter 1: "Ruby In
Review"
1. Use "ruby -w" instead of simply "ruby" to get helpful warnings. If
not invoking "ruby" directly, you can set the environment variable
RUBYOPT to 'w':
+ win32:
C:\> set RUBYOPT=w
or
pressing F5 (to execute) in the Scite editor will give you
warnings
(and F4 will position at problematic line).
+ unix:
sh# export RUBYOPT="w"
or
csh# setenv RUBYOPT "w"
2. Ruby has an interactive shell; try to invoke the command "irb"
instead of "ruby". "irb" is best used for experimenting with the
language and classes; you may try things out in this environment
before putting them in your programs.
3. For convenient on-screen Ruby documentation, consider to use (and
install, if necessary) "ri"
(http://www.pragmaticprogrammer.com/ruby/downloads/ri.html).
For example, too see the methods of the File class, run "ri File".
To read about its open method, type "ri File.open".
4. The notation "Klass#method" in documentation is used only to
represent an "instance method" of an object of class Klass; it is
not a Ruby syntax at all. A "class method" in documentation, on
the other hand, is usually represented as "Klass.method" (which is
a valid Ruby syntax).
5. The String#[Fixnum] method does not return the "character" (which
is a string of length one) at the Fixnum position, but instead the
ASCII character code at the position (however, this may change in
the future). Currently, to get the character itself, use
String#[Fixnum,1] instead.
Furthermore, there are additional ASCII conversion methods such as
+ Integer#chr to convert from the ASCII code to the character
65.chr # -> "A"
+ ?chr to convert from the character to the ASCII code
?A # -> 65
Using these properties, for example, some ways to get the last
character in a string is by writing "aString[-1, 1]" or
"aString[-1].chr".
6. Array.new(2, Hash.new) # -> [{}, {}]
but the two array elements are identical objects, not independent
hashes. To create an array of (independent) hashes, use the "map"
or "collect" method:
arr = (1..2).map {Hash.new}
Similarly, when creating a hash of arrays, probably the following
is not the original intention:
hsh = Hash.new([])
while line = gets
if line =~ /(\S+)\s+(\S+)/
hsh[$1] << $2
end
end
puts hsh.length # -> 0
One correct and concise way is to write "(hash[key] ||= []) <<
value", such as
hsh = Hash.new
while line = gets
if line =~ /(\S+)\s+(\S+)/
(hsh[$1] ||= []) << $2
end
end
7. Be careful when using "mutable" objects as hash keys. To get the
expected result, call Hash#rehash before accessing the hash
elements. Example:
s = "mutable"
arr = [s]
hsh = { arr => "object" }
s.upcase!
p hsh[arr] # -> nil (maybe not what was expected)
hsh.rehash
p hsh[arr] # -> "object"
8. After reading data from a file and putting them into variables,
the data type is really String. To convert them into numbers, use
the "to_i" or "to_f" methods. If, for example, you use the "+"
operator to add the "numbers" without calling the conversion
methods, you will simply concatenate the strings.
An alternative is to use "scanf"
(http://www.rubyhacker.com/code/scanf).
9. Ruby has no pre/post increment/decrement operator. For instance,
x++ or x-- will fail to parse. More importantly, ++x or --x will
do nothing! In fact, they behave as multiple unary prefix
operators: -x == ---x == -----x == ......
10. Beware of the lexical scoping interaction between local variables
and block local variables. If a local variable is already defined
before the block, then the block will use (and quite possibly
modify) the local variable; in this case the block does not
introduce a new scope. Example:
(0..2).each do |i|
puts "inside block: i = #{i}"
end
puts "outside block: i = #{i}" # -> undefined `i'
On the other hand,
i = 0
(0..2).each do |i|
puts "inside block: i = #{i}"
end
puts "outside block: i = #{i}" # -> 'outside block: i = 2'
and
j = 0
(0..2).each do |i|
j = i
end
puts "outside block: j = #{j}" # -> 'outside block: j = 2'
11. In Ruby, there are two sets of logical operators: [!, &&, ||] and
[not, and, or]. [!, &&, ||]'s precedence is higher than the
assignments (=, %=, ~=, /=, etc.) while [not, and, or]'s
precedence is lower. Also note that while &&'s precedence is
higher than ||'s, the and's precedence is the same as the or's. An
example:
a = 'test'
b = nil
both = a && b # both == nil
both = a and b # both == 'test'
both = (a and b) # both == nil
12. In the case statement
case obj
when obj_1
....
when obj_k
....
it is the "===" method which is invoked, not the "==" method.
Also, the order is "obj_k === obj" and not "obj === obj_k".
The reason for this order is so that the case statement can
"match" obj in more flexible ways. Three interesting cases are
when obj_k is either a Module/Class, a Regexp, or a Range:
+ The Module/Class class defines the "===" method as a test
whether obj is an instance of the module/class or its
descendants ("obj#kind_of? obj_k").
+ The Regexp class defines the "===" method as a test whether
obj matches the pattern ("obj =~ obj_k").
+ The Range class defines the "===" method as a test whether
obj is an element of the range ("obj_k.include? obj").
13. It is advisable not to write some white space before the opening
'(' in a method call; else, Ruby with $VERBOSE set to true may
give you a warning.
14. The "dot" for method call is the strongest operator. So for
example, while in some other languages the number after the dot in
a floating point number is optional, it is not in Ruby. For
example, "1.e6" will try to call the method "e6" of the object 1
(which is a Fixnum). You have to write "1.0e6".
However, notice that although the dot is the strongest operator,
its precedence with respect to method name may be different with
different Ruby versions. At least in Ruby 1.6.7, "puts
(1..3).length" will give you a syntax error; you should write
"puts((1..3).length)" instead.
15. "0..k" represents a Range object, while "[0..k]" represents an
array with a single element of type Range. For example, if
[0..2].each do |i|
puts "i = #{i}"
end
does not give what you expect, probably you should have written
(0..2).each do |i|
puts "i = #{i}"
end
or
0.upto(2) do |i|
puts "i = #{i}"
end
instead. Notice also that Ruby does not have objects of type
"Tuple" (which are immutable arrays) and parentheses are usually
put around a Range object for the purpose of precedence grouping
(as the "dot" is stronger than the "dot dot" in the above
example).
16. In Ruby, only false and nil are considered as false in a Boolean
expression. In particular, 0 (zero), "" or '' (empty string), []
(empty array), and {} (empty hash) are all considered as true.
17. Ruby variables hold references to objects and the = operator
copies the references. Also, a self assignment such as a += b is
actually translated to a = a + b. Therefore it may be advisable to
be aware whether in a certain operation you are actually creating
a new object or modifying an existing one.
For example, string << "another" is faster than string +=
"another" (no extra object creation), so you would be better off
using any class-defined update-method (if that is really your
intention), if it exists. However, notice also the "side effects"
on all other variables that refer to the same object:
a = 'aString'
c = a
a += ' modified using +='
puts c # -> "aString"
a = 'aString'
c = a
a << ' modified using <<'
puts c # -> "aString modified using <<"
18. There is no standard, built-in deep copy in Ruby. One way to
achieve a similar effect is by serialization/marshalling. Because
in Ruby everything is a reference, be careful when you want to
"copy" objects (such as by using the dup or clone method),
especially for objects that contain other objects (such as arrays
and hashes) and when the containment is more than one level deep.
19. A class variable is in general per-hierarchy, not per-class (i.e.,
a class variable is "shared" by a parent and all of its
descendants, in addition to being shared by all instances of that
class). One subtle exception is if a child class creates a class
variable before its parent does. For example, when a parent
creates a class variable first:
class Base
def initialize; @@var = 'base'; end
def base_set_var; @@var = 'base'; end
def base_print_var; puts @@var; end
end
class Derived < Base
def initialize; super; @@var = 'derived'; end #notice
def derived_set_var; @@var = 'derived'; end
def derived_print_var; puts @@var; end
end
d = Derived.new
d.base_set_var; d.derived_print_var # -> 'base'
d.base_print_var # -> 'base'
d.derived_set_var; d.derived_print_var # -> 'derived'
d.base_print_var # -> 'derived'
In the above code, the class variable @@var is indeed "shared" by
the Base and Derived classes. However, now see what happens when a
child class creates the variable first:
class Base
def initialize; @@var = 'base'; end
def base_set_var; @@var = 'base'; end
def base_print_var; puts @@var; end
end
class Derived < Base
def initialize; @@var = 'derived'; super; end #changed
def derived_set_var; @@var = 'derived'; end
def derived_print_var; puts @@var; end
end
d = Derived.new
d.base_set_var; d.derived_print_var # -> 'derived'
d.base_print_var # -> 'base'
d.derived_set_var; d.derived_print_var # -> 'derived'
d.base_print_var # -> 'base'
In this case, the parent and child classes have two independent
class variables with identical names.
20. Substituting backslashes may be tricky. Example:
str = 'a\b\c' # -> a\b\c
puts str.gsub(/\\/,'\\\\') # -> a\b\c
puts str.gsub(/\\/,'\\\\\\') # -> a\\b\\c
puts str.gsub(/\\/,'\\\\\\\\') # -> a\\b\\c
puts str.gsub(/\\/) { '\\\\' } # -> a\\b\\c
puts str.gsub(/\\/, '\&\&') # -> a\\b\\c
Things That Are Good to Know :-)
a. In Ruby the "self assignment operator" goes beyond "+=, -=, *=,
/=, %=". In particular, operators such as "||=" also exist (but
currently not for a class variable if it is not yet defined; this
may change in the future). Please see Table 18.4 in the
"Programming Ruby" book for the complete list.
b. For a "cookbook" with many algorithm and code examples, consider
"PLEAC-Ruby" (http://pleac.sourceforge.net/pleac_ruby/t1.html).
c. For extensive numerical computations, consider "Numerical Ruby"
(http://www.ir.isas.ac.jp/~masa/ruby/index-e.html).
d. For (numerical) arrays which consume a large amount of memory
and/or CPU time, consider "NArray" which is part of the Numerical
Ruby (http://www.ir.isas.ac.jp/~masa/ruby/na/SPEC.en).
e. For speeding up some parts of your Ruby code by writing them in C,
consider "Inline" (http://sourceforge.net/projects/rubyinline/).
f. For Ruby to C translation, consider "rb2c"
(http://easter.kuee.kyoto-u.ac.jp/~hiwada/ruby/rb2c/).
g. For Ruby and C/C++ integration, consider "SWIG"
(http://www.swig.org/).
h. For Ruby and Java integration, consider "JRuby"
(http://jruby.sourceforge.net/).
i. For embedding Python in Ruby, consider "Ruby/Python"
(http://www.ruby-lang.org/en/raa-list.rhtml?name=Ruby%2FPython).
j. For embedding Lua in Ruby, consider "Ruby-Lua"
(http://ruby-lua.unolotiene.com/ruby-lua.whtm).
k. For creating a stand-alone (Windows) executable, consider "exerb"
(http://exerb.sourceforge.jp/index.en.html).
l. For manipulating raw bits, instead of using Fixnum's, consider
"BitVector"
(http://www.ce.chalmers.se/~feldt/ruby/extensions/bitvector/).
* For comments on this list, you may e-mail me directly at
billtj@glue.umd.edu.
_________________________________________________________________
Last updated: Nov 24, 2002.
This list itself is available at
http://www.glue.umd.edu/~billtj/ruby.html.
The plain text format is produced from the HTML format with "lynx
-dump -nolist" (and some minor editing).
_________________________________________________________________