Re: Data type and attribute syntax (was Re: RFC 89 (v1) Controllable Data Typing)

2000-08-11 Thread Dan Sugalski
At 02:29 PM 8/11/00 +1000, Jeremy Howard wrote: Dan Sugalski wrote: The syntax is actually: my type $varname; This is in perl 5.6.0. Modifiers go as attributes after the colon: my Dog $spot : constant = new Dog; Yes. But what about types and attributes within complex types?

Re: Data type and attribute syntax (was Re: RFC 89 (v1) Controllable Data Typing)

2000-08-11 Thread Chaim Frenkel
Someone on this list (TomC?) has supplied a major diatribe against const. chaim "JH" == Jeremy Howard [EMAIL PROTECTED] writes: JH Dan Sugalski wrote: The syntax is actually: my type $varname; This is in perl 5.6.0. Modifiers go as attributes after the colon: my Dog $spot : constant

Re: Data type and attribute syntax (was Re: RFC 89 (v1) Controllable Data Typing)

2000-08-11 Thread Dan Sugalski
At 10:58 AM 8/11/00 -0400, Chaim Frenkel wrote: Someone on this list (TomC?) has supplied a major diatribe against const. Maybe, but I don't see what's wrong with: my $foo :const = 12; A nice, named, lexically scoped constant. The optimizer should be able to make reasonably good use of that.

Re: Data type and attribute syntax (was Re: RFC 89 (v1) Controllable Data Typing)

2000-08-11 Thread Chaim Frenkel
"DS" == Dan Sugalski [EMAIL PROTECTED] writes: DS At 10:58 AM 8/11/00 -0400, Chaim Frenkel wrote: Someone on this list (TomC?) has supplied a major diatribe against const. DS Maybe, but I don't see what's wrong with: DS my $foo :const = 12; DS A nice, named, lexically scoped constant. The

Re: Data type and attribute syntax (was Re: RFC 89 (v1) Controllable Data Typing)

2000-08-11 Thread Dan Sugalski
At 05:09 PM 8/11/00 -0400, Chaim Frenkel wrote: Hmm, perhaps we should rename the attribute :read-only Works, though I like "constant" (or const, that's OK) just as much. Might be worth having a way to set things to read-only temporarily, too. Won't help the optimizer, but it could

Re: Data type and attribute syntax (was Re: RFC 89 (v1) Controllable Data Typing)

2000-08-11 Thread Jeremy Howard
Chaim Frenkel wrote: A nice way of making a value read-only is lovely. And let it be a runtime error to modify it. The caller can easily do a foo eval{$const_item} to remove the read-only attribute. Hmm, perhaps we should rename the attribute :read-only Can't we make a value 'truely

Data type and attribute syntax (was Re: RFC 89 (v1) Controllable Data Typing)

2000-08-10 Thread Jeremy Howard
Dan Sugalski wrote: The syntax is actually: my type $varname; This is in perl 5.6.0. Modifiers go as attributes after the colon: my Dog $spot : constant = new Dog; Yes. But what about types and attributes within complex types? - Constant refs vs refs to constants? - Types of hash