From: Will Duquette on
On Jul 5, 7:16 am, Will Duquette <w...(a)wjduquette.com> wrote:
> On Jul 5, 5:58 am, keithv <kvet...(a)gmail.com> wrote:
>
>
>
>
>
> > On Jul 5, 8:46 am, Keith Nash <k...(a)citizenearth.com> wrote:
>
> > > Robert Heller wrote:
> > > > 1) copy the source and modify it.
> > > > 2) create a new snit::type and delegate everything (except the *method
> > > > you want to change) to the one in the library, with a replacement *method.
>
> > > (3) Not as slick as (2), but quicker:
>
> > > (a) Execute the Snit definitions for the object that you want.
> > > (b) Overwrite the definition of the method that you need to change.
>
> > > snit::method objectName methodName {arg1 arg2 ...} {
> > >     method body
>
> > > }
>
> > I like the "quicker". Will the above work for non-method
> > procedure? Here's a code snippet:
>
> >   snit::type map::slippy::fetcher {
> >     ...
> >     proc urlOf {tile} {
> >       ...
> >     }
> >   }
>
> > I have an instance of map::slippy::fetcher and I
> > want to modify procedure urlOf to accommodate
> > different url schemes.
>
> > Thanks,
> > Keith
>
> Snit process reside in a namespace named after the type.  So what
> you'd do is this:
>
>   proc map::slippy::fetcher::urlOf ...

Whoops! That should have been "Snit procs" (I got a little unwanted
help from my iPad.)
From: Andreas Kupries on
keithv <kvetter(a)gmail.com> writes:

> On Jul 5, 8:46 am, Keith Nash <k...(a)citizenearth.com> wrote:
>> Robert Heller wrote:
>> > 1) copy the source and modify it.
>> > 2) create a new snit::type and delegate everything (except the *method
>> > you want to change) to the one in the library, with a replacement *method.
>>
>> (3) Not as slick as (2), but quicker:
>>
>> (a) Execute the Snit definitions for the object that you want.
>> (b) Overwrite the definition of the method that you need to change.
>>
>> snit::method objectName methodName {arg1 arg2 ...} {
>>     method body
>>
>> }
>
> I like the "quicker". Will the above work for non-method
> procedure? Here's a code snippet:
>
> snit::type map::slippy::fetcher {
> ...
> proc urlOf {tile} {
> ...
> }
> }
>
> I have an instance of map::slippy::fetcher and I
> want to modify procedure urlOf to accommodate
> different url schemes.

So, I guess in a future revision of the fetcher it should support some
callback to perform the url-of outsie of the fetcher ?

--
So long,
Andreas Kupries <akupries(a)shaw.ca>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------