Jonathan LaCour schrieb:
> Noam wrote:
>
> > I've read the Elixir tutorial, and I wondered how with_fields() knows
> > the order in which fields were declared, since they are passed to the
> > function as a dictionary.
>
> It doesn't.

Hmm, couldn't the `Field` class keep a class-level counter that would
be incremented on every instantiation, as well as assigning the
current value to an "order" instance variable... then you could sort the
fields passed to `with_fields` based on the "order" instance variable.

Or am I missing something?

For what it's worth, I personally prefer the `with_fields` way of
declaring fields, but if it doesn't do ordering that's pretty bad.

Cheers,
Chris
--
  http://www.cmlenz.net/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to