Algebraic data types: Difference between revisions

m
→‎{{header|Perl}}: Fix comments: Perl 6 --> Raku
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Perl}}: Fix comments: Perl 6 --> Raku)
Line 1,230:
Although Perl does not have algebraic data types, it does have a wonderfully flexible regular expression engine, which is powerfully enough to perform the task.
 
However, representing a tree as a string, and repeatedly parsing that string, is truly inefficient way to solve the problem. Someday, someone will write a perl multi-method-dispatch module which is as amazing as perl6Raku's, and then we can copy the perl6Raku solution here.
 
The $balanced variable matches against either some data, or the empty tree (_), or, using perl's amazing recursive regular expression feature, a non-empty tree.
2,392

edits