On Dec 1, 2007 11:07 AM, Mark Van De Vyver <[EMAIL PROTECTED]> wrote:
> On Dec 1, 2007 10:46 AM, Aman Gupta <[EMAIL PROTECTED]> wrote:
> >
> > is Sequel::Plugin::List would work, otherwise ruby won't recognize
> > List as a valid class. Alternatively, we could do is :List and have a
>
> That's right. Apologies for the sloppy post.  For lazy reasons, is
> Sequel::<plugin> has some appeal, but there maybe aclash with current
> or planned modules.
>
> Also, the is <module> has the advantage of indicating more clearly
> what is going on, uninitiated might wonder/imagine how 'is_a_list'
> differs from 'is_orderable'...
>
> > def is(plugin)
> >   begin
> >     include Sequel::Plugin.get_const(plugin)
> >   rescue
> >     require('sequel/plugin/'+plugin.downcase) ? retry : raise
> >   end
> > end

That seems best :)

Mark
> wouldn't 'alias_method :is, :include' work?  I'll look to see if there
> are any gothas.
>
> Mark
>
>
> >   Aman Gupta
> >
> >
> > On Nov 30, 6:42 pm, "Mark Van De Vyver" <[EMAIL PROTECTED]> wrote:
> > > Hi Devs,
> > > I've followed this with some interest.  I'm not a contributor (just
> > > yet - still wrestling with Og)
> > > Just one observation/question...
> > >
> > > <snip>
> > >
> > >
> > >
> > > > Sounds great! One question though: how are plugins going to be
> > > > installed? are they going to be bundled all together? We also need a
> > > > way to load plugins on demand.
> > >
> > > > > And provide cannonical Model methods is_a(), and is() for including
> > > > > the module:
> > >
> > > > > class Item < Sequel::Model(:item)
> > > > >   is_a :list
> > > > >   is :orderable
> > > > > end
> > >
> > > > I think it would even be nicer like this:
> > >
> > > > class Item < Sequel::Model(:item)
> > > >    is_a_list
> > > >    is_orderable
> > > > end
> > >
> > > class Item <Sequel::Model(:item)
> > > is List (able?)
> > > is Orderable
> > > is ...
> > > end
> > >
> > > Reads like std Ruby and is once less quirk to remember.  This is
> > > really a taste issue, and you can see coming from Og I have a
> > > preference to, where possible, conform to std Ruby expression,
> > > obviously here the compromise is to use 'is' rather then 'include',
> > > because it reads more naturally.  the other two proposal require
> > > parsing and converting before including the module.
> > >
> > > Has Sequel considered using std Ruby-like syntax where possible?
> > >
> > > Mark
> > >
> > > > > And yes this means I am willing to contribute.
> > >
> > > > You now have commit rights so go ahead!
> > >
> > > > sharon
> > > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
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