From: Peter Hickman Date: 2010-09-06T22:40:14+09:00 Subject: Odd functional programming question Ok this is probably not really functional programming but I was just noodling about with Ruby when I thought "it would be quite nice if I could do X". In this case X is as follows: def X(text, action) x.action end >> X("abcedf", size) => 6 >> X("abcdef", upcase) => "ABCDEF" >> X("abcdef", gsub(/[aeiouy]/, '_')) => "_bcd_f" Quite clearly this does not actually work, otherwise I wouldn't be asking. But is there some way in Ruby to do something like this?