On Wed, Feb 16, 2005 at 01:55:31PM -0600, Patrick R. Michaud wrote: : And to : anticipate the followup question of "Well, why not make features such : as junctions into optional modules?", I think a partial answer is that : features like these really need deep language support to work : effectively in their complex applications. Otherwise we'd just : stick with Perl 5. :-)
That, and we'd like a novice to be able to write given $x { when 1 | 2 | 3 {...} when 4 | 5 | 6 {...} } without having to know there are junctions there underneath. Forcing them to cargo-cult a "use junctions" declaration merely to get switch alternatives would not solve any problems I can think of. Nor would inventing a separate switch syntax for alternatives be appropriate when we can make junctions work for that in a semi-orthogonal fashion. As I said elsewhere, the training wheels probably belong on the variable's type checking, not on the underlying type space. Variable types are *views* into the actual underlying object types bound to the variable, and so variable types can place arbitrary restrictions on the use of those underlying general types. Larry