Hi,
In <ae6cb1100711162106g73364c5n46b444d2514f9987@mail.gmail.com>
"Re: [patch] Use hash for optional args with long argument list in Ruby bindings" on Fri, 16 Nov 2007 21:06:06 -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
>
> Sure, but it isn't too pretty:
>
> DEFAULT = {
> :targets => []
> }.freeze.each_value{|v| v.freeze}
>
>
> :-)
>
> > isn't enough. We need to write like the following:
> >
> > DEFAULT = {
> > :targets => [].freeze
> > }.freeze
> >
> > # And I don't want to see many 'freeze'.
> >
>
> I understand. Shouldn't we move REQUIRED_UPDATE_EDITOR_KEYS
> the method for the same reasons?
No. We don't need to that.
REQUIRED_UPDATE_EDITOR_KEYS is only used for validation. It
isn't used for any other processes. And we shouldn't handle
it destructively in validation process.
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 06:16:20 2007