From: Robert Klemme Date: 2006-07-30T18:20:14+09:00 Subject: Re: calling a method for an object in a .each block cont./ch (late reply due to holidays) william robb wrote: > Thanks for the code. I will have to digest the syntax a bit to see > exactly > what you are doing here ... I had wondered what .freeze was good for. It prevents changing of an object. You probably found out by now... irb(main):001:0> s="foo" => "foo" irb(main):002:0> s.gsub! /./, 'x' => "xxx" irb(main):003:0> s.freeze => "xxx" irb(main):004:0> s.gsub! /./, 'y' TypeError: can't modify frozen string from (irb):4:in `gsub!' from (irb):4 from :0 > On that other topic, I think it was around V5 that turbo pascal became > OO. Or even 5.5 - I'm not 100% sure. > The first version was what made Borland a success, as it was a dirt > simple > implementation of a real programming language, with one of the first > IDEs. I still have the manual, complete, about the size of a paperback. And the compiler was very fast because it was a one pass compiler (like all PASCAL compilers, it's made possible by the language's design). > I do remember thinking, when I encountered Pascal's Record data type; "I > wish I could store a procedure in one of these fields ..." People at > Borland must have > thought that too, eh? Maybe they even read your mind - or NSA trapped your phone. :-) > Then came C, and Pascal kinda withered away ... Wasen't 'cool', but was > a good workhorse. Personally I still find PASCAL a pretty good language for learning to program since it makes many things rather explicit. IO of standard PASCAL is bad though. MODULA was a complete disaster IMHO - good ideas but implemented awfully. IIRC you needed to call a different IO function for every different basic data type - no polymorphism. Kind regards robert