>>>>> "AT" == Adam Turoff <[EMAIL PROTECTED]> writes:

  AT> On Fri, Feb 07, 2003 at 06:38:36PM -0500, Uri Guttman wrote:
  >> >>>>> "ML" == Michael Lazzaro <[EMAIL PROTECTED]> writes:
  ML> Along those lines, the closest I've been able to come so far to a
  ML> usable two-sentence definition is:
  >> 
  ML> -- A list is an ordered set of scalar values.
  ML> -- An array is an object that stores a list.
  >> 
  >> but you can't derive the rules about allowing push/pop/splice/slice from
  >> that pair of defintions.

  AT> 1) A list is an ordered grouping of scalar values.
  AT> 2) An array is an object that stores a list.
  AT> 3) Assignment and splices can be performed on both lists and arrays.

you can't assign to a list. you can assign to lvalues in a list. the
list doesn't change. it is a list of lvalues before and after the
assignment.

  AT> 4) Operators like push/pop/splice/shift/unshift operate only on arrays.

  >> lists are read only 

  AT> Not quite: ($a, $b, $c) = 1..3;

that list is still unmodified, same size, no elements are changed. the
elements are lvalues which have their values changed, but the list
itself is still read only.

only my two definitions are needed, not 4. simpler is better. :)

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class

Reply via email to