Is there any description of main changes in 1.8 over 1.6.x / 1.7.x ? 
Author Message
 Is there any description of main changes in 1.8 over 1.6.x / 1.7.x ?

google post insists "the body of your message must contain some text", so here it is


Mon, 28 Nov 2005 02:56:00 GMT  
 Is there any description of main changes in 1.8 over 1.6.x / 1.7.x ?

I have a file called features-ruby18.txt that has what you want. I
*think* I got it out of the ruby-shim package (in RAA), but if you can't
find it there, I'll mail you the file.



Mon, 28 Nov 2005 07:29:51 GMT  
 Is there any description of main changes in 1.8 over 1.6.x / 1.7.x ?

old dog ...) ha scritto::

Quote:
>google post insists "the body of your message must contain some text", so here it is

I asked this question and they pointed me to
http://www.rubygarden.org/ruby?ProgrammingRubyTwo
from there you'll discover main changes from
http://www.rubygarden.org/ruby?ProgrammingRubyTwo/BuiltinClassesAndMe...

hope this helps



Mon, 28 Nov 2005 07:36:23 GMT  
 Is there any description of main changes in 1.8 over 1.6.x / 1.7.x ?
The only places I know of which discusses this, is:

http://www.rubygarden.org/ruby?ProgrammingRubyTwo
http://www.rubygarden.org/ruby?MovingFrom_1_6_To_1_8

--
Simon Strandgaard



Mon, 28 Nov 2005 07:47:16 GMT  
 Is there any description of main changes in 1.8 over 1.6.x / 1.7.x ?
On 11 Jun 2003 11:56:00 -0700

Quote:
> google post insists "the body of your message must contain some text", so
> here it is

Look at the documentation for "shim" on the RAA: It's a Ruby implementation of
some of the new features in 1.8.

Just a couple things off the top of my head.

Enumerable#partition
Enumerable#zip
Enumerable#all?
Enumerable#any?
Enumerable#inject

Various new methods for other stuff, I haven't looked very much at the other
classes. Look at the test 1.8 version of 'ri'. You can get it at rdoc.sf.net
(I think.) Click on download. 'ri' is at the bottom of the download section.
(This is all IIRC, so I could be wrong.)

Another cool thing: Blocks initializers.

Consider this example:

Quote:
>> a = Array.new(5, Array.new(5,0))
>> pp a

[[0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0]]

(To use 'pp' you need to do a "require 'pp'". I don't think that pp is in 1.6)

This is all well and good, until....

Quote:
>> a[0][2] = "Hello!"
=> "Hello!"
>> pp a

[[0, 0, "Hello!", 0, 0],
 [0, 0, "Hello!", 0, 0],
 [0, 0, "Hello!", 0, 0],
 [0, 0, "Hello!", 0, 0],
 [0, 0, "Hello!", 0, 0]]

So all five elements in the top level array point the same object. So, what to
do? You could do some clever looping, but 1.8 makes it easy:

Quote:
>> a = Array.new(5) { Array.new(5,0) }      
>> a[0][2] = "Hello!"
=> "Hello!"
>> pp a

[[0, 0, "Hello!", 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0]]

Note: The reason (I think. I'm not sure about this.) you can get away without
having '0' in a block is because there's no method for a Fixnum (Or other
numbers in Ruby, for that matter.) that would modify the receiver.

Almost the same deal with hashes:

h = Hash.new { |hash, key| puts "Spawning new array!"; hash[key] = Array.new; }
=> {}

Quote:
>> h["This value has not been used before"].push "Hello!"

Spawning new array!
=> ["Hello!"]
Quote:
>> h

=> {"This value has not been used before"=>["Hello!"]}
Quote:
>> h = Hash.new { |hash, key| "You can't use keys without assigning them first!" }
=> {}
>> h["This value has not been sued before"].upcase

=> "YOU CAN'T USE KEYS WITHOUT ASSIGNING THEM FIRST!"
Quote:
>> h

=> {}

You can even use this to implement a poor man's cache:

Quote:
>> statcache = Hash.new { |h, k| h[k] = File.stat(k) }
=> {}
>> statcache['/etc/passwd']

=> #<File::Stat dev=0x301, ino=16077, mode=0100644, nlink=1, uid=0, gid=0,
rdev=0x0, size=860, blksize=4096, blocks=8, atime=Sun May 04 15:14:44 MDT
2003, mtime=Fri Mar 14 10:35:05 MST 2003, ctime=Fri Mar 14 10:35:05 MST 2003>
Quote:
>> statcache

=> {"/etc/passwd"=>#<File::Stat dev=0x301, ino=16077, mode=0100644, nlink=1,
uid=0, gid=0, rdev=0x0, size=860, blksize=4096, blocks=8, atime=Sun May 04
15:14:44 MDT 2003, mtime=Fri Mar 14 10:35:05 MST 2003, ctime=Fri Mar 14
10:35:05 MST 2003>}

Cool, huh?

Jason Creighton



Mon, 28 Nov 2005 08:11:30 GMT  
 Is there any description of main changes in 1.8 over 1.6.x / 1.7.x ?
Hmmm, that's definitely not the first time that this question was asked
in this newsgroup and I think it's about time, that someone who really
knows the details creates such a list. In my opinion it would be an
important part of the documentation of Ruby 1.8. Especially all the
things that will break existing code.

I would do it myself (easy to say, huh?), but I am certainly not
qualified. Reading the CVS logs didn't enlighten me ...

"Ruby in a nutshell" contains a complete chapter with new features in
Ruby 1.8. Wouldn't this be a good starting point?

Cheers,

   <maik/>



Mon, 28 Nov 2005 14:38:32 GMT  
 Is there any description of main changes in 1.8 over 1.6.x / 1.7.x ?



Quote:
> Hmmm, that's definitely not the first time that this question was asked
> in this newsgroup and I think it's about time, that someone who really
> knows the details creates such a list. In my opinion it would be an
> important part of the documentation of Ruby 1.8. Especially all the
> things that will break existing code.

Apparently there's already such a list (or a multitude of these).  The
problems seems to be finding this information.

    robert



Mon, 28 Nov 2005 16:05:21 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. LE 1.8 wierd COBOL abend dump-longish ( x-posted to IBM-MAIN and COBOL )

2. Change in 1.8 String#=~ intentional?

3. I am searching for a VHDL PCI-Target description

4. I am looking for a VI that login and logout users to a main VI.

5. ANN: Cross-compile Valentina for REALbasic Professional 1.8 released

6. Harbour FAQ revision 1.8 now on-line

7. Answers to Frequently Asked Questions (version 1.8, 15-Jan-92)

8. Slang 1.8 released

9. Free PBMake 1.8 (updates/bugfixes from user feedback are included)

10. New ILU 1.8 Common Lisp support available

11. ILU 1.8 now available

12. The Language List Version 1.8 - Part 9 of 9

 

 
Powered by phpBB® Forum Software