On Mon, Jun 02, 2014 at 11:38:06PM -0500, Mark van Gulik wrote:

Beyond that, I'm not getting a compilation error that I've run into
before.  It seems that summation wants to make sure the array isn't
empty, but I'm not sure how to handle this situation.  I've attached
the two files.  Also, this runs very slowly.

A week or two ago Todd identified an issue with "∑_".  It appears to
be very useful to have the ability to sum an empty tuple to get the
integer 0, despite the potential type problems that forcing an
integer return type in this case might have.  So he updated the
method and its semantic restriction to allow summation for the empty
tuple.

So, a bit deeper question, though, let's say I do have a method that
really does only make sense with non-empty tuples?  What is the
correct or idiomatic way of getting from a possibly empty tuple to
knowing we have one that isn't empty.  Something along the lines of

   if thing is empty then [ handle the empty case ] else [ do the
   non-empty case ];

David

Reply via email to