The Racket repository
Go to file
Carl Eastlund 7ab8aca79b Adapted define-generics so that "defaults" work like #:methods implementations.
Specifically, implementations for the #:defaults keyword in define-generics can
now use define/generic to get at the generic implementation of a method for
which a specific implementation is defined locally.  Also, unimplemented methods
are handled properly now in #:defaults.  Previously, an unimplemented method in
a #:defaults specification would go into an infinite loop if applied, because
the implementation for the specific type wound up referring to the generic
implementation of the method.

A lot of the back-end implementation of generics changes in this commit:

- The new module racket/private/generic-methods provides a uniform mechanism for
  defining method tables and recording static information about generics
  groups.  Both #:methods in [define-]struct and #:defaults in define-generics
  use this framework now.  In addition, generics based on existing properties
  such as gen:stream, gen:equal+hash, and gen:custom-write now use the struct
  from this module to store the names associated with the generics groups.

- Generic methods now expand directly into functions with the appropriate arity,
  and refer directly to the appropriate argument to perform generic method
  dispatch.  The previous implementation used procedure-reduce-keyword-arity to
  restrict the arity dynamically, and used list-ref to find the generic
  argument.

- Some error messages have changed slightly; hopefully for the better, but this
  change did require some changes to tests for specific error messages.
2013-07-10 12:56:16 -04:00
pkgs Adapted define-generics so that "defaults" work like #:methods implementations. 2013-07-10 12:56:16 -04:00
racket Adapted define-generics so that "defaults" work like #:methods implementations. 2013-07-10 12:56:16 -04:00
.gitattributes Don't include git files in archives. 2010-05-12 01:46:05 -04:00
.gitignore Add add-on to .gitignore. 2013-07-04 11:51:53 -04:00
.mailmap mailmap updates & fixes. 2013-04-03 18:10:22 -04:00
.travis.yml add myself to the email notification 2013-07-09 16:59:54 -05:00
INSTALL.txt Makefile: make PKGS' not sticky by default, add again' target 2013-07-08 20:11:26 -06:00
Makefile Makefile: make PKGS' not sticky by default, add again' target 2013-07-08 20:11:26 -06:00
README.txt reorganize into core plus packages 2013-06-19 09:01:37 -06:00

This is the source code for the main Racket distribution.  See
"INSTALL.txt" for information on building Racket.

License
-------

Racket
Copyright (c) 2010-2013 PLT Design Inc.

Racket is distributed under the GNU Lesser General Public License
(LGPL).  This means that you can 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 means
that you must release the source code for the modified software.  See
doc/release-notes/COPYING_LESSER.txt for more information.