[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [patch] Use hash for optional args with long argument list in Ruby bindings

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2007-11-17 05:39:50 CET

Hi,

In <ae6cb1100711162027r44ac7627qa0d44964b0bf03fa@mail.gmail.com>
  "Re: [patch] Use hash for optional args with long argument list in Ruby bindings" on Fri, 16 Nov 2007 20:27:50 -0800,
  "Joe Swatosh" <joe.swatosh@gmail.com> wrote:

> > Using keys of default options is OK but I don't define
> > default options as constant. I want to generate default
> > options each time because we may change default options
> > destructively by mistake.
> >
>
> If we freeze the constants, wouldn't we get TypeErrors if we were to
> accidentally
> try to modify them?

Can you freeze all values without mistake? e.g.

  DEFAULT = {
    :targets => []
  }.freeze

isn't enough. We need to write like the following:

  DEFAULT = {
    :targets => [].freeze
  }.freeze

# And I don't want to see many 'freeze'.

Thanks,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Nov 17 05:40:03 2007

This is an archived mail posted to the Subversion Dev mailing list.