[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: UnaryFns & Tables

I essentially agree with Dean on this one.  Having both UnaryFns and
TableViews is a good solution because they have different purposes, even 
if the mechanics are similar.
  I'm implementing TableViews in the same manner that UnaryFns are implemented,
in that you must instantiate a derived class of TableView to get a useful
mapping.  I've created 2 standard mappings already, called IndexMappedTable
and FunctionMappedTabled.  IndexMapped applies a UnaryFn (provided during
construction) to the key before doing a fetch on a hidden table (also provided
during construction).  FunctionMapped, on the other hand, performs the fetch
first, and applies a UnaryFn to the result.
  Since new TableViews can be built easily, getting one to perform wierd and
strange things only costs writing a new  class.  It IS possible to write
essentially a UnaryFn (with no hidden table), but it probably isn't useful
in most cases.

  Let's consider this thread closed, shall we?