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

Rename imag_part to imag_quat? #103

Open
hyrodium opened this issue Sep 27, 2022 · 1 comment
Open

Rename imag_part to imag_quat? #103

hyrodium opened this issue Sep 27, 2022 · 1 comment
Labels

Comments

@hyrodium
Copy link
Collaborator

Since Octionion has been split into Octonions.jl, both Quaternions.jl and Octonions.jl exports imag_part. This causes the following problem:

julia> using Quaternions, Octonions

julia> imag_part
WARNING: both Octonions and Quaternions export "imag_part"; uses of it in module Main must be qualified
ERROR: UndefVarError: imag_part not defined

Octonions.jl has a dependency on Quaternions.jl, so we can avoid this issue by adding the method Quaternions.imag_part(::Octonion). However, this approach is not good because the dependency on Quaternions.jl should be removed just like #62.

Therefore, I think the best approach here is renaming imag_part to imag_quat (and imag_octo).

@sethaxen
Copy link
Collaborator

sethaxen commented Oct 2, 2022

I think whether this is a problem depends on if we think users are likely to load Quaternions and Octonions at the same time. I don't have a good sense for whether this is likely. If it is, then I agree with this suggestion.

An alternative would be to define a base package HyperComplexNumbers that defines methods that would be relevant for any hypercomplex number, but I lean against this. For one thing, I don't want to design or maintain that package. For another, what would a function like imag_part do when we have numbers that combine multiple hypercomplex numbers like dual quaternions or biquaternions?

However, this approach is not good because the dependency on Quaternions.jl should be removed just like #62.

Agreed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants