The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Block Terminator

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Block Terminator Posted: Jun 28, 2005 3:55 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Block Terminator
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

This entry is loose translation of matz blog 2005-06-07 .

Matz added new block terminator to 1.9 branch. He thinks highly of “end”, ordinary block terminator, for reasons given below:
  • Because “end” means an end of a block obviously, a block can be an expression. This point is superior to Python whose block is nothing but statement.
  • Of course, you can do the same thing by using “{ ... }”, but “end” is more beautiful than that in case that a block has multiple paragraphs such as “case … when …” and “begin … rescue …”.

But He cares about that “end”’s visual inpact is a bit too far.

He was inspired by a new programing language Qu , then he add new block terminator ”;;”.

I tried it:
$ ./ruby1.9 -ve '
class Foo
  def self.foo(x)
    p x
  ;;
;;
Foo.foo "Hello, Qu!" 
'
ruby 1.9.0 (2005-06-28) [i686-linux]
"Hello, Qu!" 
Wow! How wonderful! But He warned:
Don’t use this feature seriously. I may delete it without prior notice. —Oops, I should have done this on April Fool.

Read: Block Terminator

Topic: Aimido wins the “We are stupid enough to think that nobody will notice the rip... Previous Topic   Next Topic Topic: Designer CMS on Rails: Programmers needed!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use