On Wed, Mar 19, 2003 at 01:18:48PM +0100, Angel Faus wrote: : Is this equivalent to "prof $foo = 0"? If it is not, I would claim : this to be a major violation of the principle of minor surprise.
:-) : Maybe it would be saner to use: : : prop $foo is default(0); I suspect you mean prop $foo is init(0); since "default" probably brings to mind //= semantics. : Otherwise the mythical unwarned user would think that "$foo = 0" is : executed on every call to the subroutine. Well, people *will* write state $foo = 0; The question is what that should mean, and which major set of people we want to give the minor surprise to, and how much effort we want to expend in training to avoid the surprise in the first place. There's something to be said for keeping = as assignment outside of sigs. But it's not clear whether that = is part of a sig... And there really are a number of possible gradations of meaning: state $foo = BEGIN { x() } # compile time state $foo = CHECK { x() } # delayed compile time state $foo = INIT { x() } # process start time state $foo = START { x() } # on first call to func? state $foo = FIRST { x() } # before each call (bad) Most use will be to init with a compile-time constant, so I suppose we could train people to just say: state $foo ::= 0; We don't have a word for "START" right now. It's somewhat equivalent to state $foo //= 0 unless $foo gets undefined, I suppose. Larry