[#1263] Draft of the updated Ruby FAQ — Dave Thomas <Dave@...>

33 messages 2000/02/08

[#1376] Re: Scripting versus programming — Andrew Hunt <andy@...>

Conrad writes:

13 messages 2000/02/15

[#1508] Ruby/GTK and the mainloop — Ian Main <imain@...>

17 messages 2000/02/19
[#1544] Re: Ruby/GTK and the mainloop — Yasushi Shoji <yashi@...> 2000/02/23

Hello Ian,

[#1550] Re: Ruby/GTK and the mainloop — Ian Main <imain@...> 2000/02/23

On Wed, Feb 23, 2000 at 02:56:10AM -0500, Yasushi Shoji wrote:

[#1516] Ruby: PLEASE use comp.lang.misc for all Ruby programming/technical questions/discussions!!!! — "Conrad Schneiker" <schneiker@...>

((FYI: This was sent to the Ruby mail list.))

10 messages 2000/02/19

[#1569] Re: Ruby: constructors, new and initialise — Yukihiro Matsumoto <matz@...>

The following message is a courtesy copy of an article

12 messages 2000/02/25

[ruby-talk:01347] Say Hi

From: Clemens Hintze <c.hintze@...>
Date: 2000-02-14 23:33:48 UTC
List: ruby-talk #1347
mengx@nielsenmedia.com writes:
> Hi:

Hi too,

may I take this opportunity to welcome you here? It is fine to see,
how fast the Ruby community seems to grow :-)

> I Studied Ruby's document and coding for about two days and decided
> to start using Ruby even though I have used Python for 5 years,
> among other languages. In my opinion, Ruby is what Python 3000
> should be if all these $$$$ can be removed :-) (for some reason, I
> never like $$$$ so I chose Python (also due to neat syntax) over
> Perl).  Ruby is ultimate dynamic language.

You have nearly the same background like me! I am also coming from
Perl->Python->Ruby! And I have to recognize ever and ever again *how*
dynamically Ruby is, indeed. After a year of usage, there are still
some facts that surprise me yet! :-)

> Just a quick thought after going through Array class, would it be
> possible to revise the pop and push method to accept index argument
> such that pop(0) act like shift and pop(-1) like current pop push
> (obj, 0) like unshift and push(obj, -1) like current push.  shift
> and unshift are too Perlitical :-). I know I can subclass it, but
> having it builtin would be better.
> 

I beg pardon, but I would not like it! I think it is not too good to
have too multifunctional methods. Every method should has its
behavior. push and pop are used to handle an Array like a stack not
for indexing it. shift and unshift do the same but from the opposite
end. They are not necessarily coming from Perl. Nearly all UNIX shells
treat them like Perl. I assume Perl has taken that behavior from the
UNIX shells.

IMHO, it would be better to allow Array::delete_at to receive also
negative arguments like Array::[]. If it would do, it would really be
what you want to have. Then you could use:

   arr = [9,8,7,6]
   first = arr.delete_at(0)    # first element assigned and deleted
   last = arr.delete_at(-1)    # last element now.
   p arr                       # would print [8,7]

What do you think about it?

> Thanks 
> 
> -Ted Meng

\cle

-- 
Clemens Hintze  mailto: c.hintze@gmx.net

In This Thread