Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] Alternatives to sed + awk
- Date: Fri, 11 Mar 2011 14:18:28 +0100
- From: Josh Glover <jmglov@example.com>
- Subject: [tlug] Alternatives to sed + awk
- References: <AANLkTim_-D9CFYC8TNp33ni85zB+QBA7jV=BpLN=4SbZ@example.com> <4D6F8D94.9040109@example.com> <87ei6nl906.fsf@example.com> <AANLkTimk1z41fSvQQmU+7fE-1Krd_kuo3_z-1SYD5rW6@example.com> <87ipvskik1.fsf@example.com> <AANLkTi=_6DoBt+xfQVOwM6KyKrxxgA_Ec9bhp751f15y@example.com> <8762rsjkdx.fsf@example.com> <AANLkTik=tHOgTRvcvNd0qsx9-o9MuqBnWUjkWVn+0U_7@example.com> <87vczro8pk.fsf@example.com> <AANLkTi=SZg5g1q1wkDzH0axaFwj0qEeMrzz+C4JVMhSa@example.com> <87r5aeqsoj.fsf@example.com> <AANLkTimvUyFO2w5GknZnO2BXgTgBh3OjYetkoTDaaMCk@example.com> <AANLkTinpP4s4V26Z37NkUq-MHXZkB_2wq99_x73V9WeB@example.com> <AANLkTimUqj5mARNB1JjDWmMk4NL=mNRrkQgb65ZaMOBm@example.com>
On 11 March 2011 13:58, Stephen J. Turnbull <stephenjturnbull@example.com> wrote: > On Fri, Mar 11, 2011 at 3:52 PM, Josh Glover <jmglov@example.com> wrote: > >> I do as well in Python and C (heh heh); it just turns out that you >> never need them in Ruby. I actually don't use functions at all in my >> Ruby code. > > I meant to include "methods", not just bare functions. So, you don't > use functions like, say, sin()? Yow! (pi/4).sin, is that it? :-) Math.sin(Math.pi / 4) http://www.ruby-doc.org/core/classes/Math.html > def logistic(x) > return 3.82*x*(1-x) > > simple_chaos = (logistic,0.5) > > while True: > print (simple_chaos()) logistic = Proc.new {|x| 3.82 * x * (1 - x) } simple_chaos = Proc.new { logistic 0.5 } puts simple_chaos.call while true > Au contraire, it's surely makes sense to pass around a bound method > (ie, a method which knows which object it's attached to); a special case > of a closure. It does, and I imagine Ruby provides a way to do that. I just can't think of a time when *I* needed it. I'd probably just pass a Proc that makes the method call; an actual closure. :) Cheers, Josh PS: Sorry about the dup, Steve. Stupid Gmail respecting your Reply-to. ;)
- Follow-Ups:
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- References:
- [tlug] Alternatives to sed + awk
- From: Nguyen Vu Hung
- Re: [tlug] Alternatives to sed + awk
- From: Alexander Danilov
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Alexander Danilov
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Josh Glover
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Josh Glover
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Josh Glover
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Josh Glover
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Alternatives to sed + awk
- Next by Date: Re: [tlug] Alternatives to sed + awk
- Previous by thread: Re: [tlug] Alternatives to sed + awk
- Next by thread: Re: [tlug] Alternatives to sed + awk
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links