[#10209] Market for XML Web stuff — Matt Sergeant <matt@...>

I'm trying to get a handle on what the size of the market for AxKit would be

15 messages 2001/02/01

[#10238] RFC: RubyVM (long) — Robert Feldt <feldt@...>

Hi,

20 messages 2001/02/01
[#10364] Re: RFC: RubyVM (long) — Mathieu Bouchard <matju@...> 2001/02/05

[#10708] Suggestion for threading model — Stephen White <spwhite@...>

I've been playing around with multi-threading. I notice that there are

11 messages 2001/02/11

[#10853] Re: RubyChangeRequest #U002: new proper name for Hash#indexes, Array#indexes — "Mike Wilson" <wmwilson01@...>

10 messages 2001/02/14

[#11037] to_s and << — "Brent Rowland" <tarod@...>

list = [1, 2.3, 'four', false]

15 messages 2001/02/18

[#11094] Re: Summary: RCR #U002 - proper new name fo r indexes — Aleksi Niemel<aleksi.niemela@...>

> On Mon, 19 Feb 2001, Yukihiro Matsumoto wrote:

12 messages 2001/02/19

[#11131] Re: Summary: RCR #U002 - proper new name fo r indexes — "Conrad Schneiker" <schneik@...>

Robert Feldt wrote:

10 messages 2001/02/19

[#11251] Programming Ruby is now online — Dave Thomas <Dave@...>

36 messages 2001/02/21

[#11469] XML-RPC and KDE — schuerig@... (Michael Schuerig)

23 messages 2001/02/24
[#11490] Re: XML-RPC and KDE — schuerig@... (Michael Schuerig) 2001/02/24

Michael Neumann <neumann@s-direktnet.de> wrote:

[#11491] Negative Reviews for Ruby and Programming Ruby — Jim Freeze <jim@...> 2001/02/24

Hi all:

[#11633] RCR: shortcut for instance variable initialization — Dave Thomas <Dave@...>

13 messages 2001/02/26

[#11652] RE: RCR: shortcut for instance variable initialization — Michael Davis <mdavis@...>

I like it!

14 messages 2001/02/27

[#11700] Starting Once Again — Ron Jeffries <ronjeffries@...>

OK, I'm starting again with Ruby. I'm just assuming that I've

31 messages 2001/02/27
[#11712] RE: Starting Once Again — "Aaron Hinni" <aaron@...> 2001/02/27

> 2. So far I think running under TextPad will be better than running

[#11726] Re: Starting Once Again — Aleksi Niemel<zak@...> 2001/02/28

On Wed, 28 Feb 2001, Aaron Hinni wrote:

[ruby-talk:11367] Palindromes, $/, chomp, and lesser surprises.

From: Jonathan Feinberg <jdf@...>
Date: 2001-02-23 07:40:03 UTC
List: ruby-talk #11367
I have written my first Ruby program, a translation of a Perl program
I had written to find all of the palindromes in a word list.

   def make_regex(length)
     re = '^'
     re += '(.)' * (length / 2)
     re += '.' if length % 2 > 0
     (length/2).downto(1) {|i| re += "\\#{i}" }
     re += '$'
     Regexp.new(re, 'i')
   end

   recache = []
   while gets
     chop!
     length = $_.length
     recache[length] ||= make_regex(length)
     print $_, "\n" if recache[length] =~ $_
   end

I had originally tried to use chomp! rather than chop!, as my Perl
background led me to expect that $/ would be set in a
platform-appropriate way (i.e., "\r\n" on my Win32 box), and that
chomp! would therefore strip $_ as I expected.  If I were explicitly
to set $/, my script would break on a platform that uses "\n" to
separate lines.

Reading about the chop/chomp family at our Pragmatic friends' site led
me to understand the special behavior of chop; now the program works
just fine (and runs a good deal faster than the Perl equivalent, for
what it's worth).

Now, if chomp means "safely deal with end-of-line cruft", and chop
means "remove the last character, period", then one could argue that
to have chop handle the special case of Win32-esque line endings
violates the principle of least surprise.  Any comments?

Also, I'm curious as to which idiom is more Rubyish: "while gets" or
"ARGF.each { |line| #block }".  Do the two have different
implications?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf

In This Thread

Prev Next