On Mon, Oct 11, 2010 at 12:52 AM, Kip Murray <[email protected]> wrote:
> they are basic features of the model and will be in the
> production code.  For large or complicated arrays possibly
> produced by code and not human hands, these verbs may
> be essential for determining whether an list is a set and whether an
> array is an element of a set.

Ok, if all of your lists are sorted grade up (and a few other constraints
to avoid non-set data that looks like <,a:), and you are using the same
application verbs on different kinds of data, this can make sense,
though you will get some overhead from this approach, possibly
a factor greater than 2 when you have a lot of small sets.

Then again, correctness comes before efficiency.  And if
you need to run-time-detect sets, then my suggestion would
not be an option.

Still, if you actually do need this, I would be strongly tempted
to replace a: with something far more improbable.  Like, for
example:
   setMarker=: <''$~,#:a.i.'Set'

Yes, using that set marker will be slightly slower than a:, but the
rationale that says "use a:" says that that non-crippling performance
issues should be ignored.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to