[#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:01352] Re: Say Hi

From: matz@... (Yukihiro Matsumoto)
Date: 2000-02-15 00:47:28 UTC
List: ruby-talk #1352
In message "[ruby-talk:01347] Say Hi"
    on 00/02/15, Clemens Hintze <c.hintze@gmx.net> writes:

|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.

A few months ago, a proposal to make pop(n) to pop out n elements in
array is proposed in Japanese list.  We discussed it, and abandoned
for argument ambiguity.  Ted's proposal confirms it.

|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.

Array#delete_at accepts negative index already.

  a = [1,2,3]
  a.delete_at(-1)
  p a  # => [1,2]

In development version 1.5, we provide a new method slice/slice! to
remove elements, that accepts same arguments like [], which works just
like:

  def slice!(*args)
    result = self[*args]
    self[*args] = []
    result
  end

  def slice(*args)
    self.dup.slice!(*args)
  end


							matz.

In This Thread

Prev Next