[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:01954] Re: Ruby Syntax similar to other languages?

From: "Conrad Schneiker" <schneiker@...>
Date: 2000-03-17 08:09:09 UTC
List: ruby-talk #1954
From: Yukihiro Matsumoto <matz@netlab.co.jp>

> In message "[ruby-talk:01896] Ruby Syntax similar to other languages?"
>     on 00/03/16, "David Douthitt" <DDouthitt@cuna.com> writes:
>
> |as a veteran vi user (and sed user) it was nothing for me to adjust to
> |
> |     foo = s/this/that/g;
> |
> |but now with Ruby it seems this is
> |
> |     foo.gsub!(/this/, "that")
> |
> |what?  And if I don't want the "g" option, it's a completely different
> |function:
> |
> |    foo.sub!(/this/, "that")
> |
> |and if I don't want the original to be modified:
> |
> |    foo.sub(/this/, "that")
> |
> |Can someone explain why all this is?  There must be a method to this
madness....
> |pun intended?
>
> sub/gsub is from awk.  ! is inspired from scheme.

This is one place where I would very much prefer a vi/sed/perl scheme!

Is it possible to add something (standard) so that we could do:

foo.s
foo.s!

with an optional extra parameter string for perl-ish modifier characters
such as "g"?

Conrad

In This Thread