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 'tr

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 k

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 con

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
Someone on this list (TomC?) has supplied a major diatribe against const. > "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

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

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 o

Re: RFC 89 (v1) Controllable Data Typing

2000-08-10 Thread Dan Sugalski
On Thu, 10 Aug 2000, Decklin Foster wrote: > Syloke Soong <[EMAIL PROTECTED]> writes: > > > my $varname type; > > The syntax > > my $varname : constant; # pun not intended :) > > Was brought up earlier (but probably not before this RFC was written). > Perhaps something similar could

Re: RFC 89 (v1) Controllable Data Typing

2000-08-10 Thread Decklin Foster
Syloke Soong <[EMAIL PROTECTED]> writes: > my $varname type; The syntax my $varname : constant; # pun not intended :) Was brought up earlier (but probably not before this RFC was written). Perhaps something similar could be used for the sake of consistency. > if ($somecond