diff --git a/Project.toml b/Project.toml index 4ae355b8..df41e9e2 100644 --- a/Project.toml +++ b/Project.toml @@ -56,4 +56,4 @@ StaticArraysCore = "1.4.3" Symbolics = "0.1, 1, 2, 3, 4, 5, 6, 7" Zygote = "0.7.10" ZygoteRules = "0.2.7" -julia = "1.6" +julia = "1.9" diff --git a/src/Quaternionic.jl b/src/Quaternionic.jl index b62a0d56..8fd0f747 100644 --- a/src/Quaternionic.jl +++ b/src/Quaternionic.jl @@ -7,6 +7,17 @@ import StaticArrays: StaticArrays, @SMatrix, @SVector, SA, SMatrix, SVector import LaTeXStrings import Random: AbstractRNG, default_rng +# The `public` keyword is a syntax error before Julia 1.11, so we wrap it in a macro that +# emits `public` where it exists and does nothing otherwise. +macro public(names) + @static if VERSION ≥ v"1.11.0-DEV.469" + syms = names isa Symbol ? (names,) : names.args + esc(Expr(:public, syms...)) + else + nothing + end +end + export AbstractQuaternion export Quaternion, quaternion, QuaternionF64, QuaternionF32, QuaternionF16, @@ -14,9 +25,9 @@ export Quaternion, quaternion, export Rotor, rotor, RotorF64, RotorF32, RotorF16 export QuatVec, quatvec, QuatVecF64, QuatVecF32, QuatVecF16 export components, basetype -public value, iszerovalue -public ℂconj, ℂreal, ℂimag, ℂreim -public RB, BR, Rv, vR, KAN +@public value, iszerovalue +@public ℂconj, ℂreal, ℂimag, ℂreim +@public RB, BR, Rv, vR, KAN export (⋅), (×), (×̂), normalize, norm export abs2vec, absvec export from_float_array, to_float_array,