LWN.net Logo

Apocalypse 6

Larry Wall has posted Apocalypse 6, a look at how Perl 6 will handle subroutines. "Unlike regexes, Perl subroutines don't have a lot of historical cruft to get rid of. In fact, the basic problem with Perl 5's subroutines is that they're not crufty enough, so the cruft leaks out into user-defined code instead, by the Conservation of Cruft Principle. Perl 6 will let you migrate the cruft out of the user-defined code and back into the declarations where it belongs."
(Log in to post comments)

Apocalypse 6

Posted Mar 11, 2003 4:08 UTC (Tue) by torsten (guest, #4137) [Link]

Huh? What in the world does that mean?

Apocalypse 6

Posted Mar 11, 2003 8:04 UTC (Tue) by jjstwerff (subscriber, #4082) [Link]

It means that in perl 5 you should declare parameters inside a function. No type checking on parameters was possible on compile time. The parameter handling is the cruft...

Apocalypse 6

Posted Mar 11, 2003 11:06 UTC (Tue) by torsten (guest, #4137) [Link]

Thanks - does this mean perl will now require strong typing and function prototypes? (I've only been coding perl for a month now). I've enjoyed not having to define my data types, just assign anything to anything is great for rapid development. I've also enjoyed passing arguments without specifying arguments. Will this style/behaviour change, now?

Apocalypse 6

Posted Mar 11, 2003 11:20 UTC (Tue) by afaus (guest, #5089) [Link]

Not really. It just means that Perl will allow you to optionally add types in your parameter signature.

But even if you don't use the new types mechanism, the new subs have a lot of improvements.

The compiler will be able to check that you have provided the right number of arguments, and you will be able to call your subs both positionally and by name.

For example:

sub foo($first, $second) {...}
foo(1,2); #ok
foo($first => 1, $second => 2); # also ok

There is much more on Apoc6... but it's not easy to summarize it in a few lines.

Apocalypse 6 [Help Larry Out]

Posted Mar 11, 2003 13:40 UTC (Tue) by smoogen (subscriber, #97) [Link]

I had read that Larry Wall was out of a job recently and will not be getting further funding from the Perl Foundation this year. I find it remarkable that in such tough times, Larry has continued to work on the Apocolypse's.

Copyright © 2003, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds