Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Eiffel > Re: TUPLE
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 850 of 913
Post > Topic >>

Re: TUPLE

by J <totuti456@[EMAIL PROTECTED] > Feb 2, 2007 at 04:21 PM

On 2/1/2007 23:04 PM, toto wrote:
> ECMA allows to declare 
> 
>         x: TUPLE[count, balance: INTEGER; name, forname: STRING]
> 
> My question is: "how usefull is it?".
> 
> regards
> 
When using TUPLE, it is useful to access its items by name.
This avoid messing up with indexes and make code maintenance easier.

It is also better to do (nicer and more efficient)
to do
	local
		my_name: STRING
		my_count: INTEGER
	do
		my_name := x.name
		my_count := x.count
		...

Instead of
	local
		my_name: STRING
		my_count: INTEGER
	do
		my_name ?= x.item (3)
		my_count := x.integer_item (1)
		...

That's my feeling on this

-- Jocelyn.




 5 Posts in Topic:
TUPLE
toto <stop-aux-spams@[  2007-02-01 22:04:40 
Re: TUPLE
Peter Horan <peter@[EM  2007-02-02 06:51:07 
Re: TUPLE
J <totuti456@[EMAIL PR  2007-02-02 16:21:46 
Re: TUPLE
"llothar" <l  2007-02-02 15:13:28 
Re: TUPLE
"Greg C" <gm  2007-02-15 17:29:58 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 2:08:11 CDT 2008.