15235-15829

15064-15983 subjects 15471-15895

Bug or feature? eval("x=5")
15235 [hal9000@hy e] This piece of code works as I expect.
15237 [joe@vp p. et] irb(main):001:0> eval("x=5")
+ 15240 [decoux@mo lo] The reference to x as a local variable or a method call is resolved at
+ 15241 [keiju@is it ] This is a difference of execution semantics of Ruby and irb.
+ 15244 [jskeeler@pa ] See p.528 of the pickaxe book (in appendix B).
  15269 [elderburn@mi] Reply to: elderburn@mindspring.com

help writing MetaRuby Contracts
15239 [matju@sy pa ] Here's another call for help.

help: how to write unit tests for Ruby-X11
15243 [matju@sy pa ] How would you write unit tests for Ruby-X11 ?
15245 [Dave@Pr gm t] Would the XTest extension help? Or you you want to isolate your tests

c-api-question.
15259 [erik@ba fo s] Here is a ruby-api newbies question.
15260 [matz@ze ab t] It depends on what and how you want to show to Ruby world.

NewbieQ: gsub replacing '\n'
15264 [angus@po ox ] I'm playing around with Ruby, and I've come across something I can't
+ 15267 [decoux@mo lo] No, perl do the same than ruby
+ 15278 [elderburn@mi] What platform? What version of Ruby?

WriteExcel for Ruby
15268 [hdstich@co m] btw, i'm trying to port John McNamara
+ 15276 [julian.romer] I am interested in the ReadExcel one (read from the binary format).
| 15280 [hdstich@co m] hmm, i found Spreadsheet::ParseExcel searching the CPAN...
+ 15298 [iso247@fr e.] Sure :^)

[ANN] NQXML v0.6.2
15270 [jimm@er s. o] NQXML is a pure Ruby implementation of a non-validating XML processor. It

ftools: File.catname bug?
15271 [mike@le to .] irb(main):002:0> File.catname "hello", "/usr"

Delphi and Ruby?
15282 [szegedy@or u] Has somone ever tried to link Ruby into a delphi project?
15288 [mzh@po tn t.] Kazuhiro Yoshida has.
15304 [moriq.kazuhi] Apollo lastest version is ap-624b.

Ruby in Java
15290 [glen@en bl d] Is anyone working on a Ruby implementation in Java (like Python's
+ 15294 [ser@ge ma e-] Yes, this interests me.  Are you thinking of doing a BSF interface for it?
| 15297 [glen@en bl d] I am thinking of something much along the lines of Jython, but perhaps
| 15300 [ser@ge ma e-] I'm not familiar with Jython, but providing a BSF compatible interpreter
| 15301 [glen@en bl d] Jython allows you to write code that looks exactly like Python. For
+ 15295 [glen@en bl d] Okay... I should probably go through the archives before I post
+ 15386 [matju@sy pa ] My current design for such a beast is based on the assumption that not
| 15394 [decoux@mo lo] Well, it exist a reference implementation for ruby, see parse.y
| + 15405 [glen@en bl d] While I have lex and yacc on my resume it is mostly in the hopes that
| | 15424 [ser@ge ma e-] I haven't touched yacc or lex since college, either, but there is JavaCC
| | 15425 [ser@ge ma e-] Doh.  I spoke before I thought about the terms I was using, and I remembered
| + 15413 [matju@sy pa ] I did say "a" reference implementation, and you did say so too. The C/YACC
| + 15414 [decoux@mo lo] What is this ?
+ 15431 [wayne.blair@] I've written a commercial java compiler/parser for an embedded scripting

URI package
15291 [wayne.blair@] Why does it say uri.rb is obsolete in the RAA?  Is there a built in
15422 [nahi@ke na t] I don't know, and No.

Small regexp Perl -> Ruby translation
15292 [mattbee@so p] Couldn't find the answers in the online book or the reference manual-- how
+ 15296 [decoux@mo lo] See String#scan
+ 15303 [Dave@Pr gm t] Have a look at String#scan

Q: Should initializers validate arguments ?
15299 [robert@ke oi] I'm new to Ruby and I came across something today and I was wondering if

Re: [OT-ish] language (was: Re: Discussion on new Ruby features)
15306 [dblack@ca dl] You would sound *very* strange in German if you messed with the word
15314 [wayne.blair@] =====
+ 15315 [ben_tilly@op] =====
+ 15323 [matz@ze ab t] Not really.  Let me give you small lesson.  Japanese has small

wait method?
15307 [wayne.blair@] Is there a wait or sleep method built into ruby?  The following is an
+ 15309 [dgjs@ac .o g] How about something like
+ 15327 [mike@le to .] There is a built in sleep method.
  15330 [wayne.blair@] Doh!  Thanks, dude.

private nested classes: how?
15311 [szegedy@or u] I am playing around with nested classes.
15322 [matz@ze ab t] public/private/protected stuff work with method only.

Off topic, languages
15313 [benoit.cerri] Not exactly, the part of the sentance that describes its syntaxic function


15318 [mdinowit@i- ] subscribe michael dinowitz

US$5000
15321 [carolyn_j@au] ????????????????? :=

Q: Compiling Ruby 1.6.3 in Win32 (VC++)
15324 [Milan.Gardia] I am unable to compile Ruby 1.6.3 successfully with VC++.
15348 [moriq.kazuhi] -CFLAGS = -nologo -DNT=1 -Zi -MD -O2b2x -G5

help with rubyunit
15325 [max@ma va co] As you can see from the snapshot below, I run NotterTest.suite
+ 15328 [wayne.blair@] RUnit counts tests, not assertions.  The framework creates a test for each
| 15341 [chris@at es ] I've been using RUnit for a few weeks now and it has always counted
| 15342 [wayne.blair@] Yeah, you're right.  Sometimes my fingers move faster than my brain.  Now
+ 15347 [wayne.blair@] Here is the solution to the problem, finally.
  15356 [max@ma va co] Thanks, Wayne.
  + 15358 [wayne.blair@] I didn't see the hook built in, and I was trying to find a painless fix.
  + 15797 [masaki.suket] Try the latest version RubyUnit 0.3.9.01a.
    15829 [max@ma va co] I will probably wait for stable 0.4 version

[ANN] NQXML v0.6.3 (bugfix: multi-line comments)
15326 [jimm@er s. o] Version 0.6.3 fixes a nasty bug: multi-line comments would blow up inside

Array to Hash?
15331 [jim@fr ez .o] Is there a built in way to turn an array
+ 15337 [wscott@bi mo] This was a big topic a while back.
+ 15343 [matju@sy pa ] h = Hash[1,2,3,4]

Newbie Module Mixin Issue
15332 [SAT@MU TI EC] I want to write a module that when mixed into another class finds out when a
15345 [matju@sy pa ] Just a tip: don't mess with "new" unless you really know what you're
15376 [SAT@MU TI EC] Thanks for the tip. That worked however, each class that has this mixed in,
15409 [matju@sy pa ] No, because there would have to be a way to say that you don't want super
15415 [decoux@mo lo] Well, if one day ruby has dispatch on the type, it probably will need to

how to use garbage collection relyably?
15333 [viisi@ch ll ] how is garbage collection intended to be used?
+ 15360 [decoux@mo lo] Yes,
+ 15362 [matz@ze ab t] Yes.  Ruby uses conservative garbage collection technology.
  15371 [viisi@ch ll ] ah nifty, i see now!

How do I copy an object?
15334 [jim@fr ez .o] I want to copy an object that contains an array.
15417 [kentda@st d.] Note that your code does _not_ dup nor clone the @s array, which
+ 15442 [hal9000@hy e] Generally true. But there's the trick of using Marshal to dump an object
+ 15469 [decoux@mo lo] This is more complex than this. Think, for example, about RCO

Re: How to clone an object?
15335 [jim@fr ez .o] Sorry for responding to my own post, but the
15338 [Dave@Pr gm t] class K
15339 [jim@fr ez .o] Thanks, that works well. But, what if a is private.
+ 15340 [Dave@Pr gm t] You could cheat and use instance_eval, or do something like
+ 15410 [jj5412@ea th] class A

Problem with gtk
15336 [Stephan.Kaem] I recently installed Ruby 1.6.3 using the Pragmatic Programmer's Ruby
15363 [Milan.Gardia] I solved the problem by downloading new dlls from the following page ("GTk+

Syntax highlighting
15344 [jtobler@Wi e] ...
15346 [jtobler@Wi e] I have created a simple syntax highlighting file that works for the CREdit

newbie question
15349 [r.kochhar01@] I have the following ruby test case that works in the window environment but
+ 15350 [gnhurst@hu s] `-- typo
+ 15351 [avi@be a4 co] initialize
+ 15352 [jweirich@on ] You misspelled initialize.
+ 15354 [wayne.blair@] You have a typo in "initialize".

newbie question: debugging
15353 [r.kochhar01@] Thanks to all of you about my earlier question..  I had retyped on the linux
15355 [wayne.blair@] I believe you have to start each and every line with a #.
15357 [avi@be a4 co] =begin
+ 15359 [decoux@mo lo] debug.rb can debug only ruby code. If you want to debug C code, you must
| + 15389 [r.kochhar01@] Thanks for the help.  But I am having trouble using gdb.  Here is the
| + 15393 [decoux@mo lo] Well,
+ 15368 [wayne.blair@] I'm turning into the king of errant posts.

Time.times problems in libc5; getrusage request
15361 [gnhurst@hu s] irb(main):004:0> t=Time.times
15364 [decoux@mo lo] Can you write a small C program which emulate time_s_times (i.e. just a
15379 [gnhurst@hu s] Ok, I tried at least three approaches...
15381 [Dave@Pr gm t] According to times(2), the return value, which should be of type
15382 [gnhurst@hu s] I asked my sysadmin about this..

How to distribute Ruby source?
15365 [jim@fr ez .o] I have some Ruby code that I need to distribute.

UnMac
15366 [ugly-daemon@] $ run
15367 [chadfowler@y] There is an old version of this that exists called
15373 [ugly-daemon@] Ok I have got a bash version and a c version which apparently hasn't been
+ 15377 [neumann@s- i] You may have a look at Eliza.
+ 15397 [mike@le to .] Do you know Esperanto? I think it would be a nice interface language between computers and humans. I don't know it well, I only read a few documents about it. But its syntax seems very easy to interpret (no exception, simple rules, simple grammar...), and can be used as a natural speaking language. Human *and* computer friendly.
  + 15398 [ser@ge ma e-] I've been thinking about this for a long while now.  In fact, I have a
  | 15421 [ugly-daemon@] Yes I am interested in pursuing this. I will be doing my research. Any recommendations for books/sites, etc??
  + 15420 [ugly-daemon@] Very cool. Thanks to Micheal for the pointer to eliza. I have been sidetracked by a chat bot called alice which has eliza as its ancestor. So now I will be moving from a adventure shell type of thing to an agent like alice. I think I have some ideas on how to make her much smarter.

Compiling ruby-mysql on Windows
15369 [CRIBBSJ@oa w] I apologize if this question has been answered before (although a quick

snmp
15370 [Paul.Thompso] ...
15372 [decoux@mo lo] Is it supposed to be produced when you install ucd-snmp library.

enumerate hash items within an extension ?
15374 [sol123@ms .c] ...
15396 [decoux@mo lo] Well, you can use rb_iterate() (see README.EXT)

SpecTcl GUI-builder version 1.2a2 (SpecRuby FYI)
15375 [schneik@au t] FYI, for those interested in eventually updating SpecRuby.

ruby bugs
15378 [matju@sy pa ] Bug report.
+ 15380 [wscott@bi mo] printf specifies that the 'x' format is unsigned and Ruby has
+ 15399 [JCA02266@ni ] p sprintf("% x", 42)   # => " 2a"
+ 15418 [jaco@te se .] In fact, %x is a format for _unsigned hex_, as in ISO C89 and further,

Re: Bug in time.c (was Time.times problems)
15383 [Dave@Pr gm t] Like the time(2) call, it can't fail.
15384 [matz@ze ab t] appropriately.
15387 [Dave@Pr gm t] That's strange. On both my boxes, the man page doesn't mention an
15388 [matz@ze ab t] I'm confusing why starange behavior had happened for Guy's program.

tklib
15390 [mkoh@cs in i] I am trying to run the tk example in the Ruby book under Solaris 2.6 and
15423 [jaco@te se .] runs fine here (ruby 1.6.4 (2001-05-17) [i386-freebsd4.3])
15428 [mkoh@st el u] Yes.

PROPOSAL: Java-like method-based synchronization mechanism in Rub y
15391 [WYS@he bl ng] require ?synchronized?
+ 15395 [Dave@Pr gm t] Is this thread safe, or could two different threads each generate
| 15400 [WYS@he bl ng] You are right, we need to apply the "Double-Checked Locking" as described in
+ 15407 [m_seki@mv .b] (--> http://www.ruby-lang.org/en/raa-list.rhtml?name=MutexM)
+ 15436 [patrickdloga] Ruby borrows several good things from Smalltalk, Scheme, Perl, etc.

xmp
15392 [wayne.blair@] Hey,
15463 [wayne.blair@] Fix this problem by changing line 180 in xmp.rb from

Ruby/X11 version 0.2
15402 [matju@sy pa ] Announcing Ruby/X11 version 0.2. It's been a lot of work. I release it

how to remove method from singleton class
15403 [vjoel@pa h. ] How can I remove a method from a singleton class?
+ 15406 [vjoel@pa h. ] eval <<-END
+ 15408 [matz@ze ab t] class <<obj
  15433 [jskeeler@pa ] That's inconvenient, because instead of :foo there is a variable which
  15462 [matz@ze ab t] class <<obj

printable doku or tutorial
15404 [daniel@ds ic] I search a good tutorial/doku for ruby, which is printable respective

gnutella client
15411 [todd@de ig s] Does anyone know where I can get pseudocode to write a client for the

[ANN] SOAP4R/1.3.0
15416 [nahi@ke na t] SOAP4R is a Ruby library program to handle Simple Object Access

native compiler ?
15419 [fabrice@ce e] Sorry if this question has been answered several times, but
15426 [ser@ge ma e-] Yes, there is an application called rb2c

RADIO HOST NEEDS A BEATING
15427 [ccjegcod@pr ] I do not understand why the United States

Someone sending viruses
15429 [wayne.blair@] Someone responded to my original post (subject: xmp) by directly sending me

Someone sending viruses
15430 [wayne.blair@] Someone responded to my original post (subject: xmp) by directly sending me

IIS application mapping
15432 [ndrochak@go ] I have put an appication mapping for .rb files in my IIS.  I used
15437 [jimm@er s. o] In the Unix world, GET uses environment variables and POST uses standard
15480 [r2d2@ma .a c] It is the same (but I think IIS also supports some other forms of CGI parameter
15516 [nick@jo dr g] I did finally stumble upon the cgi module, although that has just opened
15537 [r2d2@ma .a c] No. I prefer to just use plain CGI, and not IIS specific things, to ensure that

A proto-RCR: making def and class rvalues
15434 [Dave@Pr gm t] 1. It's hard to use these values, as the syntax doesn't allow a method
+ 15439 [Dave@Pr gm t] (Sorry to follow up my own post, but...)
| 15445 [hal9000@hy e] Dave,
+ 15440 [avi@be a4 co] I would suggest
| 15441 [Dave@Pr gm t] Yes - that's a great idea.
+ 15444 [matz@ze ab t] I think changes 1, 2 and 4 are OK.  But I don't really agree with
  15450 [Dave@Pr gm t] True, although you _could_ tell at parse time and generate a different
  15452 [matz@ze ab t] Well, it's possible because "def" is a syntax.

Newbye question: retrieving a Class by its classname
15438 [benoit.cerri] def XmlElem.getClass4Name(name)
+ 15453 [ptkwt@sh ll ] I don't like over using eval either...
+ 15458 [benoit.cerri] of course I meant return eval("#{name}"), this is just a typo, my question
  15482 [   xm@w3 .r ] module TestModule
  15529 [benoit.cerri] Thank you,

Idea for C extension?
15447 [hal9000@hy e] I'm about to write a Ruby extension in C as an exercise.
15521 [rise@kn ve y] The Bind resolver library is pretty standard and quite useful for doing

RCR: #const_name_is
15448 [matju@sy pa ] current_module.const_set(:Foo,bar)
15451 [Dave@Pr gm t] Could you provide a couple of examples of where this would be useful?
15454 [matju@sy pa ] x = Class.new   #==>   #<Class 0lx4020d7f4>
+ 15455 [matz@ze ab t] Well, in this case, Module#to_s (or more precisely find_class_path()
+ 15457 [Dave@Pr gm t] I'm still struggling to understand how this would be useful. You have

Embedding Ruby - Segfaults?
15449 [elanthis@us ] Greetings!
15470 [decoux@mo lo] This is not a ruby problem, but a problem in your application.
+ 15473 [elanthis@us ] OK.  That makes me feel better.  ^,^
+ 15475 [decoux@mo lo] Something like this (not tested)
  + 15503 [elanthis@us ] Ok, I'm at work, so I can't really mess with Ruby at the moment (but hey, if Ruby works out well in my other project, I'll be using it in my current one here at work, as well), but I could swear that funcall will return Qnil (from my source-reading).
  + 15538 [decoux@mo lo] Try it :-)
    15539 [elanthis@us ] Ya, it worked.  I feel dumb now.  Thanks!

more reflection
15456 [matju@sy pa ] shouldn't there be a version of Module#included_modules or #ancestors
15461 [matz@ze ab t] There's no such thing like repeated inheritance (or inclusion) in
15464 [matju@sy pa ] 1. Explain why that program works.
15465 [matz@ze ab t] $n = ARGV[0].to_i
15466 [matju@sy pa ] You are perfectly right. I forgot about the .dup and the rest was just a
15467 [matz@ze ab t] Yes.  This might be a misfeature.  Methods in Bar can be considered as
15625 [matju@sy pa ] foo.singleton_methods
15706 [matz@ze ab t] Interesting.  I'll merge this behavior to 1.7

Re: #const_name_is
15459 [benoit.cerri] Just a suggestion, if you don't have a sample of an app embedding ruby or if

fastcgi module
15468 [steven@ha ya] Sorry if this has been discussed (indeed it has, after my
15705 [matz@ze ab t] See [ruby-talk:6790] via http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml
threads.html
top