From: Justin Vincent Date: 2006-06-21T23:07:59+09:00 Subject: Using parenthesis/barackets in ruby Hi, I'm new to Ruby, and have just started playing with it - nice. I note that one big complaint from a-lot of folks is the lack of parenthesis/barackets. Old habits die hard - for some of us :) I was curious to see if ruby could be programmed with parenthesis/barackets even though it isn't supposed to. To my suprise this worked... #--------------------------------------------------- def print_dir ( path ) Dir.foreach(path) do |file_name| ( ( if ( File.ftype( file_name ) == 'directory' ) ( print "[dir] #{file_name}\n" ) else ( print " #{file_name}\n" ) end ) ) end end print_dir ('.') #--------------------------------------------------- Is there any reason why I should not be doing this? What is it actually doing from a code/processing point of view? If there are no issues, I would like to work with ruby this way because it helps me to visualize my code blocks, and I also find it useful because my text editor can match brackets and easily highlight code blocks. Cheers, JV -- Posted via http://www.ruby-forum.com/.