On Thu, 10 Aug 2000, Larry Wall wrote:
> Can't put a modifier like "constant" in the type slot. The syntax for
> variable attributes will look more like this:
>
> my num $PI : constant = 3.1415926;
> my int @FIB : constant = (1,1,2,3,5,8,13,21);
> my str %ENG_ERRORS : constant = (E_UNDEF=>'undefined', E_FAILED=>'failed');
>
What about:
my %STRUCT : constant = (
Name => str 'Jane',
Age => int 30,
Gender => str 'Female',
Kids => num 2.5
);
or
my %STRUCT : constant = (
str Name => 'Jane'
int Age => 30,
# etc
);
The reason I ask is because (as my example was intended to show) there can
be many different types of data elements in a hash or a list.
Then again, maybe these types of hashes and lists don't NEED to be made
constant, simply because they're CONSTANT and unchanging.
One more thing: Does the 'constant' refer to the hash (ie, the ability to
add and delete items) or to the individual data elements?
Darn typing!! Darn constants!!
--
Mike Pastore
[EMAIL PROTECTED]