Ask a Question related to Ruby, Design and Development.
-
Dmitry V. Sabanin #1
ruby 1.8 strange behavior
Hi,
I've started making my own C extension to ruby, and found that strange
behavior:
class MyTest
def []=(key,val)
"my_own_return_value"
end
end
test = MyTest.new
p test[1] = "big"
Both ruby1.6 and ruby1.7 puts "my_own_return_value", but ruby1.8 puts
"big". I'm interested if this is right.
I know that it's kinda stupid to do something like this and I found that just
by accident, but anyway :)
--
sdmitry -=- Dmitry V. Sabanin
MuraveyLabs.
Dmitry V. Sabanin Guest
-
Strange behavior when trying to print
Hi, on one of the mac at job i have a strange behavior . Mac is a Double Power G5, Tiger and In Design 3 When i want to print, if i have just... -
Strange behavior
The problem seems to be in c code calling ruby calling c code. ======== start test.rb puts "about to require curses" require "curses" puts... -
Strange behavior of $.
Apparently $. is not always set correct (see second ruby 1liner). Is this a bug? 12:12:42 : cat -n n 1 2 3 BAR="hello" 4 12:12:47 : ruby... -
DropDownList Strange Behavior
I have several dropdownlist controls in a placeholder on my form. Certain events will show this place holder and populate the values of the items... -
Why strange IF...ELSE behavior
Hi all, I'm getting a strange result with the following IF statement: $bar = ($foo == 'last') ? true : false; In my script $foo normaly has... -
ts #2
Re: ruby 1.8 strange behavior
>>>>> "D" == Dmitry V Sabanin <sdmitry@lrn.ru> writes:
D> Both ruby1.6 and ruby1.7 puts "my_own_return_value", but ruby1.8 puts
D> "big". I'm interested if this is right.
The modification is intentional.
Guy Decoux
ts Guest
-
Mauricio Fernández #3
Re: ruby 1.8 strange behavior
On Fri, Sep 12, 2003 at 02:14:36AM +0900, Dmitry V. Sabanin wrote:
The rationale for that is making it work like an assignment:> Hi,
> I've started making my own C extension to ruby, and found that strange
> behavior:
> class MyTest
> def []=(key,val)
> "my_own_return_value"
> end
> end
> test = MyTest.new
> p test[1] = "big"
>
> Both ruby1.6 and ruby1.7 puts "my_own_return_value", but ruby1.8 puts
> "big". I'm interested if this is right.
> I know that it's kinda stupid to do something like this and I found that just
> by accident, but anyway :)
a = b[0] = 1
# here you expect a == 1, not a = return value of []=
Same thing for
a = b.bla = 1
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
MSDOS didn't get as bad as it is overnight -- it took over ten years
of careful development.
-- [email]dmeggins@aix1.uottawa.ca[/email]
Mauricio Fernández Guest



Reply With Quote

