[Openmcl-devel] Applying sequence functions to a new type

rm at fabula.de rm at fabula.de
Tue Mar 1 08:16:12 PST 2005


On Tue, Mar 01, 2005 at 08:58:49AM -0700, Gary Byers wrote:
> 
> [...] 
> Well, BUILT-IN-CLASSes are supposed to be limited; see the dictionary
> entry for BUILT-IN-CLASS in CLHS.

Yes, i had another look. I thought that it was left to the implementation but
of course this would make programs non-portable. 

But as long as the "protocol" is extensible that doesn't matter, 

> I think that many people could agree that it could be useful to genericize
> sequence functions (or CL arithmetic, or ...), but at least as many
> people would -like- those domains to stay closed.  (That was certainly
> true 15 or 20 years ago, when CLOS was being designed; it's not clear
> that CLOS would have been approved in that time frame if it insisted
> that all CL functions were generic and that built-in classes could
> be subclassed.)

Hmm, yes, back than there might have been performance issues making 
everything a generic (but, as guile shows, it's possible to only make
special build-ins generic on a per-application basis). Still, with proper
decalarations and/or type inference it should be possible to use fast
build-ins for the special cases and use the generic function for all
other cases. 
It would be mighty elegant to use sequence functions in application domains
like database query et.al. Currently APIs like clsql need to wrap results
into nested list sructures - not only does this cons a lot, it also implies
that all results need to fetched at once and stored in local memory (some-
thing modern datbase designer try top avoid ...).

 Thanks RalfD




More information about the Openmcl-devel mailing list