[#6690] Syntax highlighting in XEmacs — "Nathaniel Talbott" <ntalbott@...>
For starters, I'm running XEmacs 21.1 on Windows 2000. I'm more new to emacs
"Nathaniel Talbott" <ntalbott@rolemodelsoft.com> writes:
On Fri, 1 Dec 2000, Dave Thomas wrote:
[#6694] Re: Syntax highlighting in XEmacs — "Conrad Schneiker" <schneik@...>
Dave Thomas writes:
[#6704] dump format error with recent snapshots — Robert Feldt <feldt@...>
Hi,
[#6714] Re: behavior of Proc#arity? — grady@... (Steven Grady)
Matz responds:
Yukihiro Matsumoto wrote:
[#6733] perl and ruby — "Joseph McDonald" <joe@...>
I'm a perl guy checking out ruby. I wanted to benchmark a few things that
[#6783] Ruby as extension lang for Java app. — rawhiteside@...
[#6789] using join() — "Joseph McDonald" <joe@...>
[#6828] The ruby way... — "Joseph McDonald" <joe@...>
[#6847] Re: Refactoring Browser. — "Conrad Schneiker" <schneik@...>
John Carter writes:
[#6874] Some performance issues — "Ben Tilly" <ben_tilly@...>
I decided to try out a few cases that I knew tend to present
[#6882] Ruby in Ruby — John Carter <john@...>
One of the Cutest things I have ever seen is the lisp interpreter in lisp.
[#6931] drb/druby docs in English? — ptkwt@...2.teleport.com (Phil Tomson)
First off, let me say that I'm a Perl person. Have been for about 6 years
[#6954] Why isn't Perl highly orthogonal? — Terrence Brannon <brannon@...>
[#6956] parallel array traversal — raja@... (Raja S.)
Is there a way to do a parallel traversal of a group of arrays in Ruby?
[#6957] return value of mutating methods — raja@... (Raja S.)
I recently came across this issue in some code I was developing.
[#6989] Ruby in the US — Terrence Brannon <brannon@...>
[#7022] Re: Ruby in the US — Kevin Smith <kevinbsmith@...>
> Is it possible for the US to develop corporate
tonys@myspleenklug.on.ca (tony summerfelt) writes:
> > first candidates would be mysql and postgressql because source is
During an idle chat with someone on IRC, they presented some fairly
Stephen White wrote:
Hello --
David Alan Black wrote:
On Wed, 20 Dec 2000, Guy N. Hurst wrote:
On Wed, 20 Dec 2000, Stephen White wrote:
David Alan Black <dblack@candle.superlink.net> writes:
David Alan Black <dblack@candle.superlink.net> wrote:
[#7049] Reading lots of binary data into arrays — Dwight Tuinstra <tuinstra@...>
I am looking to port a utility to Ruby. The problem is that
[#7080] Managing many objects, seeing wood for trees. — Hugh Sasse Staff Elec Eng <hgs@...>
I have been building up my software in ruby, and now have a number
[#7088] Re: Ruby in Ruby — "Ben Tilly" <ben_tilly@...>
Robert Feldt <feldt@ce.chalmers.se> wrote:
Dave Thomas wrote in message ...
[#7131] Re: Ruby in the US — "Ben Tilly" <ben_tilly@...>
merlyn@stonehenge.com (Randal L. Schwartz) wrote:
[#7169] Sending SMTP (was: Re: Hello and a question.) — Kevin Smith <kevins14@...>
[#7179] Problem with RDtool — pschoenb@... (Patrick Schoenbach)
[#7190] module for unix password database tasks? — Matt Harrington <matt@...>
[#7212] New User Survey: we need your opinions — Dave Thomas <Dave@...>
[#7262] Template system in Ruby (NameError) — "Joseph McDonald" <joe@...>
[#7263] more on the template system — "Joseph McDonald" <joe@...>
[#7308] RE: Packaging Ruby — Aleksi Niemel<aleksi.niemela@...>
Nolan Darilek wrote:
[#7309] Where is /pat/g (Perl) and findall() (Python)? — "Franz GEIGER" <fgeiger@...>
Wanted to do global pattern search on a string but /pat/g does not work. How
"Franz GEIGER" <fgeiger@datec.at> writes:
On Fri, 15 Dec 2000, Dave Thomas wrote:
[#7330] A Java Developer's Wish List for Ruby — "Richard A.Schulman" <RichardASchulman@...>
I see Ruby as having a very bright future as a language to
>
Hi,
matz@zetabits.com (Yukihiro Matsumoto) writes:
Hi,
[#7354] Ruby performance question — Eric Crampton <EricCrampton@...>
I'm parsing simple text lines which look like this:
Eric Crampton <EricCrampton@worldnet.att.net> writes:
On Sat, 16 Dec 2000, Dave Thomas wrote:
On Sat, 16 Dec 2000, Joseph McDonald wrote:
"Joseph McDonald" <joe@vpop.net> writes:
[#7366] GUIs for Rubies — "Conrad Schneiker" <schneik@...>
Thought I'd switch the subject line to the subject at hand.
[#7383] finding the file size — "Richard Hensh" <hensh@...>
Here's a quick question.
[#7404] Off topic: numbered Subject headers on this list — "Renaud Waldura" <renaud@...>
Are the numbered "Suject:" headers on this list absolutely necessary?
On Sat, Dec 16, 2000 at 02:36:56PM +0900, Renaud Waldura wrote:
[#7416] Re: Ruby IDE (again) — Kevin Smith <kevins14@...>
>> >> I would contribute to this project, if it
-----BEGIN PGP SIGNED MESSAGE-----
On Sat, 16 Dec 2000, Holden Glova wrote:
Stephen White writes:
Although I'm (very) new to Ruby, I have some experience building IDE's. I
>
[#7417] Is Ruby interpreted or byte-compiled? — Terrence Brannon <brannon@...>
[#7449] question: 'A'..'k' — Mathieu Bouchard <matju@...>
[#7476] Re: flatten_by(n) — "Ben Tilly" <ben_tilly@...>
David Alan Black <dblack@candle.superlink.net> wrote:
[#7506] Re: Ruby RAA — chad fowler <chadfowler@...>
[#7520] Re: Ruby RAA — "Ben Tilly" <ben_tilly@...>
"Joseph McDonald" <joe@vpop.net> wrote:
[#7570] parse.y (version "2000-12-18") — ts <decoux@...>
[#7582] New to Ruby — takaoueda@...
I have just started learning Ruby with the book of Thomas and Hunt. The
[#7600] Re: A Java Developer's Wish List for Ruby — "Conrad Schneiker" <schneik@...>
Lyle Johnson writes,
[#7604] Any corrections for Programming Ruby — Dave Thomas <Dave@...>
Hi,
-----Original Message-----
"Christoph Rippel" <crippel@primenet.com> writes:
-----Original Message-----
Okay,
"Christoph Rippel" <crippel@primenet.com> writes:
[#7609] Re: Any corrections for Programming Ruby — "Conrad Schneiker" <schneik@...>
Dave Thomas writes,
[#7624] Re: GUIs for Rubies — "Conrad Schneiker" <schneik@...>
Dave Thomas writes:
[#7659] how to timeout as system call? — ptkwt@...2.teleport.com (Phil Tomson)
[#7662] Re: GUIs for Rubies — "Conrad Schneiker" <schneik@...>
Ed Falis writes:
[#7668] Ruby and OO programming — kristoff.bonne@...
Greetings,
[#7699] moving ruby executables — "SZMURLO MAURICE" <maurice.szmurlo@...>
hello
[#7737] strange border-case Numeric errors — "Brian F. Feldman" <green@...>
I haven't had a good enough chance to familiarize myself with the code in
Hi,
Jilani Khaldi <jilanik@tin.it> writes:
Hi,
Hi,
[#7743] Re: String as IO and/or File object? — "Brian F. Feldman" <green@...>
Kevin Smith <sent@qualitycode.com> wrote:
>>>>> "Y" == Yukihiro Matsumoto <matz@zetabits.com> writes:
[#7799] Can't build Ruby 1.6.1 on Sparc Solaris 2.6 — Larry Elmore <larry.elmore@...>
Configuring Ruby seems to go smoothly with the patch for 1.6.1 for
[#7801] Is Ruby part of any standard GNU Linux distributions? — "Pete McBreen, McBreen.Consulting" <mcbreenp@...>
Anybody know what it would take to get Ruby into the standard GNU Linux
On Thu, 21 Dec 2000 07:17:39 +0900, Josh Huber wrote:
* tony summerfelt (tonys@myspleenklug.on.ca) [001221 16:11]:
[#7829] Re: Next amusing problem: talking integers (was Re: Code sample for improvement) — Kevin Smith <sent@...>
Dan Schmidt <dfan@harmonixmusic.com> wrote:
On Thu, 21 Dec 2000, Kevin Smith wrote:
Stephen White <steve@deaf.org> writes:
[#7895] Re: defined? problem? — ts <decoux@...>
>>>>> "c" == craig duncan <duncan@nycap.rr.com> writes:
[#7930] beginner's question -- hashes — John Rubinubi <rubinubi@...>
Hi again,
[#7938] Re: defined? problem? — Kevin Smith <sent@...>
matz@zetabits.com (Yukihiro Matsumoto) wrote:
Kevin Smith <sent@qualitycode.com> writes:
On Fri, 22 Dec 2000, Dave Thomas wrote:
On Fri, 22 Dec 2000, Stephen White wrote:
David Alan Black <dblack@candle.superlink.net> writes:
Hello --
> How would you do that?
[#7961] Naming of "defined?" — craig duncan <duncan@...>
Didn't i read that '?' at the end of a method name indicated a boolean
[#7971] Hash access method — Ted Meng <ted_meng@...>
Hi,
[#8022] Question about "attr_reader" on class level variables — "Thomas R.Corbin" <tc@...>
[#8030] Re: Basic hash question — ts <decoux@...>
>>>>> "B" == Ben Tilly <ben_tilly@hotmail.com> writes:
On Sun, 24 Dec 2000, ts wrote:
[#8037] String#unfreeze — ts <decoux@...>
Hi,
[#8064] Newbie — Marc Lombart <mastercougar@...>
Hi,
Marc Lombart <mastercougar@netzero.net> writes:
[#8076] Ruby glossary is now in English. — SugHimsi <manamist@...>
Ruby glossary (in English) is out.
[#8081] more beginner's questions -- creating a class — John Rubinubi <rubinubi@...>
Merry Christmas,
John Rubinubi wrote:
On Tue, 26 Dec 2000, craig duncan wrote:
[#8097] Re: How to link with Ruby interpreter? — chad fowler <chadfowler@...>
>
[#8122] Method as block to method — "Nathaniel Talbott" <ntalbott@...>
I find myself wanting to pass a method as the block to another method on a
[#8142] speedup of anagram finder — "Joseph McDonald" <joe@...>
Hi,
[#8143] CVS repository — Dave Thomas <Dave@...>
[#8161] $stderr redirection — Holden Glova <dsafari@...>
-----BEGIN PGP SIGNED MESSAGE-----
[#8164] Re: speedup of anagram finder — ts <decoux@...>
>>>>> "J" == Joseph McDonald <joe@vpop.net> writes:
[#8178] Inexplicable core dump — "Nathaniel Talbott" <ntalbott@...>
I have some code that looks like this:
Hi,
> Hmm, can you provide error reproducing script (and data)?
"Nathaniel Talbott" <ntalbott@rolemodelsoft.com> writes:
> :> I'd like to see the stacktrace too, but since you're on
[#8196] My first impression of Ruby. Lack of overloading? (long) — jmichel@... (Jean Michel)
Hello,
In article <m3ae9ggg00.fsf@qiao.localnet>,
[#8198] Re: Ruby cron scheduler for NT available — "Conrad Schneiker" <schneik@...>
John Small wrote:
Hi Conrad,
"NAKAMURA, Hiroshi" <nahi@keynauts.com> writes:
Hi Dave,
Hi All,
[#8245] use of backquotes — Holden Glova <dsafari@...>
-----BEGIN PGP SIGNED MESSAGE-----
[#8261] "Catching" "command not found" when using backquotes? — Robert Feldt <feldt@...>
Hi,
[#8287] Re: speedup of anagram finder — "SHULTZ,BARRY (HP-Israel,ex1)" <barry_shultz@...>
> -----Original Message-----
[#8322] open3 woes [sort of long] — Holden Glova <dsafari@...>
-----BEGIN PGP SIGNED MESSAGE-----
[#8328] Re: RAA-ANN: rbwrap 0.1.0 — Kevin Smith <sent@...>
Robert Feldt wrote:
[#8335] Stuck on p40 of Programming Ruby — John Rubinubi <rubinubi@...>
I'm sure I'm annoying everybody with my stupid questions. I'm sorry. Now
[#8374] Problem - CGI::Session (long) — "Guy N. Hurst" <gnhurst@...>
ref: cgi/sessions.rb and p.508 of PR book
[#8385] substitution / Ruby's RegExp's — Jens Luedicke <jens@...>
Hi there ...
[#8428] Re: string like istringstream (was: A bug inruby) — Kevin Smith <sent@...>
jmichel@schur.institut.math.jussieu.fr wrote:
[#8433] any documentation for cgi/session.rb? — Jon Aseltine <aseltine@...>
Any docs for cgi/session.rb? Or an example of its use? Failing that, can
[ruby-talk:8196] My first impression of Ruby. Lack of overloading? (long)
Hello,
I am a newbye to ruby (I looked at the newsgroup and the web pages some
weeks ago, but did not try to program until I received Dave and Andy's
book last week), although I have a long experience with many other high
and low-level languages. I give here my first impressions before I
forget them, in the hope that they may interest someone and that I may
receive some useful advice (this list seems quite friendly).
First my global impression which survived translation of some of my
scripts is that ruby is a perfect replacement for perl and python (when
translating some scripts I had only some minor annoyances; on the
other hand I could achieve some substantial improvements due to the
higher-level nature of ruby). Some of the minor annoyances were:
- I had trouble using sort! in method-chaining because
irb(main):006:0> [1,2].sort!
[1, 2]
irb(main):007:0> [1].sort!
nil
the reason why sort! does not return its result for arrays of length
1 eludes me.
- In perl, if one wants to sort according to several criteria, one can
write something like that
sort { length($a) <=> length($b) or $a cmp $b }
this does not work in ruby since 'or' behaves completely different --
it can apparently be used only in a very restricted way in boolean
expressions. The closest I could come with is:
sort {|a,b| [a.length,a]<=>[b.length,b]}
but it does not have the same effect as the perl idiom not to
evaluate the second sort criterion when the first suffices.
- I was very surprised that each_pair is not defined for arrays, only
hashes. Of course you can roll your own:
class Array
def each_pair
each_index do |i| yield(i,self[i]) end
end
end
but why is such an essential idiom not pre-defined?
- I have some problems with scopes. In particular, that one can not
define local functions. The closest I could come with is to define a
local Proc object and use .call on it. Is that the recommended way?
The main reason I looked at ruby is that I had very high hopes for this
language: my job is mathematics and I thought ruby might be well suited
for that. Mathematical programming involves defining all the time new
mathematical objects and programming usual and not so usual operations
on them. As an exercise to test ruby for that purpose, I tried to
program fractions and multivariate polynomials. I found along the way
what I perceive as a defect in ruby (lack of overloading), but other
people including matz may have another view which would interest me.
To start with my example I started with:
class Frac
attr_accessor(:num, :den)
def initialize(n,d=1)
@num,@den=n,d
simpl!
end
def simpl!
g=@num.gcd(@den)
@num/=g
@den/=g
end
def to_s
res=@num.to_s
res+="/"+@den.to_s unless @den==1
res
end
def +(other)
Frac.new(@num*other.den+@den*other.num,@den*other.den)
end
def -(other)
Frac.new(@num*other.den-@den*other.num,@den*other.den)
end
def *(other)
Frac.new(@num*other.num,@den*other.den)
end
def /(other)
Frac.new(@num*other.den,@den*other.num)
end
end
Remark that I do not derive Frac from Numeric, since I want it to work
for an arbitrary Euclidean base ring. Also I just assume that the base
ring has a method for gcd defined. If one wants to use fractions of
integers, one can write
class Integer
def gcd(b)
a=self
while b!=0
a,b=b,a.modulo(b)
end
a
end
end
Now the code above works fine as long as I work only with Fracs. Suppose
now that I want to define the addition of a Frac and an integer:
Frac.new(1,3)+2
In a language like C++, I would use overloading to add a new method for
operator + when the argument is not a Frac. But, and this is my
perceived deficiency, it seems that ruby has no such concept as
overloading. For the moment, a possible technique is to define a
conversion function:
def Frac(a)
if a.type==Frac
a
else
Frac.new(a,1)
end
end
[ by the way here is a minor gripe: I first wrote the above, envisioning the
possibility in the future of more cases, as:
case a.type
when Frac
a
else
Frac.new(a,1)
end
but this does not work, apparently because === is not defined for Class]
and use the conversion function to change my definitions to:
def +(other)
other=Frac(other)
Frac.new(@num*other.den+@den*other.num,@den*other.den)
end
But the call to Frac() is probably more overhead than kernel dispatching
by an overload mechanism. And, now, what about the other direction, i.e.:
2+Frac.new(1,3)
Here one is really at a loss without overloading: the only possible
thing to do is to redefine the method + for integers!
At that stage, I thought I would have to abandon ruby for my purposes.
However I noticed in the book the mention of a library 'Complex' and I
thought I would have a look. Well, miracle,
2+Complex(1,3)
works! This apparently uses a mechanism for which I could not find
non-Japanese documention, involving 'coerce'. If I mimic what I found in
'Complex', that is add:
def coerce(other)
[Frac.new(other), self]
end
now my example works. I would like a clear explanation of exactly what
is the mechanism here. It seems to me that the method + for integers has
a pre-defined hook to look for coerce for an unknown type. It is also
probably to provide a similar hook for future additions that in Complex
one has:
def + (other)
if other.kind_of?(Complex)
re = @real + other.real
im = @image + other.image
Complex(re, im)
elsif Complex.generic?(other)
Complex(@real + other, @image)
else
x , y = other.coerce(self)
x + y
end
end
but I feel:
-the above code is complicated, and clumsy, compared to overloading
-contrary to overloading, there is no possibility to extend an
already-existing method for an already-existing type if no hook has
been provided.
This last point bothers me: it is very nice that in ruby one can
dynamically add to a class, by reopening it. Overloading is a way to
'reopen' a method, and the possibility to reopen a class is not so
useful without it
Ok, now what did I miss, and what is the rationale for no overloading,
or the replacement for it that I missed?
P.S. Before people point it to me, I just noticed that in the library
there is a rational.rb with code similar to the one I outlined above,
excepted more complicated at places for reasons which elude me.