Does the unpacking participate in dispatch? If a Hash comes in as $t with no 'left' key, will it fail to match?
On Tuesday, March 9, 2010, Little Walker <en...@dircon.co.uk> wrote: >> Which is pretty powerful, really. > > Absolutely - I think you're referring to the 'type subset' stuff which > is great. > >> This is where Perl 6 is not the same as functional >> languages, since it's got an imperative OO element as well. > > True, there can be friction between the functional style and OO, but > look at how Scala manages it with case classes. When you look at the > implementation, really it boils down to syntactic sugar but then so do > many of the cool new features in Perl 6! > > I bring this up because when thinking of what will be possible with > lazy evaluation, junctions, named parameter shorthand, closures, etc., > etc., somehow pattern matching screams out at me. It can be concise, > expressive and unambiguous, and very complementary to Perl 6's > existing feature set. I know a lot of work went into bringing > functional and OO together to make Scala happen, so certainly there > may be impracticalities in just 'adding pattern matching'. > > Scala case classes: http://www.scala-lang.org/node/107 or > http://programming-scala.labs.oreilly.com/ch06.html#CaseClasses > > -- Mark J. Reed <markjr...@gmail.com>