Glenn Linderman wrote:
> [currying] appears to be powerful, and a kind of like generic programming on
> the fly.  I'd like to learn more: if someone would give a tutorial
> reference that would be helpful.

I'll try to find something. There's a bit of computer science snobbery
related to functional programming -- it'd be really cool if Perl could
crash that party.

> I'd like to see the useful, non-trivial operations in his table
> available using simple syntax outside the switch statement; they could
> then be expressed in the switch statement conditions, or in if
> conditions, or while conditions, or any other useful place, rather than
> having the programmer be forced to contrive a switch statement to avoid
> writing the non-trivial operation syntax.

Oh, the table thing. The switch statement is useful without learning the
complete table so I don't think complexity is a big problem. People can
learn what they need and ignore the rest. I agree with you that it might
be nice to have an array membership operator (like "in") so that you can
write:

  if ($x in [ 1, 2, 3 ]) ...

instead of

  switch ($x) {
    case [1, 2, 3]: ...
  }

Why don't you write an RFC for the extra operators you want?

> I'll probably counter-propose as Damian suggested, as it does, indeed,
> look like we are quite far apart on this issue, and it would take more
> than a few postings to resolve.

Actually the root problem seems to be that you're talking about two
different things. I don't think you disagree at all.

- Ken

Reply via email to