adda/dstr/syntax/is an array a set or a list?:
. an array should be seen as a special case of record,
where the component types are all the same .
. while a component selection has the same functionality
as applying an argument to a function,
and a function can be implemented with an array,
only a read-only array is equivalent to a function .
. the following is what I wrote on the way to
clearing this up in my mind .
. is an array a set or a list?
it's relative to what you expect:
an array could be viewed as either a function,
(one of a range of values depending on the input)
or it could be seen as list .
. if a function expects a value and gets a set,
it's applied to each value and returns a set .
. one obvious thing is that an array is ordered,
and a set is not;
but the reason I was wondering if it should be viewed as a set
is to distinguish it from records:
a record is a unit that happens to have parts,
whereas an array is a multiplicity of units .
. here are the conventions in math:
a set is an unordered, unrepeated list,
and it uses curly brackets;
a tuple is an argument list or a function point,
and it uses parentheses;
a vector, like a record, is a value with components
and it uses angle brackets, or parentheses;
a matrix is like an array, and it uses square brackets,
or rarely parentheses (but it would be confused with
the notation for combinations of n taken r at a time);
a function is a set of tuples .