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

sequence presentation type

Mike McMahon writes:
|     Date: Fri, 25 May 90 16:02:49 -0600
|     From: andreas@boulder.Colorado.EDU (Andreas C. Lemke)
|     Shouldn't the sequence presentation type allow zero-length sequences
|     as well?  The doc says its for one or more objects, which is
|     inconsistent with general common lisp parlance.
| It works for output, sort of (it doesn't output anything).
| But how would you input one, given the additional complication of defaults?

Barry Margolin writes:
| If there's a default available, how would you distinguish between the
| user hitting Return to get the default from hitting return to type an
| empty sequence?

First of all, I thought there might be a reason why accepting zero
length sequences would be nonsensical, and the current behavior would
be indeed the desired behavior.  If it is not, then one can consider
options for solving the default problem.  I see the following

 1. Use a special character to mean "activate but do not use default".
    The tab char could be used.  Tab can already be used to mean
    "activate but do not complete".  This might cause problems when
    rescanning!?  Would the empty sequence then be replaced with the
    default?  Is there a need for a permanent marker that prevents
    insertion of the default and completion (e.g., "")?

 2. Do something like (null-or-type (sequence ...)), i.e., use a
    special keyword to denote empty sequences.  But since
    (null-or-type (sequence ...)) already works, this is probably
    mute.  No it's probably not because alist-member is not a subtype
    of sequence... (I don't understand these issues enough, I guess.)

 3. Go away from infix comma notation, and use a parenthesized notation
    instead (or in addition).  In that case an empty sequence has a natural
    representation: ()

..................				     Andreas C. Lemke
... andreas ..:-).			   CS Dept., Univ. of Colorado, Boulder
..................				 andreas@sigi.colorado.edu