Saturday, April 19, 2008

Functional programming in Perl!

Both of these happen through perlref, a new feature in perl 5. Essentially, how it works is you can make anything a scalar ($) variable... anything. Sort of.

You can make a scalar variable that points to anything, which is, for the programmer, almost the same thing.

This way you can make a variable that is the curry of a function... I'm not going to go into the details, because my understanding of Perl is, well, yeah... It was fun to find out as I was searching for something else, however.

***Perl, it seems, is a really fun language, for mostly opposite reasons from scheme. Perl's beauty comes from the amount of pre-imposed structure, but a very large language to work with. Pretty Perl is sort of like really well-written blank verse: it is going to have some obtuse words and awkward grammar, but it still flows well.

Scheme, on the other hand, comes from a small rule set, but a language which can be molded and formed as you please. Scheme would be comparable to some of Cummings better works: It follows (almost) no rules of language, but it drags you around the program nonetheless.

...Or something like that. The poetry = programming analogy really falls flat under any rigorous scrutiny, but I hope I got the point across:Perl- a lot of rules, but a lot of ways to exploit themScheme- few rules, meaning absolute freedom to exploit anything and everything.