On Oct 14, 12:11 ¨Βν¬ ΞιλομαΧειβυμΌξ®®®ΐβιτχι®σεχςοτεΊ
> On Fri, Oct 14, 2011 at 17:31, Jens Wille <jens.wi... / uni-koeln.de> wrote:
> > class A
>
> >  ¨Βεζ β¨τςυε ος σονε οτθετςυτθω φαμυ> >  ¨Β> >  ¨Βυτ§ξαςηυνεξτ χαηιφεξ§
> >  ¨Βμσ> >  ¨Βυτ> >  ¨Βξδ
> >  ¨Βξδ
>
> > end
>
> > can't remember where i first saw it, but it works perfectly ;)
>
> Yes, of course!  ¨Βθα¤ΒΓΤ the trick I saw too; checking if the optional
> argumentΓΤ default value was evaluated.
>
> HereΓΤ a more general solution that allows you to set d to a value
> independent of the desired default value for the argument:
>
> def m(a = (d = true; nil))
> # d will be true if argument a wasnΓΥ specified
> end
>
> One easily forgets how expressive Ruby can be. r how easily it is to abuse it.
>
> Thanks!

Well shit, that might be my new favorite too.

  def m(a=(na=true))
    p a, na
  end

  > m
  true
  true

  > m('foo')
  "foo"
  nil

So, is there a downside to this?