Larry Wall skribis 2005-10-19 1:43 (-0700): > On Tue, Oct 18, 2005 at 04:43:57PM +0200, Juerd wrote: > : dot sigils are not actually special. They are required on has-variables > : and forbidden on all other. Changing them to be optional is trivial, or > : so I hope. > Dot sigils drive accessor generation, which essentially hoists an > ordinary variable into the object's namespace. They are not just > commentary.
"has" can do this without the dot, in theory. > : (I believe that sigils or twigils should not indicate scope, duration or > : type. The distinctin between the major variable types is useful, further > : distinction is not.) > Eh? Sigils are for type, twigils are precisely for doing weird things > with scope or duration. This doesn't change how I feel about them, though :) Still, I do like twigils for automatically existing variables, like %*ENV and &?SUB. Here, I do see the need and use for indicating scope and duration, but I mostly read the twigil as: this variable is /special/. Global scope needs a twigil because in most cases, the declaration would be nowhere to be found. Declaring superglobals doesn't necessarily make sense anyway. The ^ twigil is needed for the same reason: declaration is implicit. Object attributes are declared by the Perl coder and initialized by code. I know where they come from, and if not, I can look it up very easily. There is no twigil for "my" and "our" variables, and we don't need any. Same for "has": declaration is explicit. > : make $:foo equivalent to :foo($foo) (conjectural) This one is new to me. I'm not sure I understand what it's used for. Is there already some documentation about it? And does this mean $:foo is no longer a private $.foo? (which could be a very good thing, by the way) What replaces that? Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html