[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6538] Re: Question about the behavior of write attributes in blocks

From: "Christoph Rippel" <chr@...>
Date: 2000-11-23 00:42:05 UTC
List: ruby-talk #6538
I lifted the following two lines from your (great) book - Page 285
************
a = ["a","b","c","d"].
a.collect! {|x| x+"!"}
p a
*************
which has the output
>> undefined method `a' for ["a", "b", "c", "d"]:Array (NameError)
The output of
******************
a = ["a","b","c","d"].collect! {|x| x+"!"}
p a
******************
is the indented
>> ["a!", "b!", "c!", "d!"]
what is going on ? Also the new method is removed from Fixnum on the other
hand the code segment
************
p 34.id == 34.id
************
returns >> true  - in contrast to
************
p "x".id  == "x".id
***************
which returns >>false.  From this I would conclude that  ``34''  is
semantically a singleton ``34'' object - but the interpreter barks at the
following lines
*********
module Withbla
def bla
end
end
x = 34
x.extend(Withbla)
***********
with the complain >> `extend_object': can't define singleton (TypeError)  -
what is the semantic reasoning behind this?
Thanks,
   Christoph





In This Thread