| GumbyBRAIN | I say give it some time, maybe it's just a cancer on my machine. |
| somian | dammit. I am going to have to read the src to solve this annoyance. |
| Jmax- | i hate doing that i'm doing that right now with POE::Wheel::ReadLine :\ |
| carson | how do i pass a EXPR (anonymous sub?) to a function? i want to write a sub like map |
| Woosta | foo( sub{ do this } ) |
| carson | so i can do sum_from_1_to_5 { $i * $i } or whatever |
| somian | You use "prototypes", carson |
| carson | why don't i have to do do sub{..} with map? is it special? |
| Woosta | whuh? yes, map is special |
| carson | k. |
| somian | carson: here's how sub mywacky (&) { stuff ... } You will want a "prototype" of (&@) actually, IIRC That's all in the Camel btw, buy it, read it, cherish it. |
| Woosta | You don't need the prototype though .. |
| somian | Woosta? |
| Woosta | eval: with_1_to_5( sub{ print $_ } ); sub with_1_to_5{ for( 1 .. 5){ $_[0]->($_) } } |
| buubot | Woosta: 1 2 3 4 5 |
| somian | That's not what the op ask ed for, tho. |
| Woosta | [17:59] <carson> how do i pass a EXPR (anonymous sub?) to a function? |
| carson | i basically just want to do whatever map does. let me experiment for a sec. |
| somian | map { stuff } @list |
| carson | but not on a list. :-) |
| somian | There's no "sub" there. You don't need to experiment, you just need to buy the Camel and read it. |
| Woosta | Ahh .. so you don't really want an anonymous sub .. you want it to evaluate {} as an anonyfunc rather than a hashref .. |
| carson | yeah i don't want a hash. |
| crayolarx | mmmm...hash |
| action | somian taps the mic ... hmm, is this thing on? |
| somian | taps the mic ... hmm, is this thing on? |
| crayolarx | yes it is |
| Woosta | Setting the prototype doesn't fix that though |
| somian | I think carson has me on /ign His loss, {shrug} |
| carson | i'm just doing an integration.. i want to do a: sumOnAtoB sub { f($_) * $width }; somian, no i hear you. i don't understand the &@ thing though. |
| Woosta | So .. how did my from_1_to_5 not answer that? |