239426-254558

239176-284940 subjects 239556-370047

Oppinions on RCR for dup on immutable classes
239426 [apeiros@gm .] I'm about to make this RCR and would like to get some oppinions on it in
+ 239427 [gavin@re in ] You should only submit one. The discussion of which choice is better
| 239463 [matz@ru y- a] Seconded.  It pretty trivial for us core developers to make dup for
| + 239510 [gregory.t.br] +1. If i am trying to dup an object, sometimes it's inconvenient that
| | 239517 [ara.t.howard] unlike 42.dup, which is patently obivous.
| + 239541 [apeiros@gm .] That's why I have 2 suggestions. The issue arises when you don't know
|   + 239558 [gregory.t.br] => 3
|   | + 239559 [sonoflilit@g] ...
|   | + 239569 [robert.dober] I would ask the question: Why do you dup a?
|   | | 239572 [gavin@re in ] a) See, there's no point in duplicating an immutable object, since the
|   | | 239597 [robert.dober] Exactly
|   | | 239619 [gregory.t.br] Right.  My only point was that this solved what the OP asked for
|   | | 239620 [gavin@re in ] IF the proposed implementation were to do what you suggested - rescue
|   | | 239623 [gregory.t.br] the only things I can think of involve singleton methods
|   | | 239646 [gavin@re in ] A very good case. Enough so that I change my vote from "change dup" to
|   | + 239648 [apeiros@gm .] As I said, I consider it a minor glitch. Of course you can work around
|   |   239668 [gregory.t.br] You're right, this is a better way.   I don't consider it a work
|   |   239679 [apeiros@gm .] My issue is that I can't test that. I can only try and catch the
|   |   + 239682 [gregory.t.br] Oh, good point.
|   |   | 239703 [sonoflilit@g] Oh no, you don't wanna do that: What if you're a library and a user
|   |   | 239705 [gregory.t.br] Um.  then no one uses your library?
|   |   + 239694 [ara.t.howard] you should check out haskell - it's one of only a few languages that can
|   + 239570 [gavin@re in ] Actually, Ruby is about the principle-of-least-surprise-for-matz.
|   | + 239571 [dblack@wo bl] It doesn't mean it's bad, but it does mean that it isn't a duplicate
|   | | 239582 [gavin@re in ] If a duplicate of an immutable object is indistinguishable from the
|   | | 239589 [dblack@wo bl] You could conceivably have a case where an object can't be dup'd, but
|   | | + 239594 [gavin@re in ] class Object
|   | | + 239599 [ara.t.howard] you already do though?
|   | |   239601 [dblack@wo bl] I don't consider returning a shallow copy the same as returning self.
|   | |   239603 [ara.t.howard] you may not.  neither do i.  nevetheless it quite true that one must
|   | |   239605 [dblack@wo bl] I'm definitely not lobbying against understanding things :-)
|   | + 239585 [gwtmp01@ma .] I've come across this situation when writing generic code to do a
|   |   239590 [dblack@wo bl] But self isn't other than self.
|   + 239662 [matz@ru y- a] But your other suggestion was just removing dup altogether, right?  In
|     239663 [apeiros@gm .] With current implementation, the only way to figure if an object can be
|     + 239665 [matz@ru y- a] As far as I understand, DuckTyping is not something based on method
|     | + 239674 [deanwampler@] For me, this does break the POLS, because it breaks the Liskov
|     | | + 239676 [gregory.t.br] POLS when applied to Ruby refers to Matz's surprise.  In this thread
|     | | + 239690 [robert.dober] you are opening a can of worms (or ducks if you prefer).
|     | | | 239716 [deanwampler@] Interesting points, especially about the implications of
|     | | | + 239717 [ara.t.howard] i simply do not understand this line of thinking - every call to every object
|     | | | | + 239718 [ara.t.howard] ... or even if it doesn't:  method_missing
|     | | | | + 239720 [gregory.t.br] With this in mind, what do you guys think of this work around?
|     | | | |   + 239721 [ara.t.howard] same semantics - but nice and clean.
|     | | | |   | 239725 [vincent.four] +1
|     | | | |   + 239726 [dblack@wo bl] false.dup?  # => false  :-)
|     | | | |     239737 [gregory.t.br] Let me just play devils advocate for a sec.
|     | | | + 239728 [robert.dober] Interesting - and comforting - to know.
|     | | |   239729 [dblack@wo bl] See Ara's answer to Dean, though.  respond_to? isn't designed to tell
|     | | |   239731 [robert.dober] Very well put David. I can only agree, it is better behavior.
|     | | + 239691 [matz@ru y- a] Please no POLS here.  Considering whom you're trying to persuade, it's
|     | + 239684 [apeiros@gm .] Hm, we probably have a different understanding of DuckTyping then.
|     |   + 239688 [matz@ru y- a] Perhaps.
|     |   | 239692 [apeiros@gm .] Um, no, with the classes mentioned in the RCR the answer would be
|     |   | + 239696 [matz@ru y- a] If we see a class as a restaurant, your illustration makes sense.  But
|     |   | | + 239698 [gregory.t.br] But they never do seem to run out of chunky bacon.
|     |   | | + 239701 [apeiros@gm .] Restaurant := Class
|     |   | |   + 239702 [dblack@wo bl] But methods are not constrained by class.  It's not the class's
|     |   | |   + 239884 [matz@ru y- a] I don't deny your model, but it smells like static typing.  In Ruby,
|     |   | + 239697 [ara.t.howard] not really, you just have to learn how to cook! ;-)
|     |   + 239695 [ara.t.howard] because we serve it sometimes.  in addition, most of our employees know how to
|     + 239671 [ara.t.howard] class C
|       239678 [apeiros@gm .] Care to explain why you chose defining a method with the sole purpose of
|       239693 [ara.t.howard] yes - for illustration  ;-)
|       239700 [apeiros@gm .] And in a real situation, why would you chose to do so? What would be the
|       239706 [ara.t.howard] the one that springs to mind is
|       239710 [apeiros@gm .] module Mixin
|       239711 [gregory.t.br] the difference is in the rescue.
|       239714 [apeiros@gm .] That's getting off-topic. The error dup gives is "not possible", not
|       239719 [gregory.t.br] Actually, My point was about expressiveness through exceptions.
+ 239767 [greg.hurrell] I personally would like to see immutable objects like Nil and Fixnum
  + 239777 [sonoflilit@g] Say, why not just define Object#mutable? and solve the issue of not
  | 239784 [bofh@so tm d] In my opinion, this exposes at the ruby level an implementation detail that
  | 239787 [sonoflilit@g] Because it's something exceptional that is very predictable and we
  + 239822 [dblack@wo bl] One problem with this is that dup oeprations don't fall precisely

>Exit code: 0
239429 [toothyXdip@g] when i try to run the script it says >Exit code: 0 off to the right
239433 [o.renaud@la ] An error code of 0 means that your program ended successfully. Any other code

functional.rb
239431 [eegreg@gm il] A look through RAA and rubyforge doesn't show any functional
+ 239439 [nicksieger@g] ...
+ 239457 [ara.t.howard] why not
  239458 [gregory.t.br] Well that prevents you from being able to access the enclosing scope,
  239460 [ara.t.howard] hrrrmmm.  i wouldn't say 'prevents' - but confuses ;-)

Uninstalling & Reinstalling Bug
239436 [sambatia@gm ] I'm just a 5 minutes ago ruby user and I wanted to share something I

How to do conditional operator?
239440 [ joe@vi .n t] If an operator is just syntactic sugar for a message send, how do I
+ 239442 [dblack@wo bl] For several reasons :-)  = isn't a method, so you can't send it to an
+ 239443 [ara.t.howard] a, s = 42, 'foo'

Connecting to Oracle error
239441 [zeko_usa@ya ] I just downloaded Ruby and Watir as well and my local XE Oracle database
239462 [alin.popa@gm] It seems that you don't have oci8 library installed.

Hash.new({}) astonishment
239446 [bofh@so tm d] => {}
+ 239449 [efine145-nos] Hash.new(obj) => aHash
| + 239450 [efine145-nos] Sorry, middle button operator trouble :)
| + 239468 [bofh@so tm d] yuck. i got it. thanks :).
+ 239459 [robert.dober] You are assigning to the {}, gotten by the [:a]

what can i do with Ruby??
239447 [jazzy1One@gm] I have a visual basic 6 program I made which stores databases and
+ 239452 [diegoslice@g] Yes you can build such a system. In the same way that Visual Basic is
| 239453 [jazzy1One@gm] So I need to choose and get one of these GUI toolkits? Which would be
| + 239461 [alin.popa@gm] I like very much and seems to be very easy to use, Gtk2.
| | 239488 [slamboy@gm i] ...
| | 239499 [imobachgs@gm] +1 for Qt if you're running Linux/*BSD. I think that the win32 port
| + 239938 [david@va ln ] If you're used to VB6,
+ 239579 [twerth@in in] I'll assume from your post that your are interested in GUI desktop apps

cross-thread violation on rb_gc() and Windows arguments
239448 [cmshea@gm il] I was working on a script and running into problems with passing an
+ 239563 [renard@nc rr] Not the answer you want.
| 239564 [cmshea@gm il] Yes.  I thought of mentioning that similar wildcard arguments are fine
+ 239644 [ snk@gn .o g] To my knowledge, a cross-thread violation occurs when a piece of code
| 239649 [cmshea@gm il] Well I wasn't sure if this was worthy of a ruby-core post.
+ 239667 [nobu@ru y- a] AFAIK, it should have been fixed in October.

Thread.current.parent and Thread.current.ancestors
239464 [ara.t.howard] class Thread
239470 [erikveen@gm ] It doesn't work with Thread#start (==fork)...
+ 239475 [erikveen@gm ] * By calling new_with_parent, you're saying: Yes, I know that
+ 239520 [ara.t.howard] class Thread

[ANN] xx-2.0.0
239466 [ara.t.howard] NAME
+ 239545 [tim.pease@gm] For some reason I want a Mexican beer at lunch now ;)
| 239550 [ara.t.howard] require "xx"
| 239555 [tim.pease@gm] So simple!  The XML namespace example should have clued me in -- need
+ 239548 [a2800276@gm ] ...
  239552 [james@gr yp ] James Edward Gray II
  239554 [ara.t.howard] safer than the first, easier than the second, and does both ;-)

Ruby Syntax - One::Two
239467 [toulax@gm il] I'm a newcomer to ruby and there's this little something I don't
239476 [stefano.croc] module. Since classes are constants, when you write class One::Two, you're
239484 [toulax@gm il] I understand now, I didn't realize "class One::Two" actually defined

Re: just a question...
239469 [michael.ulm@] Apart from being slower, it is also not producing a random permutation.

Web service client - Windows Authentication
239471 [dejan.dimic@] I had to use a web service and I would like to use it from Ruby.

Pipes and STDERR
239477 [jmdjmsmith@m] I would like to be able to assign my pipe to a variable, whilst still
239486 [shortcutter@] What exactly do you mean?  Why is the pipe and stderr related?  Are you
239518 [jmdjmsmith@m] Sorry, not very well explained.. i need to capture stderr of the ruby
239549 [shortcutter@] STDERR.reopen(pipe)

PDF::Writer and Unicode
239479 [fxn@ha hr f.] According to the current manual PDF documents generated by
+ 239481 [vincent.four] I'm not familiar with PDF::Writer, but I would be surprised if you
| 239496 [fxn@ha hr f.] ...
| 239504 [vincent.four] Actually, what you see on the screen is the latin1 representation of
| + 239561 [SimonKroeger] ... and PDF generation in Ruby.
| + 239655 [fxn@ha hr f.] Austin explained the issue. But to understand that remark in any
|   239657 [vincent.four] ...
+ 239523 [halostatue@g] The manual is incorrect; I have recently figured out how to write

class design issues
239487 [timid.gentoo] I have a class which takes an input and produces an object. Let's
239489 [shortcutter@] First, it is very hard to actually prevent changes of instance variables
+ 239491 [robert.dober] freeze
| 239502 [timid.gentoo] Sorry, I'm no expert in Ruby. So you have to explain what 'freeze'
| + 239512 [robert.dober] Sure should have been clearer
| + 239524 [shortcutter@] irb(main):001:0> %w{foo bar bx}.shift
+ 239492 [sur.max@gm i] ...
| 239493 [sur.max@gm i] ...
+ 239494 [dblack@wo bl] lf1.name << "more stuff"
  239497 [sur.max@gm i] ...
  239498 [dblack@wo bl] Strings response to "<<", so assuming lf1.name returns a string,
  239500 [sur.max@gm i] ...
  239503 [sur.max@gm i] ...
  + 239509 [alex@bl ck e] Nothing is trying to write to @name - what's happening is that @name
  + 239519 [dblack@wo bl] attr_reader just writes a wrapper method for you.  If the default

gmailer
239490 [unni.tallman] How can i send HTML emails using the ruby gmailer module?
+ 239661 [sonoflilit@g] This is about the pitfalls of how popular email clients read HTML and
+ 239672 [palmerj3@gm ] ...

Using Ruby as an extension language
239505 [hhausman@gm ] I'd like to use Ruby as an extension language for software written on
+ 239508 [farrel.lifso] Programming Ruby (Pragmatic Programmers) has a nice section on
| 239666 [hhausman@gm ] Okay, I've read both these, and things are going nicely.
| 239685 [hhausman@gm ] So, I've found *an* answer to my question, but it feels a little nuts.
+ 239513 [stefano.croc] There's been a thread on this mailing list about embedding ruby. You may be
  239522 [hhausman@gm ] Thanks to both of you, this is all good reading.

how to fail initialize
239514 [james_b@an t] I would like to know the correct way to fail the creating of an object.
239516 [ara.t.howard] def initialize
239521 [james_b@an t] Thanks for quick response, I decided to do error testing before creating

[ANN] wxCocoaDialog v0.3
239515 [stigsen@e- e] wxCocoaDialog v0.3

bitmap manipulation
239525 [james_b@an t] I would normally use FreeImage, but I cannot find a Ruby wrapper for
+ 239527 [aledonne.lis] appears to wrap FreeImage.
+ 239528 [rmagick@gm i] Posted via http://www.ruby-forum.com/.
  239535 [james_b@an t] No ImageScience uses Free Image but does not expose much of it, it
  + 239539 [aledonne.lis] If you have ImageMagick or GraphicsMagick available, RMagick...
  + 239540 [sur.max@gm i] ...
    239546 [james_b@an t] Rmagic looks like it will work a treat.
    239547 [sur.max@gm i] ...

Ruby and R?
239532 [plynchnlm@gm] Is anyone on this list using Ruby and R (the statistics package)
239543 [ara.t.howard] -a
239883 [alexg@ku cr ] I really should get round to updating that page with some RSRuby

Why Unit Testing sucks
239534 [gavin@re in ] "As I was going to St. Ives,
+ 239533 [gavin@re in ] Er...That 2795 should have read 2801. Oops.
+ 239578 [drbrain@se m] You shouldn't write any code without knowing what you're doing.
  239653 [sigma.kappa@] Although some code is a joke - some times even a WTF (also see
  239832 [robert.dober] Are jokes Turing complete?
  + 239866 [ryand-ruby@z] No. And nerd-humor is NEVER funny.
  | + 239871 [twinwing@gm ] ...
  | | 239875 [ryand-ruby@z] It isn't?? Tell me, exactly what _was_ the point?
  | + 239904 [martindemell] m.
  + 239926 [sonoflilit@g] Yes, e.g. Brainfuck.

VMWare WSDL Client?
239536 [eableson@ma ] Greetings,
239538 [halostatue@g] I haven't tried the VIM WSDL with Ruby, but I can tell you that unless
239593 [eableson@ma ] ...
239600 [halostatue@g] The vast majority of the WSDL (it's pretty large at 900k) is the data
254558 [nakahiro@sa ] Sorry for the late response.

Re: object databases in Ruby?
239537 [halostatue@g] IMO, OODBs aren't worth any effort or time. (They're not even worth
239575 [halostatue@g] Fundamentally, OODBs are based around the idea that if OO is good

[QUIZ] Housie (#114)
239542 [james@gr yp ] 1.  Please do not post any solutions or spoiler discussion for this quiz until
+ 239817 [lerno@dr go ] My solution drops the numbers 1-90 into the tickets at random. If
| 239859 [lerno@dr go ] Oops. Missed out the requirement that each column should be filled.
| 239860 [lerno@dr go ] Not very elegant, but it's a minimal fix to my original solution so
| 239877 [arestrep@al ] Quick and dirty hack that fixes the problem of possibly empty columns
| 239905 [has.sox@gm i] Well this is my first attempt at solving one of these quizzes.  Please
+ 239831 [arestrep@al ] My solution to the quiz.  Each of 18 rows is built individually, by
  239843 [lerno@dr go ] Nice. A whole lot more straightforward that my solution.

eclipse and vss plugin
239544 [ghotrapa@ya ] I apologize as this may/is not be a ruby question.
243633 [ghotrapa@ya ] Help!!
243806 [jan.svitok@g] Similar problem, no solution, good advice ;-)
threads.html
top