On Apr 13, 3:25 pm, Shawn <[email protected]> wrote:
> Thanks, Jeremy.
>
> Why must it clone instead of returning self?  A dataset filtered by an
> empty argument need not change at all, so why not just return the same
> dataset?  Is this to uphold the expectation that filter will always
> return a new object, so subsequent operations do not affect the
> original?

Yes:

  ds = Album.dataset
  ds = ds.filter(h) # where h can be {}
  ds.filter!(:a=>1)

Because Sequel allows mutable actions on datasets, all dataset methods
that return clones must do so in all cases.  They can't clone in some
cases and not others.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to