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

Issue: TEST-NOT-IF-NOT (Version 2)



I added a new option `FLUSH-TEST-NOT' in addition to `FLUSH-ALL.'
I also changed the Discussion to show people's support (or lack
thereof) and other misc notes of interest. The rest is unchanged.

I'm inclined to believe that if we cannot get consensus within the
Cleanup group, this should be presented to X3J13 with both options
so if the FLUSH-ALL option is not satisfactory, there's half a
chance we can get people to buy in on at least the FLUSH-TEST-NOT
option.
-----
Issue:          TEST-NOT-IF-NOT
References:     Functions offering a :TEST-NOT keyword:
		 ADJOIN (p276), ASSOC (p280), COUNT (p257), DELETE (p254),
		 DELETE-DUPLICATES (p254), FIND (p257),
		 INTERSECTION (p277), MEMBER (p275), MISMATCH (p257),
		 NINTERSECTION (p277), NSET-DIFFERENCE (p278),
		 NSET-EXCLUSIVE-OR (p278), NSUBLIS (p275), NSUBST (p274),
		 NSUBSTITUTE (p256), NUNION (p276), POSITION (p257),
		 RASSOC (p281), REMOVE (p253), REMOVE-DUPLICATES (p254),
		 SEARCH (p258), SET-DIFFERENCE (p278), 
		 SET-EXCLUSIVE-OR (p278), SUBLIS (p274), SUBSETP (p279),
		 SUBST (p273), SUBSTITUTE (p255), TREE-EQUAL (p264),
		 UNION (p276);
		Functions with "-IF-NOT" in their name:
		 ASSOC-IF-NOT (p280), COUNT-IF-NOT (p257),
		 DELETE-IF-NOT (p254), FIND-IF-NOT (p257),
		 MEMBER-IF-NOT (p275), NSUBST-IF-NOT (p274),
		 NSUBSTITUTE-IF-NOT (p256), POSITION-IF-NOT (p257),
		 RASSOC-IF-NOT (p281), REMOVE-IF-NOT (p253),
		 SUBST-IF-NOT (p273), SUBSTITUTE-IF-NOT (p255);
		Issue FUNCTION-COMPOSITION
Category:       CHANGE
Edit history:   02-Oct-88, Version 1 by Pitman (just FLUSH-ALL)
		05-Oct-88, Version 2 by Pitman (add option FLUSH-TEST-NOT)
Status:         For Internal Discussion

Problem Description:

  The -IF-NOT functions are functionally unnecessary.

  The :TEST-NOT keywords are not only functionally unnecessary but
  also problematic because it's not clear what to do when both :TEST
  and :TEST-NOT are provided.

  Many people think Common Lisp is more `bloated' than it needs
  to be and these aspects of the language are commonly cited
  specific examples.

Proposal (TEST-NOT-IF-NOT:FLUSH-ALL):

  Remove all -IF-NOT functions (named above) from Common Lisp.

  Remove the :TEST-NOT keyword from the Common Lisp functions which 
  currently provide them (named above).

  Rationale:
  
    This makes the language a bit simpler.
  
    The removal of :TEST-NOT also makes the language easier to explain.
  
  Cost to Implementors:
  
    Very slight.
  
    Some symbols would disappear from the LISP package but could
    still be offered in proprietary packages if deemed important
    enough.
  
    Implementations could compatibly retain the :TEST-NOT keywords
    for an interim period.
  
Proposal (TEST-NOT-IF-NOT:FLUSH-TEST-NOT):

  Remove the :TEST-NOT keyword from the Common Lisp functions which 
  currently provide them (named above).

  Rationale:
  
    This makes the language a bit simpler and easier to explain.
  
  Cost to Implementors:
  
    Very slight.
  
    Implementations could compatibly retain the :TEST-NOT keywords
    for an interim period.
  
Current Practice:

  Presumably no one has done this yet.

Cost to Users:

  Some rewrites would be needed.

  Those rewrites, which are already fairly simple, would be even
  more simple if some form of the FUNCTION-COMPOSITION issue is
  voted in -- in particular, the COMPLEMENT function which it 
  proposes would help enormously in this regard.

Cost of Non-Adoption:

  Common Lisp would continue to be what some people feel is
  "bigger than it needs to be".

Benefits:

  The cost of non-adoption would be avoided.

Aesthetics:

  Presumably this makes the language easier to teach.

Discussion:

  Moon expressed reservations about FLUSH-ALL (in Version 1, where
  FLUSH-TEST-NOT was not offered) because it was such an incompatible
  change.

  Steele (commenting on Version 1) noted that his main reservation to
  FLUSH-ALL is that he uses REMOVE-IF-NOT much more than REMOVE-IF.

  Pierson, Dalton and Pitman support the combination of
  TEST-NOT-IF-NOT:FLUSH-ALL (and FUNCTION-COMPOSITION:NEW-FUNCTIONS)
  in spite of the incompatible change because of the aesthetic appeal.

  This issue is related to FUNCTION-COMPOSITION, but is not dependent
  on it.

  van Roggen points out that a long time ago, he suggested dropping
  -IF-NOT and :TEST-NOT, adding a function such as COMPLEMENT, and
  adding a #~ readmacro such that 
      (FIND-IF-NOT #'ZEROP '(0 0 3))
   == (FIND-IF (COMPLEMENT #'ZEROP) '(0 0 3))
   == (FIND-IF #~ZEROP '(0 0 3))

  Richard Mlynarik suggests that even the -IF functions provide
  little extra use since
   (xxx-IF test sequence ...)
  can be rewritten
   (xxx test sequence :test #'funcall).
  He says he doesn't care what we do with this issue, however, since
  he will just continue to use [MIT-style] LOOP in cases where these
  sequence functions would seem to be called for.