lunes, 7 de marzo de 2011

Perl Higher Order Functions

I've been chit-chatting with a friend who's learning Perl5, and has written some little apps for his own needs. While reviewing his code (not that I'm a programming guru, but I help with what I can), I talked about Higher order functions, and we ended writting some throwaway code to explain the idea.

To clarify the concepts, I wrote some trivial scheme functions-as-data munging in scheme, and translated them to Perl.

What surprised me, was the "wow!" comments about concepts that aren't perl unique features, but general higher order procedures. Certainly, Java and C++ are 'a bit' behind Perl, Ruby, or Lisp, but it's fun to remember how mind blowing are these concepts to newcomers. I discover mind-blowing concepts quite frequently too.

We had a good afternoon, reviewing code, Quines, concurrency, talking about GEB (The book I'd take to a desert island along with SICP)...

Here's part of the code we've written (as a reminder). Nothing useful, but tiny proof of concept of HOP. Ah, btw, I recommened him to read chromatic's Modern Perl book. I recomend it to all of you in the Perlsphere. Great book.

2 comentarios:

Unknown dijo...

Behind the point of view of the friend, that guy is the closest thing
to a guru he ever known.
If you expect to learn something from the net this is a good place to stay in, what I mean is:

"HOFs ARE FUN IN PUNTOBLOGSPOT"
HOFs ARE FUN IN PUNTOBLOGSPOT

;)

Raimon Grau dijo...

Jaj! Thanks for the words.
See ya on the next hackernoon :)