![]() The new argument to `hash-iterate-value` and most other `...-hash-iterate-...` functions determines a result to be returned in place of raising a "bad index" exception. For most kinds of hash tables, a "bad index" exception will only happen when the provided index is wrong or when a hash table is mutated during an iteration. Mutation during iteration is generally a bad idea, but in the case of a weak hash table, a potential background mutation by the garbage collector is difficult to suppress or ignore. Adding an option to control bad-index behavior makes it easier to write loops that defend against uncooperative tables, including loops where a hash-table key disappears asynchronously. Racket's printer was already using this functionality internally, so the change to `hash-iterate-value` and company mostly exposes existing functionality. The `in-hash` form and related sequence constructors similarly support a bad-index alternate value so iterations can handle that case explicitly. They do not use the new bad-index support implicitly to skip missing entries, because that idea does not play well with the iteration API. A hash-table index can go bad after `in-hash` has selected the index and determined that it should be used for the next iteration, and a sequence can't take back that decision. |
||
---|---|---|
pkgs | ||
racket | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.travis.yml | ||
appveyor.yml | ||
INSTALL.txt | ||
Makefile | ||
README.md |
This is the source code for the core of Racket. See "INSTALL.txt" for full information on building Racket.
To build the full Racket distribution from this repository, run make
in the top-level directory. To build minimal Racket, run make base
.
The rest of the Racket distribution source code is in other repositories, mostly under the Racket GitHub organization.
Contribute to Racket by submitting a pull request, joining the development mailing list, or visiting the IRC channel.
License
Racket Copyright (c) 2010-2018 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.