From: Matt Gushee <[email protected]> Subject: Re: [Chicken-users] What is the purpose of module interfaces? Date: Tue, 16 Oct 2012 17:37:53 -0600
> On Tue, Oct 16, 2012 at 5:18 PM, Kon Lovett <[email protected]> wrote: > >> >> On Oct 16, 2012, at 4:11 PM, Matt Gushee wrote: >> >> > I am trying to understand the usage of module interfaces >>> >> >> >> >>> >>> The 'functor' facility is for generic programming. >> >> documented? The page on modules in the manual makes no explicit >> association between interfaces and functors. Indeed, I don't see any hint >> that interfaces can be used in functor definitions the way you do in your >> egg. >> >> >> See http://wiki.call-cc.org/man/4/Modules.html#functors >> >> Buried at the bottom. >> > > Oh, okay, I see it now. I had skimmed the functors section, but missed the > sentence referring to DEFINE-INTERFACE. I still think the doc could stand > to be clarified a bit--e.g., with a specific example of using an interface > in a functor definition. I would imagine many people are unfamiliar with > functors, especially those who have not programmed in other functional > languages. Though the part about interfaces is a fairly minor detail, > sometimes confusion about the little things can get in the way of > understanding the important concepts. Quite correct - the "Functors" section in the manual is more than insufficient. I was happy enough just getting that stuff to work (somewhat) and sometimes the words just don't flow out that easily when writing the documentation, so in the end I can come out with just the bare minimum. The test-suite in the chicken tarball contains a slightly less ridiculuous example, in particular "functor-tests.scm", "QUEUE.scm", "breadth-first.scm" and "test-queue.scm". Would you perhaps like to help us with this by extending this manual section a little? You could take that queue example as a starting point and explain things alongside the code. That would be nice, and certainly helpful to new users, or users new to this feature. cheers, felix _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
