« Return to Thread: static methods and duck typing

Re: static methods and duck typing

by Nathan Stott :: Rate this Message:

Reply to Author | View in Thread


My goal is to be able to write convention based methods a la ruby activerecord.

class ActiverecordBase:
    static def QuackInvoke(...)
         ...

class Person(ActiveRecordBase):
    pass

persons = Person.FindByNameAndAge("bill", 28)

the method names would be parsed by the quack static method of the
class to perform db operations.

On Fri, Jun 13, 2008 at 11:27 AM, Justin Chase <justin.m.chase@...> wrote:

> Interfaces exist at an instance level, if you called a static method that
> didnt' exist what instance would recieve the unhandled call? I'm interested
> in seeing a snippet of code that would illustrate the usecase you would like
> to see working.
>
>
> On Fri, Jun 13, 2008 at 11:16 AM, Nathan Stott <nrstott@...> wrote:
>>
>> Hi all.
>>
>> Has there been any consideration given to late-bound static methods in
>> Boo?  I'd like to see an IQuackFu style resolution for static methods
>> of a duck typed class.
>>
>> I'm not sure how exactly it would work.  I think it would involve some
>> change to RuntimeServices and a new compiler step.
>> I'm willing to invest some time in creating a patch for it if there's
>> no reason why it wouldn't work or wouldn't be desirable.
>>
>>
>
>
>
> --
> Justin Chase
> http://www.justnbusiness.com
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---

 « Return to Thread: static methods and duck typing

LightInTheBox - Buy quality products at wholesale price!