Hi --

On Wed, 9 Jan 2008, Joel VanderWerf wrote:

> David A. Black wrote:
>> Hi --
>> 
>> On Wed, 9 Jan 2008, Nikolai Weibull wrote:
>> 
>>> On Jan 9, 2008 1:14 AM, David A. Black <dblack / rubypal.com> wrote:
>>> 
>>>> I might have missed this somewhere, but I'm wondering why p is now
>>>> returning its argument
>>> 
>>> To make it easy to drop in a p in a chain of methods.
>> 
>> It's a private method, though, so it can't go in the middle of a
>> chain, and it's also functional (i.e., p 1, rather than 1.p). I guess
>> it could go at the beginning of a chain. I'm not sure I'm getting it,
>> thoguh.
>
> What's wrong with the beginning of the chain?
>
> irb(main):004:0> p([1,2,3].first).to_s
> 1
> => "1"
>
> Having to get everything to balance right (and still balance right when 
> deleting the debug code) could be a pain, with a more complex expression. Is 
> that what you're getting at? Seems like #tee is more appropriate here.

I wasn't advocating intra-chain usage -- just wasn't clear on what
Nikolai had meant about the chain.


David

-- 
Training for 2008!
Ruby on Rails training by David A. Black/Ruby Power and Light, LLC:
    * Intro to Rails, New York, NY, February 4-7 2008
    * Advancing With Rails, New York, NY, February 11-14 2008
Hosted by Exceed Education. See http://www.rubypal.com for details!