19994-21355 subjects 20345-21580

Ruby article example suggestion
20178 [YuriLeikind@] As soon as Joshua Drake is writing an article

++ Operator
20183 [kamphausen@n] Dear Community,
+ 20186 [decoux@mo lo] See
| 20191 [gc@ma dr ke ] Ok, the explanations are very understandable.
| 20195 [matz@ru y- a] It's possible.  But do you think this is what you really want?
| + 20203 [gc@ma dr ke ] Maybe I just don't see the future problems, but I think it would not be
| | + 20204 [pbrannan@at ] Not to mention that a += 1 is less efficient (in terms of speed) than a =
| | | 20217 [mikkelj-anti] increment
| | + 20248 [ugly-daemon@] I agree with you here. I would like to see "++" as an opertor that can be
| + 20206 [Dave@Pr gm t] Is there any logical difference between a++ and a.succ!
|   20230 [matz@ru y- a] The difference is the fact that since Numeric is immutable, a.succ! is
|   20234 [Dave@Pr gm t] OK, but... (this is where I make a fool of myself).
|   + 20235 [nat.pryce@b1] I would say that it's a bit of both... immutability is a fundamental
|   | 20238 [Dave@Pr gm t] Yup. Good example.
|   + 20236 [matz@ru y- a] You sacrifice yourself for the sake of our enlightnment, don't you?
|     + 20240 [Dave@Pr gm t] I agree. In the back of my mind, I was thinking about the slightly
|     | 20251 [csawtell@pa ] Made my day after an `interesting' meeting this afternoon.
|     + 20256 [csawtell@pa ] Might I just say that the first thing which attracted me to Ruby is its
+ 20187 [pbrannan@at ] There are cases where a preincrement and postincrement oprator would be
+ 20189 [matz@ru y- a] "++" in C/C++ is fundamentally an assignment, or in other words, an
| 20207 [larsch@cs au] I don't think of ++ as an assignment, as much as a "modification" to what
| + 20208 [ r2d2@um .s ] I could live with this.
| + 20231 [matz@ru y- a] Ah, so you want integers to be mutable?  And it may result
| + 20281 [szegedy@or u] I proposed about the same thing in May (See mail 15166,15197,15262 and
+ 20258 [kamphausen@n] Dear Ruby Community,

Re: Installing ruby in office environments which ...
20193 [Ephaeton@gm ] Same thing here ;)
20219 [sascha@me a-] Absolutely.  Code will be read many more times than it will be written

Bug in require?
20198 [pbrannan@at ] FOO1 = 1
+ 20200 [Dave@Pr gm t] In rubicon I use
+ 20201 [neumann@s- i] Put the current directory before any other

cygwin and win32 interaction (RE:  Re: Bug in re quire?)
20202 [cbroult@sa i] ...

In Ruby 0 is true but nil is false.. or how to shoot yourself?..
20209 [gc@ma dr ke ] I have a simple Audio-CD database (using CSV format). I was writing a
+ 20211 [ms@ia ta e. ] By "inconsistency", do you mean with other languages?
| 20223 [jweirich@on ] I occasionally follow the Python newsgroup.  Late last year the
| + 20224 [paulp@Ac iv ] How is it useful to know the complete set of things that are false in the world?
| | + 20226 [rtarpine@ho ] In Ruby, it should be the to_b message, right?  Obviously, we have to_i,
| | + 20227 [jweirich@on ] the "objects" that act like "false".  But I think its important to
| + 20276 [gc@ma dr ke ] I didn't suggest making more things false.
|   + 20277 [   xm@w3 .r ] I'm against any changes ... it is a very consistent scheme, maybe not so
|   + 20282 [szegedy@or u] ...
+ 20213 [Dave@Pr gm t] Try 'nonzero?'
  20278 [gc@ma dr ke ] Thanks a bunch Dave! As usual, you got the perfect solution..

Inherit singleton method?
20210 [mguay@ce ep ] I'm a newbie in Ruby, exploring the language from early this summer with the
20215 [avi@be a4 co] otherObject = x.clone
20239 [mguay@ce ep ] First, thank you for your prompt response
20242 [avi@be a4 co] Well, you could always invoke the initialize method explicitly.

Lazy computation (was: breaking out of nested loops)
20212 [marick@vi ib] Here's one. This one has ruby-unit tests, so is more likely to work. It's
+ 20270 [pit@ca it in] thanks for the code. I like it. It looks very much like my Iterator
+ 20271 [pit@ca it in] thanks for the code. I like it. It looks very much like my Iterator

Sigh! I should have seen it coming...A ramble on coroutines, shifts and deques
20220 [john.carter@] I was playing with doing a very simple recursive descent parser....

Example 1: Was Ruby Article
20221 [jd.nospam@co] First let me thank everyone who is responding. This is excellent. I have
20237 [Dave@Pr gm t] 1. It crashes if the user enters an end of file
+ 20241 [spwhite@ch r] *         line = gets
| 20243 [Dave@Pr gm t] Yes - I didn't catch them all in the copy :)
+ 20252 [jd.nospam@co] Do you mean if they hit ctrl-d? Or when they type END. When I run the
  20285 [Dave@Pr gm t] 'gets' returns nil on end of file (probably ^d on your box). That's

ordered hash
20225 [joe@vp p. et] Hash.each { } will return items in the order that they were
+ 20266 [pit@ca it in] I once implemented an OrderedHash, but it was ordered according
+ 20279 [maki@in c. o] Do you see PseudoHash in RAA?
  20505 [neumann@s- i] You can also use Array#assoc to implement an ordered hash.
  20551 [rtarpine@ho ] class OrderedHash < Hash
  20595 [irving_1@co ] Very nice. I remember thinking earlier on this thread that automatically
  20598 [spwhite@ch r] There's a bug in this as it stands...

ruby accessing variables it doesn't need to?
20228 [joe@vp p. et] module Kernel
20229 [joe@vp p. et] module Kernel
20232 [spwhite@ch r] Having mail problems, so you may see this 3 times or not at all. I give
20233 [joe@vp p. et] I just got one copy of this message :-)
20275 [cbroult@sa i] ...

Re: ++ operator
20250 [ugly-daemon@] I just remembered that we can't name a method "++" and so my behaviour
20253 [knos@fr e. r] ..-
20257 [ugly-daemon@] I am aware of that :). What I had suggested was adding it in as a behaviour
20260 [knos@fr e. r] ..-

20254 [michael.husm] I am reading a 55MB ASCII file  by using File.readline(s) which takes on
+ 20255 [matz@ru y- a] There must be some bottleneck left, probably due to my stupidity.
| 20259 [Michael.Husm] lines = None
| + 20481 [joe@vp p. et] n = 0; File.open(name).each { n += 1 }
| | 20506 [neumann@s- i] IO.foreach(name){}; $.
| | 20511 [cbroult@sa i] ...
| + 20500 [michael.husm] Thank you for the hint. But my question was not how to determine the number of lines or the file length but to read a file
|   20501 [Dave@Pr gm t] ios.sysread( anInteger ) -> aString
|   20502 [dsafari@xt a] Perhaps, but surely that is what the previous code is doing, simple
+ 20353 [sean@ch tt n] Tight iterations?  Turn of garbage collection before you do the=20

20261 [edsin@sw s. ] I was wondering why Ruby methods and classes lack documentation
20263 [matz@ru y- a] I think it's the responsibility of tools like IDE or ri.  Have you
20264 [edsin@sw s. ] No, I haven't, but as I got from your and other posts it's some kind
20323 [matz@ru y- a] Yes, indeed.  Docstring is for man (or woman), so that - I think -

Solaris: "getaddrinfo: DNS temporary failure"
20265 [wys@he bl ng] my client/server-ruby-appl used to run (until I installed the latest

How to decrypt a string?
20267 [martin@zs fh] This will likely turn out to be a dumb question, but is there any way to
20268 [erik@ba fo s] Not is String#crypt is the same as crypt(3) which I guess it is.
+ 20273 [fritz.heinri] One way encryption is very secure (but a little useless :-). It is a
| 20408 [erik@ba fo s] And that's pretty much the same thing :)
+ 20274 [   xm@w3 .r ] Yeah, it maybe used for things like password comparison though - you have
  20284 [neumann@s- i] s, j, k = (0..255).to_a, 0, (ARGV[0]*256)[0,256].unpack('C*')

how to "eval" mini ruby ?
20269 [domingo@da -] I'm doing a web application and I want provide a "mini ruby" interpreter for users.

64 bit ruby under aix 4.3
20272 [szegedy@or u] I am currently trying to compile ruby under AIX for 64-bits.
20436 [matz@ru y- a] This indicates global variable rb_gc_stack_start is 0. Hmm, strange..

ODBC under Debian Linux
20280 [list@ch om t] Has anyone successfully compiled ruby-odbc under Debian (woody)?  I
20283 [neumann@s- i] Have a look at Ruby/DBI (= Databases/DBI at RAA), a DataBase Independent interface similar
20521 [list@ch om t] Thanks for the pointer Michael.  Christian Werner contacted me and
20545 [neumann@s- i] Probably you looked at John Small's Ruby/DBI package that is listed under section "database".

Iterators (was Re: ++ Operator)
20286 [pbrannan@at ] Unfortunately, Ruby iterators are not always a viable option.  Consider
+ 20287 [Dave@Pr gm t] Have you seen knu's 'iterator.rb' module in rough/lib?
| + 20319 [harryo@zi .c] That looks kind of interesting.  I assume the value of this shows when the
| | + 20321 [Dave@Pr gm t] That's one value (although of course indexing would return the same
| | | 20351 [harryo@zi .c] Interesting you say that.  I made a similar comment to a friend of mine
| | + 20327 [spwhite@ch r] It might not be possible to directly access the contents of some lists,
| + 20325 [marick@vi ib] Where is this? 1.6.4? 1.7.*?
|   20337 [Dave@Pr gm t] cvs.ruby-lang.org/src co rough
|   + 20361 [neumann@s- i] Will this find it's way into Ruby 1.8 ?
|   | 20427 [pbrannan@at ] irb(main):001:0> group = [1,2,3], [4,5,6], [7,8,9]
|   | 20428 [decoux@mo lo] Perhaps I've not understood but it don't do the same thing that the
|   | 20430 [pbrannan@at ] OIC.  My solution produced output that was flipped across the diagonal.
|   + 20367 [pit@ca it in] <advertisement>
+ 20288 [pit@ca it in] if you hide the "weird callcc hacks" in a class like the Iterator class

Why doesn't Ruby have this...
20289 [alwagner@ua ] Over the last 30 years I have written production code in a dozen
20297 [paulp@Ac iv ] I think it is all in how you ask the question. You shouldn't presume
20304 [chris.morris] My opinion: to some, learning is painful. It requires humility (a need to
20306 [alwagner@ua ] I think it's a process of ossification that happens to anything

Performance of Substrings
20290 [kamphausen@n] Dear Ruby Community,
20292 [decoux@mo lo] Have you tried with unpack ?
20424 [kamphausen@n] Much better :) (though still slow in a way)

new toy: method_var
20291 [green@Fr eB ] After seeing a million examples of overriding methods in classes by aliasing
20295 [hal9000@hy e] aliasing
20298 [green@Fr eB ] Okay, I'll try.

Re: another new toy
20293 [decoux@mo lo] Well, If you want a new toy  but this time a really stupid toy, see this
+ 20294 [hal9000@hy e] Well, people coming from C++ might use it to
| 20296 [decoux@mo lo] No, this not "include" but really "insert" (i.e. another way)
| 20300 [hal9000@hy e] Good heavens. I'm behind the times.
| 20301 [decoux@mo lo] No, no
+ 20302 [pbrannan@at ] Well, one use would be so that you could have a class that only has static

Upgrading from 1.4.5 to 1.6.3
20299 [DDouthitt@cu] If I do this, are my programs going to stop working?  What conflicts should I watch out for?
20314 [ r2d2@um .s ] I just upgraded one of my machines from 1.4 to cvs (1.7) which resulted
20322 [matz@ru y- a] This change was done in 1.6.

New Windows InstallShield version of Ruby
20303 [andy@to ls e] I've put up a new version of the Windows InstallShield version
+ 20305 [bryan@te ra ] Hey, thanks for the windows update!  Including FXRuby was a good idea.
| + 20308 [Dave@Pr gm t] Try renaming the .DLL that came with the installshield version and
| + 20332 [mikkelj-anti] I seriously doubt the cache issue is related to Windows way of handling
| + 20642 [mikkelj-anti] I seriously doubt the cache issue is related to Windows way of handling
|   + 20339 [Dave@Pr gm t] That hasn't been our experience with the Cygwin DLL. If (for example)
|   | + 20340 [andy@to ls e] Ned asks,
|   | | 20445 [pc000@pa st ] Is this really the case ? Not having the full Unix API is
|   | | 20450 [mikkelj-anti] There may be an issue with plug-ins. That is, whether additional C-modules
|   | | 20466 [andy@to ls e] If I remember correctly "it's more subtle than that" (as Dave
|   | + 20343 [kevinbsmith@] I've been out of the Windows internals game for a while,
|   | | 20368 [mikkelj-anti] This XP fix - does this relate to the 16bit subsystem (WOW) or windows as
|   | | 20374 [kevinbsmith@] while,
|   | | 20378 [mikkelj-anti] And yes, implicit linking (if you thereby mean adding a lib file to
|   | + 20363 [mikkelj-anti] This is also what I'm suggesting. But I believe it is Cygwin that prevents
|   + 20644 [Dave@Pr gm t] I believe we've been round this before. It's because cygwin is just
+ 20309 [joe@vp p. et] Thanks Andy!
| 20312 [andy@to ls e] It's a really neat package, I haven't done anything with it
| + 20316 [Dave@Pr gm t] This is all true. However, as a quick hack, I tried renaming the
| + 20335 [mikkelj-anti] While I can contribute with many reasons for disapproving Windows - I think
| | 20336 [ned@bi e- om] Is Cygwin necessary? Wouldn't it be better to build this without relying on
| | + 20338 [andy@to ls e] Mikkel,
| | + 20341 [Dave@Pr gm t] At a loss of some functionality. It's a tradeoff.
| |   20359 [feoh@fo rf z] I think the cygwin package is a good thing.
| |   20376 [Dave@Pr gm t] At some point the installer will check for the existence of a newer
| + 20392 [eban@os ri .] The Cygwin 1.3.1 is buggy and slow and unstable, but the
+ 20346 [clem@we l. o] I've just had a chance to install it and try some of my code.  Problem
+ 20389 [schneiker@ju] Any (medium to long term) plans for GTK+?
  20416 [kevinbsmith@] And are you interested in other GUI toolkits? What are your
  + 20417 [Dave@Pr gm t] Neither Andy nor I are Windows experts, so for us to consider another
  + 20419 [waisun.chia@] Yup. Me too.

Backwards language
20307 [elanthis@us ] Greetings,
+ 20310 [toddg@li ux ] Have you hung out around perl-porters and talked with the Parrot people?
| 20315 [elanthis@us ] Last I saw Parrot was an April Fool's joke....
| + 20320 [toddg@li ux ] I figured as much.
| + 20640 [toddg@li ux ] I figured as much.
|   20329 [elanthis@us ] Ah.  Well, again, that runtime I'm sure is still a lot larger and such
|   20347 [toddg@li ux ] Yes.  But still quite exciting to see happen.  It will be quite a
|   20349 [elanthis@us ] Yes, it will.  It will certainly make a lot of things easier.
+ 20311 [beppu@bi q. ] [  date  ] 2001/08/25 | Saturday | 04:33 AM
| 20317 [elanthis@us ] Ya, that's what I was thinking, too.  Although CLR will presumably be
| 20326 [toddg@li ux ] Uhh... them's strong words, boy.
| 20333 [elanthis@us ] Not much of a schemer myself.  I have worked with guile a bit though,
| 20342 [siigron@si .] I'm currently writing an ftpd in Ruby, and I've been experimenting
| 20348 [elanthis@us ] Now, to me, that looks like a cheap hack.  ^,^  I've easily written in
| + 20434 [szegedy@or u] I also dislike eval(), but there are certain circumstances where you can't
| | 20437 [DDouthitt@cu] tomsrtbt (Tom's Root Boot Disk) recently adopted Lua as a scripting language for his single floppy Linux distribution.
| + 20440 [toddg@li ux ] You'll have to prove that assertion.
|   20442 [elanthis@us ] Ack, first, sorry my mailer doesn't seem to like your quotes...
|   + 20443 [hal9000@hy e] Sean,
|   | 20447 [elanthis@us ] Of course.  What doesn't one tune and change?  ^,^
|   | 20448 [elanthis@us ] Wow.  I like the points he makes.  I've actually studied LISP a lot, and
|   | + 20449 [toddg@li ux ] You can see us arguing about this one in the thread "Ruby as opposed to
|   | | 20453 [elanthis@us ] Aye, when I get time.  ^,^
|   | + 20452 [spwhite@ch r] It's more valuable to learn families of languages than specific
|   |   20454 [elanthis@us ] Understood.  I am attempting to write a small language, though -
|   |   20455 [avi@be a4 co] Smalltalk to see what an IDE should be, and what "dynamic object oriented
|   |   20461 [toddg@li ux ] Befunge, for multi-dimensional code flow.
|   + 20444 [avi@be a4 co] I think he says something like 25% of the code is macros (which
+ 20313 [ r2d2@um .s ] If you haven't already, I suggest you take a look at Lua. It seems to have
| 20318 [elanthis@us ] Originally I was using LUA for my embedding stuff, but I switched to
| 20373 [ r2d2@um .s ] Lua's object orientation is a lot better than Perl's, and much easier
| 20377 [elanthis@us ] Yes, but unfortunately, I do need the ability to create classes and
| 20379 [toddg@li ux ] Chicken.
+ 20324 [matz@ru y- a] I like this idea.  This is similar to my Ruby 2.0 implementation
| 20330 [elanthis@us ] ^,^  Assuming I enjoy my experiencing working on my language (never
+ 20328 [mikkelj-anti] How
  20331 [elanthis@us ] Wow.  Interesting concept.  A bit lower level than I was aiming, but
  20334 [mikkelj-anti] backend