"I'm not actually a computer programmer. I'm really a model/actress. I just work here part-time to pay for my organic breathing lessons." -- take-off on a running gag in "At the Rialto," a short story by Connie Willis.
Welcome. Connie Willis is a great author. Haven't gotten around to reading 100% of her stuff yet, though. -- DougMerritt
A number of her works are very FunnyScienceFiction. "At the Rialto" shows up in two anthologies that I'm aware of: the Willis collection Impossible Things (ISBN 0-553-56436-6 ) and Women of Wonder: The Contemporary Years: Science Fiction by Women from the 1970s to the 1990s edited by Pamela Sargent (ISBN 0-15-600033-4 ).
My other wiki presence can be found at BookShelved: http://bookshelved.org/cgi-bin/wiki.pl?ElizabethWiethoff.
I stop by and lurk a bit each day, but I've reduced my participation significantly because I'm becoming a different person. <twilightzone>doo doo doo doo, doo doo doo doo</twighlightzone> :-)
The bio-like object:
Sometimes professional, sometimes hobbyist, often accidental, incidental, and as needed geek.
Currently a dazed hobbyist dinosaur on my MacOs 9 lime iMac.
Ha! :-) That's funny. What a creative way of looking at wiki.
Enjoy
Now that GoogleLovesWiki again, allow me this opportunity to boost the GoogleJuice of a few friends.
To be moved eventually to RubyCallStack?:
Eliz Have a look at RubyCoerce about the right association problem. If I can help solve a problem just ask. See further comments on RubyCoerce. Surely this community exists to share what we know. -- JohnFletcher
Eliz, which version of RubyLanguage are you using? I am having some trouble duplicating one or two of your results. If I can sort that out I think I should be able to explain some more of what is happening when using RubyCoerce. -- John
I'm a dinosaur. I'm running Ruby 1.6.7. I assume you're running something newer. It's disturbing to think that a different version produces different results. -- Eliz
At the moment it looks as though 1.6.7 and 1.8.2 behave the same. The version 1.8.4 which I have on Fedora 4 seems to be different. The difference is what is on the call stack when the expression is 1-x, where x is the user type. For this case with 1.8.4, where the first operand is a number (Ruby Fixnum), the call is as if from the main program, so that the operator does not appear in the call stack string, so cannot be detected. For a-x, where a is some other Ruby class which has operators defined for + and -, then the operator does appear in the call stack string. I have downloaded the source code of 1.8.4 to look in the change log. -- John
Maybe get around the version problem by checking the call stack in coerce, instead of in subtract. However, I don't like the thought of coerce needing to know that subtraction is special; I prefer to have subtraction know that subtraction is special. -- Eliz
The problem is that in that case the call to coerce does not contain information on the stack as to what has made the call, which has come from operator - as defined for Fixnum. The call stack string does not contain this information any more. This is the change from version 1.8.2 to 1.8.4. I have looked in the changelog and not found any obvious cause. -- John
Maybe it's time to file a bug report, or at least a weirdness report, to alert the Ruby community of the new behavior. -- Eliz
It looks so. The code which does the numeric work is in numeric.c and the code which prints out the message is in a function backtrace in eval.c. Neither of those parts of the code seem to have changed. The information about the calling function is contained in a variable ruby_frame->orig_func which is set in only one place, in rb_call0, also in eval.c. It is set to zero in several places, and in that case the print is skipped. It looks as though some change elsewhere is cleaning up the value. There are several references in the ChangeLog to eval.c in 1.8.4. I have been comparing the source codes of versions 1.8.0 and 1.8.4.
I am now playing with a copy of 1.8.4 by modifying and recompiling the source. I have established that the routine rb_num_coerce_bin in numeric.c knows the name of the calling routine before and after the call to the coerce defined for Rectangle. The knowledge must be lost in the complex calling sequence in eval.c.
Found it From the ChangeLog:
Wed Jun 8 08:33:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
if (frame->prev->node == n) continue;If this is commented out then the previous behaviour is restored. This code is in versions 1.8.3 and 1.8.4.
I have had a look around the various web sites and not found an obvious location for reporting problems. -- John
Great detective work! I wonder why this "feature" was added to Ruby 1.8.3. I guess I'll look around for where to report this. Maybe I'll ask the guys at the local Ruby user group. In the meantime I'm scratching my head wondering how to accomplish the exercise without peeking at the call stack (which struck me as quite a hack). I think Python and C++ beat Ruby when it comes to that exercise. -- Eliz
Thanks. I had thought of Emailing to the contributor of the patch. My guess is there is some other reason that it was put in. If you send me an Email to J.P.Fletcher@aston.ac.uk I will send you a copy. I have some tidier code for some of your things. I had not come across this before, because for me + and - both make sense and also I working with a SWIG interface where I control all the operators, comparable to your situation with Python. -- John
RubyLanguage will be patched with the solution with the next release. A one line patch has been added. In the meantime, do not use 1.8.3 or 1.8.4 for this without rebuilding it yourself. -- John
Thanks. Now I'm marveling at the international OpenSource community! -- Eliz
I like your solution to the problem (on the RubyCoerce page). I had been trying from the other end by overloading the operator - of FixNum. Yours is very neat. -- John
Thanks for the compliment. Defining the subtraction operator for Numeric was the first thing I tried, and it didn't work. That's when I decided to carp on WhyWeHateRuby about my inability to define right-associated operators, and that's when you came along and introduced me to RubyCoerce. I came up with the BogusRectangle idea last night talking to my beau. All he knows about programming is what he did years ago in BasicLanguage on his Commodore 64, so I have to make sure to use the word "subroutine" a lot when I try to explain my newfangled programming ideas to him. ;-) I wrote up the code today and, on a lark, showed it to him. He said, "I'm really thrilled about your Ruby program. It's very elegant. Elegance is important to me as a mathematician." I rule! I discovered a problem with that solution, though, as I explain on the RubyCoerce page. After reading my AppleScript book awhile (get my mind off things) and gazing at the online PickAxeBook, I came up with something that I think is more elegant and more Ruby-ish. Take another look at RubyCoerce. -- Eliz
Thank you. I like your new version as well. It is indeed elegant. I have learned things I didn't know about RubyLanguage. Also, we have, between us and Nobuyoshi Nakada, tracked down and fixed a bug in the core code of Ruby. I can confirm that both your new methods work fine with Ruby 1.8.4 without the patch. -- John
Hooray! Thanks for all your help. Have you also tried some operator chaining tests?
5 + Rectangle.new(3, 4) - 1 5 + Rectangle.new(3, 4) - Rectangle.new(1, 1)These should work, not raise an exception.
These both work with your latest version. I am having problems (spurious failure) with the earlier version. The reason is that the result of the operation
5 + Rectangle.new(3, 4)has the class BogusRectangle. It looks like a good reason for preferring the second one where the object under consideration does not change class. -- John
Yep. Those "spurious failures" are why I ended up unhappy with the BogusRectangle version. -- Eliz
I have had to revisit my own implementations for RubyCoerce. One case was failing in some code I had not looked at for a while. The code is an interface for CeePlusPlus classes to be accessed from Ruby. The problem turned out to be in the setting up of the vector to pass back to Ruby. If you are interested look at PromotionTraits for a discussion of the problem. It has taken all evening.
I had another problem which turned out to be an incompatibility between the Ruby development interface and one of the BoostLibraries. They both had a macro called ALLOC! To solve that I had to edit my local copy of ruby.h!! -- John
Yep. Macros stomp NameSpaces like Godzilla stomps Tokyo. -- Eliz
Messaging:
It is so nice to hear from you after so long. I have kept on with this wiki working on what interests me and from time to time having good conversations. I have just discovered OneNote which works a bit like a wiki in some ways, but not the open communication. It integrates well with MicrosoftOutlook which is standard at work now. Have you looked at it? Best wishes -- JohnFletcher
Thanks for your nice note. I hadn't looked at OneNote until you mentioned it above. I don't imagine I'll ever use it considering I have no M$ products other than InternetExplorer 5.2.1 for my old Mac, but I'm glad you're happy with it. Keep on wikiin'. I was doing JavaSwing with JayRuby in my absence here, but now I'm (yet again) sick of computers. So now I'm concentrating on something entirely low-tech: singing opera! -- Eliz
Sorry, I had forgotten that you did not use M$ products. I have to be dual use - I do most of my programming on Linux systems, but for most things I am on M$. Best wishes for the singing. -- John
Hi Elizabeth, thanks for thinking of me. I read KimStanleyRobinson's Mars trilogy a number of years ago and really liked it. I'll look for the climate change books. Hope all is well with you too. -- RonJandrasi
For mood & illness issues, if still relevant, maybe look into Vitamin D deficiency (common in indoor programmer types) and also Dr. Joel Fuhrman's Eat To Live approach (heavy on vegetables, fruits, and beans)? Both helped me. -- PaulFernhout