On Sep 2, 11:36 am, Joel VanderWerf <[email protected]> wrote:
> Joel VanderWerf wrote:
> > Jeremy Evans wrote:
> >> * Database#<< now always returns nil.  Before, the return value was
> >>   adapter dependent.
>
> > I was going to ask why not return self, like other #<< in ruby, but then
> > I ran into this with Database#<< :
>
> > The Sequel docs have this example:
>
> >    DB << "create table t (a text, b text)"
> >    DB << "insert into t values ('a', 'b')"
>
> Sorry, I was not creating an in-memory database correctly (and I messed
> up the text in the last email).
>
> But my first question remains: why not return self from #<<, so you can
> chain methods. Not that it matters much, but it seems more consistent.

Do we really want to support chaining in this case? For example, do we
really want to support this:

  DB << "create table t (a text, b text)" << "insert into t values
('a', 'b')"

I think that makes the code harder to read.  If you can come up with a
good use case for having << return self, I'll certainly consider
switching it.

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