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]Re: [tlug] Alternatives to sed + awk
- Date: Fri, 11 Mar 2011 07:52:45 +0100
- From: Josh Glover <jmglov@example.com>
- Subject: Re: [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>
On 11 March 2011 03:47, Stephen J. Turnbull <stephen@example.com> wrote: > I like functions as first class objects a lot. 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. Everything is a class or instance method, so it doesn't make sense to pass those around. What one usually does is passes around a symbol, then does a target_object.send(method, ...) to invoke it. This makes sense if you take the OOP "messages and receivers" stuff literally. When you need an anonymous function in Ruby not bound to a class or object, you can use a Proc object: my_func = Proc.new do |*args| puts "Golly gee, I was called with #{args.size} arguments!" end my_func.call 1, :two, 'three', 4.0 > I find the Python convention that identifiers named with leading > underscores are private an equally good signal in practice. You mean the Perl convention? ;-P -- Cheers, Josh
- 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
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Browser share in Japan?
- 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