[aklug] Re: perl lists question, sorting, sort of.

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Wed Aug 18 2010 - 09:46:11 AKDT

On Wed, 18 Aug 2010, Christopher Howard wrote:

> Yeah sure, like so:
>
> ruby -e "puts 'hi'; puts 'there'"
>
> You /can/ use semicolons in ruby, you just don't /need/ to use them.
>
> Also, indentation in Ruby is irrelevant to the interpreter. But most
> Ruby programmers still indent for readability.

:-) Thanks for the info. I have obviously never slung a line of code in
ruby. That said, *most* programmers indent for readability (though I don't
see any point for a throw-away one-liner on the CLI), I just couldn't
remember if the ruby crowd had adopted some of python's mandates.

Another question: if you don't typically use semicolons then how do you
split a single line of code across multiple lines? Playing with your source
example it seems to generate syntax errors when I introduce newlines between
some words. Seems there's limited intelligence in the ruby parser for these
issues. Ironically, with semi-mandatory semicolons in Perl it allows the
parser to be even less intelligent and still work. Your instruction
boundaries are always clearly marked.

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Aug 18 09:46:23 2010

This archive was generated by hypermail 2.1.8 : Wed Aug 18 2010 - 09:46:23 AKDT