[#8566] Visions for 2001/1.7.x development? — Robert Feldt <feldt@...>

Hi matz and other Ruby developers,

18 messages 2001/01/03
[#8645] Re: Visions for 2001/1.7.x development? — matz@... (Yukihiro Matsumoto) 2001/01/04

Hi,

[#8580] bug?? — jmichel@... (Jean Michel)

I don't understand the following behaviour:

19 messages 2001/01/03

[#8633] Interesting Language performance comparisons - Ruby, OCAML etc — "g forever" <g24ever@...>

13 messages 2001/01/04

[#8774] No :<, :>, etc. methods for Array — "Brian F. Feldman" <green@...>

So, why not include Comparable in Array by default? It shouldn't have any

28 messages 2001/01/07
[#8779] Re: No :<, :>, etc. methods for Array — matz@... (Yukihiro Matsumoto) 2001/01/07

Hi,

[#8780] Re: No :<, :>, etc. methods for Array — "Brian F. Feldman" <green@...> 2001/01/07

matz@zetabits.com (Yukihiro Matsumoto) wrote:

[#8781] Re: No :<, :>, etc. methods for Array — gotoken@... (GOTO Kentaro) 2001/01/07

In message "[ruby-talk:8780] Re: No :<, :>, etc. methods for Array"

[#8782] Re: No :<, :>, etc. methods for Array — "Brian F. Feldman" <green@...> 2001/01/07

gotoken@math.sci.hokudai.ac.jp (GOTO Kentaro) wrote:

[#8829] Sandbox (again) — wys@... (Clemens Wyss)

Hi,

20 messages 2001/01/08
[#8864] Re: Sandbox (again) — Clemens Hintze <c.hintze@...> 2001/01/08

On 8 Jan, Clemens Wyss wrote:

[#8931] String confusion — Anders Bengtsson <ndrsbngtssn@...>

Hello everyone,

21 messages 2001/01/09
[#8937] Re: String confusion — matz@... (Yukihiro Matsumoto) 2001/01/09

Hi,

[#8953] Please remove account from files — "Thomas Daniels" <westernporter@...>

Please take my e-mail address from your files and "CANCEL" my subscription to "Ruby-Talk". Ruby is not right for what I do. The "Bulk Mail" is overwhelming. Please, no more e-mail! Thank you! yours truly, Stan Daniels

14 messages 2001/01/09
[#8983] Re: Please remove account from files — John Rubinubi <rubinubi@...> 2001/01/10

On Wed, 10 Jan 2001, Thomas Daniels wrote:

[#9020] time to divide -talk? (was: Please remove account from files) — Yasushi Shoji <yashi@...> 2001/01/10

At Wed, 10 Jan 2001 14:23:30 +0900,

[#9047] Re: time to divide -talk? (was: Please remov e account from files) — Aleksi Niemel<aleksi.niemela@...>

Yasushi Shoji:

27 messages 2001/01/10
[#9049] Re: time to divide -talk? — Yasushi Shoji <yashi@...> 2001/01/10

At Thu, 11 Jan 2001 00:20:45 +0900,

[#9153] what about this begin? — Anders Strandl Elkj誡 <ase@...> 2001/01/11

[#9195] Re: Redefining singleton methods — ts <decoux@...>

>>>>> "H" == Horst Duch=EAne?= <iso-8859-1> writes:

10 messages 2001/01/12

[#9242] polymorphism — Maurice Szmurlo <maurice@...>

hello

73 messages 2001/01/13

[#9279] Can ruby replace php? — Jim Freeze <jim@...>

When I read that ruby could be used to replace PHP I got really

15 messages 2001/01/14

[#9411] The Ruby Way — "Conrad Schneiker" <schneiker@...>

As a member of the "Big 8" newsgroups, "The Ruby Way" (of posting) is to

15 messages 2001/01/17

[#9462] Re: reading an entire file as a string — ts <decoux@...>

>>>>> "R" == Raja S <raja@cs.indiana.edu> writes:

35 messages 2001/01/17
[#9465] Re: reading an entire file as a string — Dave Thomas <Dave@...> 2001/01/17

raja@cs.indiana.edu (Raja S.) writes:

[#9521] Larry Wall INterview — ianm74@...

Larry was interviewed at the Perl/Ruby conference in Koyoto:

20 messages 2001/01/18
[#10583] Re: Larry Wall INterview — "greg strockbine" <gstrock@...> 2001/02/08

Larry Wall's interview is how I found out

[#9610] Re: 101 Misconceptions About Dynamic Languages — "Ben Tilly" <ben_tilly@...>

"Christian" <christians@syd.microforte.com.au> wrote:

13 messages 2001/01/20

[#9761] Re: 101 Misconceptions About Dynamic Languages — ts <decoux@...>

>>>>> "C" == Christoph Rippel <crippel@primenet.com> writes:

16 messages 2001/01/23

[#9792] Ruby 162 installer available — Dave Thomas <Dave@...>

15 messages 2001/01/24

[#9958] Re: Vim syntax files again. — "Conrad Schneiker" <schneik@...>

Hugh Sasse wrote:

14 messages 2001/01/26
[#10065] Re: Vim syntax files again. — Hugh Sasse Staff Elec Eng <hgs@...> 2001/01/29

On Sat, 27 Jan 2001, Conrad Schneiker wrote:

[#9975] line continuation — "David Ruby" <ruby_david@...>

can a ruby statement break into multiple lines?

18 messages 2001/01/27
[#9976] Re: line continuation — Michael Neumann <neumann@...> 2001/01/27

On Sat, 27 Jan 2001, David Ruby wrote:

[#9988] Re: line continuation — harryo@... (Harry Ohlsen) 2001/01/28

>A statement break into mutliple lines if it is not complete,

[ruby-talk:8661] Re: Visions for 2001/1.7.x development?

From: "Nathaniel Talbott" <ntalbott@...>
Date: 2001-01-05 03:15:40 UTC
List: ruby-talk #8661
> About minor changes, I haven't decided about most of them (yet most of
> my ideas listed in ToDo list).  It's up to you (i.e. community).
> Let's discuss what you want to see in the future.

Don't know about minor, but a couple of feature I've been thinking about...

First feature: Overloading based on number of arguments

I fully understand and embrace (and love) the typeless nature of Ruby, and
the fact that method overloading based on type is not possible due to it. I
seem to keep running into instances where I'd like to overload based on
number of arguments, though. Currently there are several things that can get
you close, including:

	* methods with different names
	* default values
	* variable length arguments
	* keyword arguments?

It isn't that these things won't work, but each one feels inelegant in
certain situations. I'll deal with them in order. The first one is fine if
the two methods do different things, but if their behavior is basically the
same and only their arguments are different, I'd like to use the same name.
The second one is great as long as it's the last argument(s) that you want
to leave out, but if 'natural argument ordering' (i.e. I like it better at
the beginning :) puts the optional argument at the beginning, no such luck.
The third solution works, but it clutters up my code with a lot of argument
processing stuff.

As far as keyword arguments go, I don't know if we'll be able to re-order
arguments if we use keywords. If yes, then they'll work OK, but there is
still the issue that with a frequently used function it requires the entry
of the keyword every time.

I guess I feel that being able to overload based on number of arguments
would increase the raw clarity, elegance, and forthrightness of my code.

OTOH, there are definitely ambiguity issues (regarding variable length
arguments), as well as the fact that it requires you to know the number of
arguments in order to re-def a method later on (to avoid just overloading
it). It could also be (mis|over)used, but that's true to some extent with
any feature.

So my questions for this one are:
1. Is it at all feasible?
2. What are the reprecussions?
3. Does it add enough benefit to do it?
4. Does anyone else find themselves wanting to do this?


Second feature: Ability to override method creation

I was thinking about the previous feature, and naively thought that I might
be able to implement it myself, perhaps as a mixin. What I wanted to be able
to do was something like this:

def MyClass
	include NumberOverloadable

	def method
		puts("No arguments")
	end
	def method(argument1)
		puts("One argument")
	end
	def method(argument1, argument2)
		puts("Two arguments")
	end
end

The module NumberOverloadable would trap the method definition and if the
method was already defined, would first check to see if the method should be
overloaded, and if yes, it would transparently build a dispatching method,
so you would end up with:

MyClass.public_instance_methods => ["method", "_method0", "_method1",
"_method2"]

where "method" would take in variable arguments and then dispatch to the
proper "_method{x}".

The only problem is, it doesn't look like there is a way to trap the
definition of a method, and I also can't seem to find a way to define a
method dynamically. It seems that this is a 'special' thing in Ruby, as
opposed to just another operation on an object. My (probably naive) feature
request is to make defining a method just an operation on a Module, as
opposed to a 'special' behavior that can't be modified/overridden.

So,
1. Is it feasible?
2. Is it desirable?


Just ideas... I'm curious to hear everybody else's thoughts on them.


Nathaniel

<:((><
+ - -						+ - -
| RoleModel Software, Inc. &		| EQUIP VI
| The XP Software Studio(TM)		|

In This Thread