Syntax invalid for "::"

I’m new to Julia and I’m trying to use this package:

However, after adding it with

pkg add GitHub - interplanetary-robot/SigmoidNumbers: Sigmoid Numbers for Julia

when I type

using SigmoidNumbers

I get the following error:

julia> using SigmoidNumbers

[ Info: Precompiling SigmoidNumbers [33550992-c815-5e28-b35b-06279e2bcac3]

ERROR: LoadError: LoadError: syntax: invalid “::” syntax

Stacktrace:

[1] top-level scope at /Users/gonced8/.julia/packages/SigmoidNumbers/Eq5hN/src/SigmoidTyypedef.jl:38

[2] include at ./boot.jl:328 [inlined]

[3] include_relative( ::Module, ::String ) at ./loading.jl:1105

[4] include at ./Base.jl:31 [inlined]

[5] include( ::String ) at /Users/gonced8/.julia/packages/SigmoidNumbers/Eq5hN/src/SigmoiddNumbers.jl:1

[6] top-level scope at /Users/gonced8/.julia/packages/SigmoidNumbers/Eq5hN/src/SigmoidNuumbers.jl:3

[7] include at ./boot.jl:328 [inlined]

[8] include_relative( ::Module, ::String ) at ./loading.jl:1105

[9] include( ::Module, ::String ) at ./Base.jl:31

[10] top-level scope at none:2

[11] eval at ./boot.jl:330 [inlined]

[12] eval( ::Expr ) at ./client.jl:425

[13] top-level scope at ./none:3

in expression starting at /Users/gonced8/.julia/packages/SigmoidNumbers/Eq5hN/src/SigmoiddTypedef.jl:38

in expression starting at /Users/gonced8/.julia/packages/SigmoidNumbers/Eq5hN/src/SigmoiddNumbers.jl:3

ERROR: Failed to precompile SigmoidNumbers [33550992-c815-5e28-b35b-06279e2bcac3] to /UseNumbers.jl:3ers/gonced8/.julia/compiled/v1.3/SigmoidNumbers/7gMf0_T5r6f.ji./v1.3/SigmoidNumbers/7gMf0_T5r6f.ji.

Stacktrace:

[1] error( ::String ) at ./error.jl:33

[2] compilecache( ::Base.PkgId, ::String ) at ./loading.jl:1283

[3] _require( ::Base.PkgId ) at ./loading.jl:1024

[4] require( ::Base.PkgId ) at ./loading.jl:922

[5] require( ::Module, ::Symbol ) at ./loading.jl:917

I believe the error is because of this instruction:

(::Type{Exact{N,ES}}){N,ES}(n::Unsigned)::Vnum{N,ES} = iseven(n) ? Vnum{N,ES}(n) : throw(ArgumentError(“Exact numbers must have an even int representation!”))

From what I searched, the double colon is a valid punctuation in Julia.
I’m using Julia 1.3.1 for OSX.
Anyone knows how to fix this issue? Thank you in advance!

Looks like the package isn’t being actively developed and maybe hasn’t been updated for Julia in the post 1.0 period (which is when the language had quite a few breaking changes).

You could try downloading Julia 0.7 (or earlier) versions and check if the package is running. If it works on 0.7, you should get deprecation warnings telling you which bit of the syntax used in the package currently isn’t working in v1.0+, so you could fix those to make the package usable on 1.0

2 Likes

That was indeed the problem.
Tried with Julia 0.7 and got a bunch of warnings, as you said. We’ll try to fix them.
Thank you very much!

1 Like

@gonced8, I believe this may be a replacement package: GitHub - milankl/SoftPosit.jl: A posit arithmetic emulator.

If I’m right (there are some other), maybe make a PR to the other pointing to that one?

See also: GitHub - milankl/Sonums.jl: The Self-Organizing NUMbers. A number format that learns from data. “The Self-Organizing NUMbers. A number format that learns from data.”

About all these related (excluding SONUMS?) number formats of his, see:
https://posithub.org/docs/PDS/PositEffortsSurvey.html

If “sigmoid numbers” aren’t a synonym for posits, consider: GitHub - Etaphase/FastSigmoids.jl: Sigmoid Numbers backed by IEEE Floats

1 Like