[#2617] irb for 1.5.x — Andrew Hunt <Andy@...>
5 messages
2000/05/03
[#2639] OT: Japanese names — Dave Thomas <Dave@...>
4 messages
2000/05/09
[#2643] Ruby Toplevel — Dave Thomas <Dave@...>
7 messages
2000/05/09
[#2656] Re: Append alias for Array.append? — Aleksi Niemel<aleksi.niemela@...>
Hideto ISHIBASHI:
5 messages
2000/05/09
[#2660] win OLE / eRuby — Andrew Hunt <Andy@...>
8 messages
2000/05/09
[#2663] Re: win OLE / eRuby — Aleksi Niemel<aleksi.niemela@...>
>At Tue, 9 May 2000 09:14:51 -0400,
4 messages
2000/05/09
[#2667] The reference manual is now online — Dave Thomas <Dave@...>
6 messages
2000/05/09
[#2668] Re: The reference manual is now online — schneik@...
4 messages
2000/05/09
[#2702] Re: Append alias for Array.append? — Andrew Hunt <andy@...>
>From: Aleksi Niemel<aleksi.niemela@cinnober.com>
7 messages
2000/05/10
[#2752] RE: Array.pop and documentation [was: Append al ias for Array.append?] — Aleksi Niemel<aleksi.niemela@...>
6 messages
2000/05/11
[#2758] Re: irb install — Andrew Hunt <andy@...>
>|Excellent! Will you consider adding mod_ruby to install_app as
7 messages
2000/05/11
[#2777] Re: irb install
— "NAKAMURA, Hiroshi" <nakahiro@...>
2000/05/12
Hi,
[#2764] More code browsing questions — Albert Wagner <alwagner@...>
I see some class definitions contain "include" and "extend" statements.
6 messages
2000/05/12
[#2843] Re: editors for ruby — "Conrad Schneiker" <schneiker@...>
(Posted on comp.lang.ruby and ruby-talk ML.)
6 messages
2000/05/17
[#2874] RE: simple httpd for local use — Aleksi Niemel<aleksi.niemela@...>
> I personally use it for access to full-text indexed linux
6 messages
2000/05/18
[#2875] Re: simple httpd for local use
— hipster <hipster@...4all.nl>
2000/05/18
On Thu, 18 May 2000 09:10:28 +0200, Aleksi Niemelwrote:
[#2920] SWIG: virtual variable? — Yasushi Shoji <yashi@...>
hello,
4 messages
2000/05/22
[#2928] FYI: What our Python friends are up to. — "Conrad Schneiker" <schneiker@...>
Hi,
8 messages
2000/05/22
[#2964] Thank you — h.fulton@...
Thanks, Matz (and others) for your replies to
4 messages
2000/05/24
[#2973] Re: Socket.getnameinfo — ts <decoux@...>
>>>>> "D" == Dave Thomas <Dave@thomases.com> writes:
10 messages
2000/05/25
[#3016] rbconfig.rb — Dave Thomas <Dave@...>
5 messages
2000/05/28
[#3039] Re: Final for World Series: Python vs Ruby — "Dat Nguyen" <thucdat@...>
1 message
2000/05/30
[#3058] FailureClass? — Aleksi Niemel<aleksi.niemela@...>
Question arising from the FAQ:
7 messages
2000/05/31
[ruby-talk:02713] Re: Append alias for Array.append?
From:
Aleksi Niemel<aleksi.niemela@...>
Date:
2000-05-10 17:04:46 UTC
List:
ruby-talk #2713
Conrad:
> I'd prefer to stick with the briefer push/pop terminology, to facilitate
> easier understanding of each-other's programs, and to not complicate the
> language when the payoff is not clearly positive for most people.
This is true and something I can't value easily. It's great to have you
people around.
> While it may be nice to make things easy for Python converts, the Perl
> community is vastly larger and probably ought to take priority, and it is
> used to push/pop.
Actually I'm coming more from the Perl world and Array.append suits me way
better than push, which I would use only when I think I'm working with
stack.
The stack metaphore works well when you insert more data to your structure.
But it fails with big bang when you use the same datastructure few lines
below in an ordered loop like
@array = ($foo);
$stack = \@array;
push( @{$stack}, $bar );
for $obj (@array){ }
or even worse, accessing it randomly.
If there's no 'append' I would use '<<' but it doesn't have OTOH the same
functionality. array.append(1,2,3) should be array << 1 << 2 << 3. (And then
one more point is the readibility issue for newcomers from C++ world ;=).
So I'd forced to use push, just like with Perl :).
> Speaking of two points of view here, I just noticed that it is very ironic
> that append/remove_from_end are a *horizontal* view (with respect to text
> operations or Lisp list operations), yet arrays or vectors in math,
> physics, and engineering are commonly written and visualized *vertically*.
Excellent point. This topic has been under looking glass earlier too. And if
Ruby seeks some point of reference or just plain excellence here, APL would
be the way to go. (If I recall correctly.) One of APL's not so joyful sides
were the fact that some quite experienced coder could try to figure out four
hours for four lines of code. Well, for some people that is about the best
use for freetime ;-).
For 'prepend axis' Conrad comments
> I hope you really meant to say just a
> different (-: inverse) *direction*".
Yes, that's what I meant. Not actually real axis :).
> > maybe Array should implement more than Enumerable.
> > Maybe there's need for module Stack where push and pop are coming
> > from, and Vector where append etc. reside.
> >
> > I think Java uses Vector.addElement, .removeElement.
>
> I'd prefer not to propagate unnecessary complicating superficial
> differences that were the unintended products of deep
> historical coincidences.
I can't figure out which part you meant with 'complicating superficial
differences'. If it were for Java I agree. If you objected other
'interfaces',
like Stack, I would like to reconsider.
And now I see that I made big mistake here. I'm not totally familiar with
mix-ins yet, but when I wrote my mail I meant 'implement interface'.
Enumerable on the other hand is just a mix-in class providing nice
functionality which depends on class own functionality (like each).
While I think it's easier to say
class MyExtremelyComplicatedDataStructure < Weirdo
# but don't be afraid, most of the time you can use
# this class as simply as a any Stack
include_interface "Stack";
end
we bang our head to the wall, since we can only have mix-in classes or real
inheritance. Now, my class inherits already (so I can't inherit it
additionally from Stack-interface), and we can't make mix-in which requires
something simple from class (mix-in module function Stack.push calling
class' push is not reasonable).
So maybe you're right, there's no way to be explicit about underlying
interfaces. Thus MyExtremeExample can't act like a stack publicly, *stating
it*, for
def functionality_using( stack )
end
- Aleksi