Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Rebol vs Ruby

From: rebol:techscribe at: 19-Dec-2000 13:25

Hi Galt, Ruby predates REBOL by a year or two (I've been on the Ruby mailing list much longer than REBOL's). IMHO you really cannot compare Ruby to REBOL. From a syntactic point of view Ruby (to me) is extremely cumbersome and cryptic. It is intended as a purely object oriented scripting language and reminds me of a mixture of Java and PHP. Here is a code sample submitted by Steve to the Ruby mailing list: #! /usr/bin/env ruby # Given the number of seconds, convert to English description table = [ [ 31557816, 'year' ], [ 2629818, 'month' ], [ 86400, 'day' ], [ 3600, 'hour' ], [ 60, 'min' ], [ 1, 'sec' ] ] result = "" time = ARGV[0].to_i table.each {|unit, sing, plur| plur = sing+'s' if !plur; size = time / unit if size > 0 result += "#{size} #{(size == 1) ? sing : plur} " end time %= unit } puts result -- [galtbarber--mailandnews--com] wrote: