'relaxed' array syntax

Hi!

There’s a feature in perl, which I like (pls don’t flood :slight_smile:
You can place an extra comma after the last element, so eg. in ruby
a= [1,2,3,] wouldn’t generate error message.
Is it possible?
It can be handy, if the elements are long, and you must not worry about
it is the last element, or not.

Gergõ

···


±[ Kontra, Gergelykgergely@mcl.hu PhD student Room IB113 ]---------+

http://www.mcl.hu/~kgergely “Olyan langesz vagyok, hogy |
Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval kellene jarnom” |
±- Magyar php mirror es magyar php dokumentacio: http://hu.php.net --+

Err, yes it works exactly like that in Ruby - try it!

Brian.

···

On Mon, Apr 28, 2003 at 09:39:47PM +0900, KONTRA Gergely wrote:

There's a feature in perl, which I like (pls don't flood :slight_smile:
You can place an extra comma after the last element, so eg. in ruby
a= [1,2,3,] wouldn't generate error message.
Is it possible?

Hi –

···

On Mon, 28 Apr 2003, KONTRA Gergely wrote:

Hi!

There’s a feature in perl, which I like (pls don’t flood :slight_smile:
You can place an extra comma after the last element, so eg. in ruby
a= [1,2,3,] wouldn’t generate error message.
Is it possible?

Don’t you have Ruby installed? :slight_smile:

irb(main):002:0> a = [1,2,3,]
=> [1, 2, 3]

David


David Alan Black
home: dblack@superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

With all due respect, a 10 second test would have told you the
answer. Shorter than composing the question to the list!

irb(main):001:0> a = [1,2,3,]
[1, 2, 3]

···

— KONTRA Gergely kgergely@mlabdial.hit.bme.hu wrote:

Hi!

There’s a feature in perl, which I like (pls don’t flood :slight_smile:
You can place an extra comma after the last element, so eg. in ruby
a= [1,2,3,] wouldn’t generate error message.
Is it possible?
It can be handy, if the elements are long, and you must not worry
about
it is the last element, or not.


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.