The Racket repository
![]() The issue is what happens when the actual function has other arities. For example, if the function were (λ (x [y 1]) y) then it is not okay to simply check if procedure-arity-includes? of 1 is true (what the code used to do) because then when the function is applied to 2 arguments, the call won't fail like it should. It is possible to check and reject functions that don't have exactly the right arity, but if the contract were (-> string? any), then the function would have been allowed and only when the extra argument is supplied would the error occur. So, this commit makes it so that (-> any/c any) is like (-> string? any), but with the optimization that if the procedure accepts only one argument, then no wrapper is created. This is a backwards incompatible change because it used to be the case that (flat-contract? (-> any)) returned #t and it now returns #f. |
||
---|---|---|
pkgs | ||
racket | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.travis.yml | ||
appveyor.yml | ||
INSTALL.txt | ||
Makefile | ||
README.txt |
This is the source code for the main Racket distribution. See "INSTALL.txt" for information on building Racket. License ------- Racket Copyright (c) 2010-2015 PLT Design Inc. Racket is distributed under the GNU Lesser General Public License (LGPL). This implies that you may link Racket into proprietary applications, provided you follow the rules stated in the LGPL. You can also modify Racket; if you distribute a modified version, you must distribute it under the terms of the LGPL, which in particular states that you must release the source code for the modified software. See racket/src/COPYING_LESSER.txt for more information.