-- On Thu, 05 Sep 2002 09:31:45 Damian Conway wrote: >Erik Steven Harrison wrote: > >> I know that the property syntax is pseudo established, >> but I'm beggining to become a bit jaded about all the >> built in properties were building. What about good ol' >> aliases? >> >> sub hidden (str $name, int $force := $override) {...} > >I'm not keen on it because it will be hard to explain >(or detect) the difference between that and: > > sub hidden (str $name, int $force //= $override) {...} >
Just found this hidden in my inbox. I didn't think anyone was paying attention ;-). I think that the difference can be swept under the table in a handwavy sort of manner by pointing out that these subroutine declarations shouldn't be pointing to globals or widely scoped lexicals like that. But this all brings me back to the question of lexical leaking. Are $name and $force lexical to the sub? I know that we are trying to avoid lexical scopes leaking into each other, but I honestly can't figure out how that rules and these argument declarations interact. Someone care to explain? >What I most like about the C<is> syntax is (like methods in >OO Perl), it associates a meaningful *name* with each >deviation from standard behaviour. This is the argument that would win me over to the property syntax. Self documenting code is an admirable goal. But I wonder about our overuse of 'is'. The performance issues of a hash that lives with every variable aside, it all looks the same to me. And I like different things to look different. In a related note, I'm always confused by whether or not we look at the value of the variable or it's name. See below . . . > >I find: > > sub hidden (str $name, int $force is aka($override)) {...} > >*much* more readable, since I can read it in English. Yeah . . . except I want at least single quotes around that darn $override. Required singles even. Having it be context sensitive to the type of property is WAY to subtle for me. And if $override is a reference I'd like that to DWIM (though I understand that I may be the only person for which that behavior is intuitive). And what happens with double quotes - a symref? Ack! If $force is aka(@override) is going to be a compile time error, then why can't we just $force is aka(override) and just carry the typing over. And if it's not a compile time error then what in Knuth's name does it . . . . oh never mind - my head just exploaded. -Erik > >Damian > PS - Ha! My name above Damian's :-) Is your boss reading your email? ....Probably Keep your messages private by using Lycos Mail. Sign up today at http://mail.lycos.com