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

Make helpers.-> use edge.-> #5

Merged
merged 1 commit into from
Sep 30, 2023
Merged

Make helpers.-> use edge.-> #5

merged 1 commit into from
Sep 30, 2023

Conversation

metagn
Copy link
Contributor

@metagn metagn commented Sep 29, 2023

The original -> in edge sorts the parameters before forming the edge, but helpers.-> doesn't do this.

helpers.-> also has a more precise signature (on tuple[x, y: float] rather than the Point concept), which means generic procs can prefer it if -> is considered to be overloaded.

This has not been an issue in this package because the generic procs that use -> only have access to 1 overload of it and so Nim considers them not overloaded. However this behavior is not reliable: nim-lang/Nim#11184, and so attempts to fix this cause issues in this library's tests.

Alternatively the tests can use another operator to form unsorted edges, or the signature of helpers.-> can be made equally as precise as the one in edge (i.e. defined on Point).

The original `->` in `edge` sorts the parameters before forming the edge, but helpers.`->` doesn't do this.

helpers.`->` also has a more precise signature (on `tuple[x, y: float]` rather than the `Point` concept), which means generic procs can prefer it if `->` is considered to be overloaded.

This has not been an issue in this package because the generic procs that use `->` only have access to 1 overload of it and so Nim considers them not overloaded. However this behavior is not reliable: nim-lang/Nim#11184, and so attempts to fix this cause issues in this library's tests.

Alternatively the tests can use another operator to form unsorted edges, or the signature of helpers.`->` can be made equally as precise as the one in `edge` (i.e. defined on `Point`).
@Nycto Nycto merged commit 0274f0e into Nycto:master Sep 30, 2023
@Nycto
Copy link
Owner

Nycto commented Sep 30, 2023

Thanks!

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.

2 participants