RE: [sv-ec] Re: Mantis 1447 - dynamic arrays

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Nov 29 2007 - 08:53:24 PST
Mike, 


		

		The new[] operator is used to set or change the size of
the array. 
		The size() built-in method returns the current size of
the array. 
		The delete() built-in method clears all the elements
yielding an empty array (zero size). 

		[SB] Can size() and delete() be used with dynamic
sub-arrays? It says that new[] cannot, but does not say about the
others. If not, is that missing functionality?

	[MB] It only says that new[] can't be used with dynamic
subarrays in declaration initialization assignments - in array
assignment contexts it can. This is the only way to initialize dynamic
subarrays. I see no restriction on using size() and delete() on dynamic
subarrays, and see no reason for any.
	

		

		[SB]  You're right about new[]. The text was ordered in
a way that confused me. The text also has examples of using new[] both
on an entire array and on a subarray.
		 
		By the way, the text uses the term 'subscript', but that
is not the term used in the LRM, but rather 'index' (plural is
'indices').
		 
		I think there should be examples showing size() and
delete() on subarrays, so that it will be clear that it is legal.
		 
		In the BNF, footnote 40 refers to the 'new keyword
construct'. That's a bit wordy, I think 'new keyword' is enough.
		 
		I don't think it actually says anywhere that the range
of a dynamic dimension is [0:n-1]. It needs to.
		 
		The discussion of new[] is quite long and I have the
feeling it is not quite coherent with respect to order of the subjects
and I think there is some repetition and some unclearness as to what
applies to new[] in declarations and what to new[] in assignments. But
that requires more study to give more specific comments.
		 
		Regards,
		Shalom
		 

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Nov 29 08:56:18 2007

This archive was generated by hypermail 2.1.8 : Thu Nov 29 2007 - 08:56:59 PST