Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uses of type-of to enable class extensions. #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rpgoldman
Copy link

The use of type-of to choose how to process graphs will make extension impossible, because newly-introduced subtypes of graph and digraph wouldn't satisfy the right guards.

Replaced such uses of type-of with a combination of newly-introduced generic functions and typep.

I was considering extending the existing classes using a mixin that would handle attaching attributes to nodes and edges, but realized that would break methods that used type-of to distinguish between digraphs and graphs. This PR would clear the way to making that change.

The use of `type-of` to choose how to process graphs will make
extension impossible, because newly-introduced subtypes of `graph` and
`digraph` wouldn't satisfy the right guards.

Replaced such uses of `type-of` with a combination of newly-introduced
generic functions and `typep`.
Bumped the version from 0.0.0 to 0.1.0 so that `:version` can be used
to detect the extensible version of the graph library.

Also added my name to the list of authors.
@rpgoldman rpgoldman marked this pull request as ready for review April 27, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant