11965-12811

11739-12280 subjects 12157-13260

newbie eval question
11965 [colin@sk .w ] I want a piece of eval'd code to create a local variable in the
11973 [matz@ze ab t] Ruby's local variables are treated statically (i.e. compile time), so

Ruby/MySql garbage collection problem
11969 [ristad@mn mo] I've written a Ruby program that uses Tomita Masahiro's excellent
11975 [matz@ze ab t] Well, it might be a bug in Ruby/MySQL.  Let me contact with him.

SV:  Not Ruby, for me, for the moment at least
11970 [dennisdecker] Thank you!

Is mod ruby read to replace PHP?
11978 [jim@fr ez .o] Ok Ok, don't flame me for this...

DBI for Ruby?
11979 [mjais@we .d ] currently I am playing with Ruby and Mysql and it really is cool
12087 [maki@in c. o] There is RDBC module, like JDBC of Java. It has Postgres and

File exist method
11981 [ppladijs@ca ] Is there a method or a simple way to check
+ 11982 [dgjs@ac .o g] 'FileTest' module, 'File::Stat' class ...
+ 11983 [Dave@Pr gm t] File.exist?("myFileName")
+ 11984 [mike@st k. o] If you grab the ri utility from www.pragmaticprogrammer.com then you can
  11985 [ppladijs@ca ] Thanks to all of you for helping me out!

possible memory leak in GDBM/gdbm
11986 [ristad@mn mo] The following program suggests there is a small memory leak in
11988 [matz@ze ab t] I hope it is fixed in the latest stable snapshot.  At least, memory
11995 [ristad@mn mo] I hope it is fixed in the latest stable snapshot.  At least, memory
11996 [matz@ze ab t] "The latest stable snapshot" is the one that can be obtained from

zip file manipulation
11987 [cas@ex s. om] I have looked around for over an hour for any kind of library providing zip

Is eRuby... (was: Is mod ruby read to replace PHP?)
11989 [wys@he bl ng] Jim,

higher-resolution Time for Win32
11990 [tjt@no uc .c] I want to use Ruby for realtime MIDI and audio on Windows.
11991 [matz@ze ab t] Thank you for the information.  The place to be modified (i.e. where
12006 [ameuret@bl c] The prefered way for high-resolution timming on Win32 is to use

Re: ANN: RubyCHannel interpreter goes $SAFE-level 2!
11994 [schneik@us i] # If the "real ruby-gurus" (Matz, Guy(ts),

PLS-violation in proc as block method invocation!?
11999 [feldt@ce ch ] I guess the following behavior is due to block/proc conversions
12001 [matz@ze ab t] OK, I will fix this by modifying Proc#==, although output like

FXRuby examples
12002 [dsafari@pa a] I've installed fox 0.99.147 and have compiled the FXRuby to produce fox.so.
12026 [ljohnson@re ] Holden,

Re: How do I reach members from a Proc?
12003 [schneik@us i] #
+ 12004 [feldt@ce ch ] Maybe we should add an acronym glossary to the FAQ... ;-)
| 12015 [maili31s@cl ] Glossary's separately there...
| 12017 [feldt@ce ch ] POLS or PLS seems to be used by some and the concept of "Principle of
| 12018 [maili31s@cl ] I think it's good candidate, too.
+ 12005 [matz@ze ab t] Thinking of what it does (switch the value of self, then evaluate
  12010 [spwhite@ch r] For me, "eval" already includes the concept of calling, so I feel that
  12012 [dblack@ca dl] To me, though, block_eval doesn't signal the switching of self.  Not

ActiveScriptRuby in ASP
12007 [Makoto.Nakag] I am trying to use arton's ActiveScriptRuby from within ASP with IIS on

ANN: Memoize 0.1.2
12014 [feldt@ce ch ] This is to announce Memoize: "for speeding up methods/functions by caching
12024 [wys@he bl ng] "caching"...a typical AOP aspect.
12027 [feldt@ce ch ] Yes, there is and I'm actually one of its authors! ;-)
12028 [avi@be a4 co] As in, letting an aspect control whether or not the original method even
12029 [feldt@ce ch ] Yes, thats right. And returning something other than what the original
12032 [avi@be a4 co] It could be written in Ruby, in the same style as the current incarnation
12033 [feldt@ce ch ] Ok. But this also gives us a hint that something might be "missing" from
+ 12036 [decoux@mo lo] How do you do with such a function ?
| 12040 [avi@be a4 co] require 'advice'
| 12041 [decoux@mo lo] pigeon% ruby
| 12044 [avi@be a4 co] Foo.new.bar
| 12076 [feldt@ce ch ] Yes, its kind of strange that it is messed up.
| 12082 [avi@be a4 co] I think the problem is that I always use rb_iterate to make the call;
+ 12037 [avi@be a4 co] What might be nice is if, whenever send is redefined for a class, all

hooking/wrapping all of a classes methods
12019 [dblack@ca dl] Let's say I write an IO-layer class with a bunch of methods that do
+ 12020 [decoux@mo lo] yield 12 if block_given?
+ 12021 [avi@be a4 co] David -
+ 12025 [wys@he bl ng] "synchronization"...sound like yet another typical AOP aspect ;-)
| 12030 [wys@he bl ng] Sorry, I didn't know "we" have AOP already. Got something to look at
+ 12142 [green@Fr eB ] For what it's worth, this will only "seem to" work.  It won't give you an
  12152 [dblack@ca dl] Right y'are.  And it's all backwards anyway.  And Thing's superclass

French RUG ?
12023 [jeromg@ho ma] ...
12046 [roberto@RE O] [courtesy cc of this posting sent to cited author via email]
12101 [hdstich@co m] and what about a German RUG? ;-)
12107 [wys@he bl ng] MfG
12108 [hdstich@co m] ah, yes, i found it on www.ruby-lang.org under 'Mailing

NQXML: Pure Ruby XML parser (almost)
12034 [jimm@fn rd i] NQXML is a pure-Ruby XML parser that I'm writing from scratch. The "NQ"
+ 12091 [sent@qu li y] Excellent. This sounds very similar to what I was
+ 12165 [maki@op n- e] * install.rb: fix bug(? but I cannot install without this fix).

why won't "(a) = 1" parse?
12039 [dblack@ca dl] (a) = 1
12489 [matz@ze ab t] It's by the magical mystery of yacc rules.  I wish I knew workaround.

using rescue/ensure in methods
12043 [tammo.freese] class Test
+ 12067 [chadfowler@y] class Test
+ 12078 [matz@ze ab t] a bug.  thank you for finding it.

RCR Summary 03/05/01
12045 [wmwilson01@h] RCR's which need to be or are being discussed

Windows Installer questions
12048 [andy@to ls e] I've been busily putting together a new version of the Windows
+ 12050 [hgs@dm .a .u] Thanks again for your work on this....
| 12057 [hoanga@al m.] I guess I'm part of the crowd.  From my experience of working with Windows
+ 12090 [cas@ex s. om] I think if the two versions can peacefully coexist on the same machine, then

Problems with rubywin.exe (ruby162-3 release)
12054 [jobson@li eo] I've just installed the ruby162-3.exe for Windows on a Windows 98 SE syatem,
12056 [andy@to ls e] Install in directory that does *not* contain spaces

SV:  hooking/wrapping all of a classes methods
12058 [dennisdecker] A pitfall in the argument handling. How about this? (not tested)
12065 [dblack@ca dl] That was actually a test, to see if it would raise the exception.

Ruby & AOP
12061 [dennisdecker] I've followed the threads about aspects in ruby. It made me re-check the
+ 12074 [avi@be a4 co] A lot of the discussion has been hovering around basically this question -
| 12081 [Dave@Pr gm t] Perhaps we've already got an interface, it just isn't used...
| 12084 [avi@be a4 co] Yes, that was my initial thought... the concern I had with that is that
+ 12077 [matz@ze ab t] extend_object is not a callback, but a redefinable method.
  12080 [avi@be a4 co] Matz,
  + 12086 [feldt@ce ch ] I agree (I guess problem is to find a bit to indicate
  | 12089 [feldt@ce ch ] The above wasn't very clear so I'll try again (and in the process adds a
  | 12092 [matz@ze ab t] I've got what you meant.
  + 12088 [matz@ze ab t] Well, let me add this to the ToDo list.  It's kinda big work, that I

SV:  Re: Windows Installer questions
12062 [dennisdecker] I've used all of the previous installer versions and never experienced any

Re: RCR: shortcut for instance variable
12064 [gsemones@pr ] FWIW, I think I like this suggestion best so far.

ANNOUNCE: FXRuby-0.99.161 now available
12068 [ljohnson@re ] I am pleased to announce the second "alpha" release of FXRuby, the Ruby

Opposite of Integer.chr
12069 [jjthrash@po ] Howdy,
+ 12071 [feldt@ce ch ] One way is: "a"[0] etc
+ 12072 [gnhurst@hu s] irb(main):001:0> 65.chr
+ 12073 [ymsd@m- et n] irb(main):007:0> str = "abc"

Quines anyone?
12079 [ben_tilly@ho] On PerlMonks I just ran across a reference to the
+ 12083 [Dave@Pr gm t] Hal's got some at http://www.hypermetrics.com/ruby.html.
| 12256 [matju@sy pa ] proc{|f|f+".call %q{#{f}}"}.call %q{proc{|f|f+".call %q{#{f}}"}}
+ 12191 [raja@cs in i] DATA.rewind
  12225 [ben_tilly@ho] Now *that*'s short!  No characters! :-)

Another hook
12093 [Dave@Pr gm t] analogous to to_s, called whenever an object is used in a context
+ 12094 [matz@ze ab t] And performance would be the excuse again.
| 12095 [Dave@Pr gm t] Would it be that bad in reality? You'd only have to do the call if
| 12096 [matz@ze ab t] If there's none, it must be OK.  But for example, if there's only one
| 12102 [schneik@us i] #
+ 12197 [matju@sy pa ] Oh, btw, I also proposed that in [ruby-talk:5056].

RCR: replacing 'caller'
12097 [feldt@ce ch ] IMHO, 'caller' would be much more useful if you could know/access the
+ 12098 [matz@ze ab t] Hmm, do you think call_stack is the best name?
| 12104 [feldt@ce ch ] Not sure. 'callers' might work or 'invocation_stack' or 'execution_stack'
| 12106 [matz@ze ab t] I checked in the fix right now.
+ 12105 [avi@be a4 co] Robert,
  + 12109 [feldt@ce ch ] Avi,
  + 12111 [feldt@ce ch ] Problem is that last_func is 0 when block called. New diff (from original
    12171 [wconrad@ya n] How about making it an array of structs?
    + 12173 [Dave@Pr gm t] Yes!
    + 12202 [feldt@ce ch ] Agreed as long as performance doesn't suffer. (call_stack might be used to

(My) Thread bug - sync != lock/unlock
12099 [hal9000@hy e] I recently made an "improvement" to a little piece of code...

disassembling and reassembling a hash
12103 [raja@cs in i] Given a  hash, h1, will the following always hold?
+ 12123 [raja@cs in i] I should probably describe the context in which this situation arises.
+ 12128 [decoux@mo lo] h1 = {}
  + 12143 [raja@cs in i] Not quite.  v[i][j] is normalized based on -all- the values in v not just
  | + 12149 [spwhite@ch r] I'm new to OO so please forgive me if this is a stupid question...
  | | 12184 [raja@cs in i] class MyHash < Hash
  | | 12232 [spwhite@ch r] class Hash
  | | 12245 [raja@cs in i] In some instances using class methods as constructors is fine.  I felt for
  | + 12168 [crippel@pr m] vectors
  |   12170 [dblack@ca dl] See [ruby-talk:10912] and subsequent discussion -- also the RCR in
  + 12151 [decoux@mo lo] It's best to wait  a response from matz, but actually #keys and #values

blocks from blocks
12110 [avi@be a4 co] class Foo

NaN, Infinity (Bug?)
12112 [tammo.freese] After the Pickaxe Book, first print, p. 320
+ 12114 [decoux@mo lo] Well it work for me
+ 12115 [gotoken@ma h] $ ruby -ve 'p [(x = Math::log(-1.0)), x.nan?]'
+ 12132 [Dave@Pr gm t] a = -1.0  		# => -1.0
  + 12138 [gotoken@ma h] #include <math.h>
  + 12164 [erne@po er a] It works OK on windows 2000
  | 12217 [tammo.freese] Perhaps this bug is only based on a misconfiguration of my system?
  | + 12220 [gotoken@ma h] This problem is caused by Cygwin's C library libc (newlib).
  | + 12224 [  ddj@km .d ] Windows NT Version 4.0
  + 12359 [see_signatur] ruby 1.6.2 (2000-12-25) [sparc-solaris2.6]
  | 12469 [tammo.freese] (ChangeLog)
  + 12481 [decoux@mo lo] Probably because the patch is

RubyOnlineInterpreter as a SOAP-service?
12113 [wys@he bl ng] ...would that make any sense?

String.gsub()
12116 [mbowler@Ga g] The method String.gsub() isn't working the way I expected (or the way
+ 12117 [decoux@mo lo] puts inputString.gsub(/'(.+)'/, '"\1"')
+ 12118 [erik@ba fo s] I fell for that too.
| 12120 [mbowler@Ga g] This is a cryptographically signed message in MIME format.
| 12121 [feldt@ce ch ] When using "" the \ character is used as an escape character so that for
+ 12119 [chadfowler@y] puts inputString.gsub(/'(.+)'/, '"\1"')

Re: String.gsub(), & RCR
12122 [hgs@dm .a .u] That is not the reason.  Double quotes allow backslashes to quote things.

Is Ruby japanese-centered?
12124 [hvrosen@wo l] [matz writes]
+ 12154 [nickb@fn rd ] internationalization = i + 18 letters + n = i18n.
| 12162 [gnhurst@hu s] ;-)
| 12203 [maki@in c. o] Oh, It's more fluent in English than me :-)
+ 12161 [matz@ze ab t] Since I have no knowledge about other languages than Japanese, I
  12180 [petemcbreen@] <983898497.465333.21876.nullmailer@ev.netlab.zetabits.com>...

ChibiXML (Re: RCR: Input XML support in the base Ruby)
12126 [maki@in c. o] MoonWolf-san started to develop 'ChibiXML' parser/DOM module.
12146 [gsemones@pr ] Thanks, I'll take a look at it.  I'm also looking over the NQXML

hash.invert loses data if equal values exist - is this the right behaviour?
12127 [tammo.freese] By inverting a hash that has same values, I expected to see an Exception.
12135 [Dave@Pr gm t] Any reason why there should be an exception?

Proc.arity() broken on Windows?
12129 [mbowler@Ga g] When I run the following code on windows and on linux, I get different
+ 12133 [decoux@mo lo] What is your version of ruby on linux ?
| 12137 [mbowler@Ga g] This is a cryptographically signed message in MIME format.
| 12140 [gotoken@ma h] lambda{|a|}.call   expects zero or more arguments.
| 12247 [raja@cs in i] Most likely this has been discussed in the past.  But why is the parameter
+ 12134 [gc@ma dr ke ] Actually, a block with exactly no parameter, and exactly one paramter,

Weird Array behavior
12130 [jjthrash@po ] <code>
+ 12131 [jjthrash@po ] I just figured it out.  The above fills all the entries of the
+ 12136 [gotoken@ma h] Array.new fills always with an *identical* object, specified as the

Re: (long) Re: hash.invert loses data if equal values exist - is this the right behaviour?
12139 [tammo.freese] Yes, it isn't. But the problem here is that it is not easy to predict
+ 12145 [Dave@Pr gm t] No, because hashes are unordered.
| + 12147 [gotoken@ma h] I see.  But I don't know the purpose of Hash#invert.  IMHO, invert is
| | 12158 [Dave@Pr gm t] I've used it a couple of times, but I agree it's rare.
| | 12177 [gotoken@ma h] Yes, it could be useful sometime.  Thank you.
| | 12179 [Dave@Pr gm t] hsh.invert -> aHash
| | 12210 [gotoken@ma h] I hope so.  Could you add some explicit notices like the below?
| | 12710 [charleshixsn] What you want to return is a bag, not a set.  So the general inverse of a
| | 12715 [crippel@pr m] Just,
| | 12810 [charleshixsn] FWIW-- I don't think of myself as exactly a CS-type, but I've been a
| + 12219 [tammo.freese] Is there any case where inverting a hash that is not one-to-one
|   12221 [Dave@Pr gm t] # Here's a hash mapping image files to the names
|   12222 [tammo.freese] OK, exception throwing would be a bad thing here.
+ 12153 [crippel@pr m] FYI - hash.invert is a ``left inverse'' under

New submissions to the Ruby Application Archive?
12144 [ljohnson@re ] OK, I promise I looked around for this answer before posting here ;)
12148 [feldt@ce ch ] Its a bit difficult to spot but there's a "add new entry" link below
+ 12150 [decoux@mo lo] You have a link "add new entry" (on the right side), just under "Whats
+ 12169 [ljohnson@re ] Robert & Guy,
  12172 [hgs@dm .a .u] Same here.  I'd suggest putting it on the left in Bold, but please, no

RCR: Block form of Dir.chdir
12155 [feldt@ce ch ] I frequently do something like
12394 [matju@sy pa ] Sounds good to me. If File.open can, why not this one.
12400 [kjana@os xa ] ``Because chdir changes context of a program'' ....I heard such.  That
+ 12406 [decoux@mo lo] What do you do with thread ?
+ 12433 [matz@ze ab t] That's what I said for 2 previous almost identical requests.  In this

Licensing, Intellectual Property, and Ruby code (longish)
12156 [colin@we g2 ] I am struggling with issues of licensing, intellectual property, and
+ 12167 [ben_tilly@ho] Excellent question.  One problem with CPAN is that the
| + 12178 [colin@we g2 ] What if instead of a license of any sort, the site's Terms of Service
| | 12183 [jtobler@Wi e] Agreed.  I favor the least restrictive license.  Unfortunately, the GPL
| | + 12192 [schneik@us i] # news:LAW2-F244U4DYo60bRp00004d93@hotmail.com...
| | + 12199 [elderburn@mi] While I agree in principle re least restrictive licnesing, I still question
| |   12201 [schneik@us i] # While I agree in principle re least restrictive licnesing, I still
| |   12228 [ben_tilly@ho] Clarification.  I do not want to be misinterpreted as
| + 12195 [elderburn@mi] There is a bumper sticker I see from time to time that reads "beatify America
| + 12236 [john_van_v@y] I had a long interchange about licensing w/ Ben and the perl6 lic group.  I was
| | 12242 [ben_tilly@ho] Cutting material is one thing, but please, please leave
| | + 12275 [news-9840628] It is unfortunate that your wording was misunderstood, and that
| | + 12295 [ rms@gn .o g] This is particularly important when you are adding
| |   12301 [ben_tilly@ho] As is usual, several questions.  The three main points
| |   12517 [ rms@gn .o g] It is very important to specify a clear license policy for the library
| |   12571 [john_van_v@y] I think a "spirit of" paragraph would be very helpful if it touched on the main
| |   12595 [ben_tilly@op] In some ways having a clear policy is more important than the
| |   12605 [cas@ex s. om] I have to agree. I'm not trying to start another license debate, and I stand
| |   12662 [ben_tilly@op] Sorry, this appears to be a misunderstanding on your part of
| |   12666 [cas@ex s. om] Sorry, my slant is colored by always having worked in the shrinkwrap world.
| + 12811 [charleshixsn] Well, GPL would do everything that I need, but it's far from the only choice.
+ 12193 [elderburn@mi] Well, common sense would seem to indicate that if I post my code in a public
+ 12198 [matz@ze ab t] No, it shouldn't be mandatory.  But in case the question was
threads.html
top