<div dir="ltr">We cannot get rid of procedure-arity-includes?, but we could make it accept either a procedure or an arity for both arguments.<div><br></div><div style>For the second bullet, I think that we&#39;d run afoul of backwards compatibility problems. That is, there is code out there that currently builds and works with arities that are not normalized and we&#39;d break it if we required all arity-accepting primitives to be given normalized arities.</div>
<div style><br></div><div style>But maybe that&#39;s warranted?</div><div style><br>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 11, 2013 at 10:33 AM, Eli Barzilay <span dir="ltr">&lt;<a href="mailto:eli@barzilay.org" target="_blank">eli@barzilay.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK, that&#39;s a valid use case -- but isn&#39;t it better for both of these<br>
uses to just use some combinator for arities that generates a properly<br>
normalized arity instead of constructing lists and explicitly<br>
normalizing them?<br>
<br>
It&#39;s just that the interface looks very complex now.  Some obvious<br>
things:<br>
<br>
* `procedure-arity-includes?&#39; vs `arity-includes?&#39;<br>
  (but it&#39;s the second that compares two procedures...  I&#39;d just make<br>
  the first accept a procedure to avoid this unfortunate naming.)<br>
<br>
* `normalize-arity&#39;, `normalized-arity?&#39;, `arity=?&#39;<br>
  (go away with a combinator, the last one gets replaced with<br>
  `equal?&#39;)<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
A few minutes ago, Carl Eastlund wrote:<br>
&gt; If we want people to be able to create higher-order functions with<br>
&gt; precise arities via procedure-reduce-arity, for instance, we need to<br>
&gt; provide tools for manipulating arity values.  Manipulating them is<br>
&gt; also useful for producing error messages that describe the arity of<br>
&gt; procedure values.  I don&#39;t see any reason to close this stuff off,<br>
&gt; when it&#39;s the one useful, non-opaque aspect of procedure values.<br>
&gt;<br>
&gt; Carl Eastlund<br>
&gt;<br>
&gt; On Thu, Apr 11, 2013 at 11:13 AM, Eli Barzilay &lt;<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>&gt; wrote:<br>
&gt;<br>
&gt;     Is there a real need to make this whole thing a public interface?  I&#39;d<br>
&gt;     think that a general direction is to move away from making it public<br>
&gt;     (ie, remove the ability to create an arity value), and this seems to<br>
&gt;     add a pretty big chunk of stuff in the opposite direction.<br>
&gt;<br>
&gt;     About two weeks ago, <a href="mailto:cce@racket-lang.org">cce@racket-lang.org</a> wrote:<br>
&gt;     &gt; cce has updated `master&#39; from 6e40caa7e2 to df00bbb194.<br>
&gt;     &gt;   <a href="http://git.racket-lang.org/plt/6e40caa7e2..df00bbb194" target="_blank">http://git.racket-lang.org/plt/6e40caa7e2..df00bbb194</a><br>
&gt;     &gt;<br>
&gt;     &gt; =====[ 7 Commits ]======================================================<br>
&gt;     &gt; Directory summary:<br>
&gt;     &gt;   21.0% collects/racket/private/<br>
&gt;     &gt;   21.5% collects/racket/<br>
&gt;     &gt;   26.4% collects/scribblings/reference/<br>
&gt;     &gt;   30.9% collects/tests/racket/<br>
&gt;     &gt;<br>
&gt;     &gt; ~~~~~~~~~~<br>
&gt;     &gt;<br>
&gt;     &gt; 59b1e32 Carl Eastlund &lt;<a href="mailto:cce@racket-lang.org">cce@racket-lang.org</a>&gt; 2013-03-30 11:45<br>
&gt;     &gt; :<br>
&gt;     &gt; | Changed normalize-arity to coalesce arity-at-least with adjacent<br>
&gt;     numbers.<br>
&gt;     &gt; |<br>
&gt;     &gt; | For instance, (normalize-arity (list 1 (arity-at-least 2))) now<br>
&gt;     produces<br>
&gt;     &gt; | (arity-at-least 1).  The implementation and the tests for<br>
&gt;     normalize-arity both<br>
&gt;     &gt; | reflect this change.  The randomized tests now also check that the<br>
&gt;     output<br>
&gt;     &gt; | represents the same arity as the input.<br>
&gt;     &gt; :<br>
&gt;     &gt;   M collects/racket/private/norm-arity.rkt |  82 +++++++++++++---------<br>
&gt;     &gt;   M collects/tests/racket/basic.rktl       | 112<br>
&gt;     +++++++++++++++++++++++++-----<br>
&gt;     &gt;<br>
&gt;     &gt; ~~~~~~~~~~<br>
&gt;     &gt;<br>
&gt;     &gt; e356c66 Carl Eastlund &lt;<a href="mailto:cce@racket-lang.org">cce@racket-lang.org</a>&gt; 2013-03-30 11:49<br>
&gt;     &gt; :<br>
&gt;     &gt; | Re-provide normalize-arity from racket/function.<br>
&gt;     &gt; :<br>
&gt;     &gt;   M collects/racket/function.rkt | 4 ++--<br>
&gt;     &gt;<br>
&gt;     &gt; ~~~~~~~~~~<br>
&gt;     &gt;<br>
&gt;     &gt; 4dd011a Carl Eastlund &lt;<a href="mailto:cce@racket-lang.org">cce@racket-lang.org</a>&gt; 2013-03-30 15:49<br>
&gt;     &gt; :<br>
&gt;     &gt; | Added documentation for normalize-arity.<br>
&gt;     &gt; :<br>
&gt;     &gt;   M collects/scribblings/reference/procedures.scrbl | 42<br>
&gt;     ++++++++++++++++++----<br>
&gt;     &gt;<br>
&gt;     &gt; ~~~~~~~~~~<br>
&gt;     &gt;<br>
&gt;     &gt; 636f8a9 Carl Eastlund &lt;<a href="mailto:cce@racket-lang.org">cce@racket-lang.org</a>&gt; 2013-03-30 21:04<br>
&gt;     &gt; :<br>
&gt;     &gt; | Moved normalized-arity?, arity=?, and arity-includes? into racket/<br>
&gt;     function.<br>
&gt;     &gt; :<br>
&gt;     &gt;   M collects/racket/function.rkt     | 94<br>
&gt;     +++++++++++++++++++++++++++++++++++-<br>
&gt;     &gt;   M collects/tests/racket/basic.rktl | 96<br>
&gt;     +------------------------------------<br>
&gt;     &gt;<br>
&gt;     &gt; ~~~~~~~~~~<br>
&gt;     &gt;<br>
&gt;     &gt; aaa99d5 Carl Eastlund &lt;<a href="mailto:cce@racket-lang.org">cce@racket-lang.org</a>&gt; 2013-03-30 21:05<br>
&gt;     &gt; :<br>
&gt;     &gt; | Documented normalized-arity?, arity=?, and arity-includes?.<br>
&gt;     &gt; :<br>
&gt;     &gt;   M collects/scribblings/reference/procedures.scrbl | 87<br>
&gt;     +++++++++++++++++++---<br>
&gt;     &gt;<br>
&gt;     &gt; ~~~~~~~~~~<br>
&gt;     &gt;<br>
&gt;     &gt; f509420 Carl Eastlund &lt;<a href="mailto:cce@racket-lang.org">cce@racket-lang.org</a>&gt; 2013-03-30 17:12<br>
&gt;     &gt; :<br>
&gt;     &gt; | Removed unnecessary duplication of normalize-arity.<br>
&gt;     &gt; :<br>
&gt;     &gt;   M collects/tests/racket/fixnum.rktl | 21 ++-------------------<br>
&gt;     &gt;<br>
&gt;     &gt; ~~~~~~~~~~<br>
&gt;     &gt;<br>
&gt;     &gt; df00bbb Carl Eastlund &lt;<a href="mailto:cce@racket-lang.org">cce@racket-lang.org</a>&gt; 2013-03-31 10:34<br>
&gt;     &gt; :<br>
&gt;     &gt; | Updated contracts for arity-related functions.<br>
&gt;     &gt; |<br>
&gt;     &gt; | Added contract checking to arity=?, arity-includes?, and<br>
&gt;     normalized-arity.<br>
&gt;     &gt; | Removed contract checking from normalize-arity to make it a total<br>
&gt;     predicate.<br>
&gt;     &gt; | Updated documentation for normalize-arity to reflect this change.<br>
&gt;     &gt; :<br>
&gt;     &gt;   M collects/racket/function.rkt                    | 21<br>
&gt;     ++++++++++++++++-----<br>
&gt;     &gt;   M collects/racket/private/norm-arity.rkt          |  2 ++<br>
&gt;     &gt;   M collects/scribblings/reference/procedures.scrbl | 13 ++++++-------<br>
&gt;<br>
&gt;     --<br>
&gt;               ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:<br>
&gt;                         <a href="http://barzilay.org/" target="_blank">http://barzilay.org/</a>                   Maze is Life!<br>
&gt;<br>
<br>
--<br>
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:<br>
                    <a href="http://barzilay.org/" target="_blank">http://barzilay.org/</a>                   Maze is Life!<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_________________________<br>
  Racket Developers list:<br>
  <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
</div></div></blockquote></div><br></div>