Some more thought about the development of Perl 6- in relation to Perl 5. I consider myself an avid Perl user, who has become better and better at the language as time has gone on. I consider the sigil in Perl 5 to be one of the nicest and most natural constructs, because it gives me an immediate idea of what type of data Iâââ‰â¢m dealing with. However, as Perl 6 continues to steamroll its way along, Iâââ‰â¢ve become to fear whatâââ‰â¢s most natural to me- the sigil! That precious $, @, and % is lashing out at me, and why? Why is because Iâââ‰â¢ve accrued a lot of knowledge about clean OO programming with ruby (Perlâââ‰â¢s OO system is a smokes and mirrors kludge that does its job admirably) and I love the elegance of its constructs. It has always made sense to me to hierarchicallize my data- in auction scripts or other scripts Iâââ‰â¢ve freelanced for itâââ‰â¢s always made things so much simpler to find- and as such I love doing the same even with datatypes.
Perlâââ‰â¢s evolution is with me: Perl 6 is doing essentially this- hierarchicalizing datatypes. So much so that, from what I understand from Apoc, and Exegis, I believe sigils will not really mean that much (they'll be the standard definitions, which will be a lot less loosely enforced). Furthermore, there will now be opaque objects, which are basically what I want. If they're implemented as I wish (we'll see- they hopefully will be!), you can consider this a justification of them- otherwise, you can consider this a personal warning. However, it continues with the basic three datatypes that it has always had. Coming from a Perl background this makes sense, arrays, hashes, and scalars (which encompass closures, references, etc.) are all Iâââ‰â¢ve ever needed and used. Unfortunately, coming from a linguistic background, this pisses me off: I expected to be able to subclass ââ∠âArrayâââ¬ÃÂ, and make my own datatypes, without using the sometimes-wonderful ruby construct obj.instance_eval(). I wanted my own defined datatype to be no different from the basic three datatypes- it would be nice if my own ââ∠âPseudo-arrayâââ¬Ã class, for instance, would have the same basic look and implementation as the array class- although it wouldnâââ‰â¢t be adopted by so many programmers (I think), itâââ‰â¢d be possible for not a massive revision to take place, if it was somehow adopted as a basic datatype, or an important datatype.
This would be, to me, the ultimate proof that Perl 6 was the communityâââ‰â¢s rewrite instead of Larryâââ‰â¢s. The community would be able to contribute to what was considered even a basic datatype- such that a basic array could even be modified, if the community thought it should be different. This is the type of revolutionary thought that made perl the asset to the programming community it initially was. Yesâââ¬Ã¦ I know that I could probably write code resembling my @item is PseudoArray, but the first thing people are going to think is ââ∠âthatâââ‰â¢s an arrayâââ¬ÃÂ- and as such its default behavior would have to resemble an array rather than a hash. What if I wanted to have its default behavior resemble neither? Would I be able to do my item is PseudoArray, and if so will people test to see its superclass or just get incredibly confused as to why the item has a sigil? Iâââ‰â¢d prefer my hypothetical pseudo-array class just had a little bit more weight against the titans of Array, Hash, and Scalar. Regardless of whether this suggestion is taken into account, Iâââ‰â¢ll use Perl 6- probably more avidly than Iâââ‰â¢ve used Perl 5, but sigils just continue to scare me.
foreach $letter (letters $.string) { print char(ord($letter) + 1);}
foreach $letter ( (.string.letters) ) { print char(ord($letter) + 1 }
foreach $letter( .item_which_actually_hold_a_pseudo_array.letters ) { }