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: Sun, 13 Mar 2011 08:47:32 +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> <AANLkTimvUyFO2w5GknZnO2BXgTgBh3OjYetkoTDaaMCk@example.com> <AANLkTinpP4s4V26Z37NkUq-MHXZkB_2wq99_x73V9WeB@example.com> <AANLkTimUqj5mARNB1JjDWmMk4NL=mNRrkQgb65ZaMOBm@example.com> <AANLkTik72Yi07x9Ww3SPStQ7QboVe=aCQECSpf8y1JuH@example.com> <AANLkTinUhYjxBsMqXWx0uOM6ohedbj-DzW3_q+-n=oGn@example.com> <AANLkTimOGdBgj6UMtab72iVpQr66yqD17gZAOuDY3=5y@example.com> <AANLkTimCT6YfG603_5dy5yC=GcqjacMXGmPsqhaoEy7B@example.com>
On 13 March 2011 08:17, Stephen J. Turnbull <stephen@example.com> wrote: > Reread what I wrote. It's not about syntax, it's about semantics. .sin doesn't > care whether it lives in Math, String, or Ikebukuro -- its semantics are defined > without reference to any class. (OK, I guess it would rather live in > Ikebukuro.) I'd rather live in Ikebukuro, too. :) Math.sin is a proper class method. Let's say you want polar sine and cosine rather than normal sine and cosine: Math.polar = true Math.sin(Math.pi / 4) The Math class could look something like this: class Math @@polar = false def self.polar=(value) @@polar = value end def self.sin(value) @@polar ? polar_sine(value) : sine(value) end end I'd be very surprised if this is actually the way it's implemented in Ruby, but it certainly *could* be. --Josh
- 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
- [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] Hope everone is ok
- 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