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

static infinity #19

Open
cscherrer opened this issue Nov 23, 2021 · 3 comments
Open

static infinity #19

cscherrer opened this issue Nov 23, 2021 · 3 comments

Comments

@cscherrer
Copy link

I'm not sure whether it makes more sense here or in Static.jl, but I'd think there should be code somewhere to make this work:

julia> static(∞)
ERROR: There is no static alternative for type Infinities.Infinity.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] _no_static_type(x::Any)
   @ Static ~/.julia/packages/Static/2w1BY/src/Static.jl:85
 [3] static(x::Infinities.Infinity)
   @ Static ~/.julia/packages/Static/2w1BY/src/Static.jl:70
 [4] top-level scope
   @ REPL[6]:1
@dlfivefifty
Copy link
Member

It would be odd for Static.jl to depend on Infinities.jl so if anything it should be the other way around

but i don't understand what a "static type" is. Is it what I would call a "Singleton type"?

@cscherrer
Copy link
Author

It's like a Val with proper subtyping and arithmetic methods, so more can be computed statically. Great trick for pushing work to compile time.

@dlfivefifty
Copy link
Member

I would still call that a singleton type…

yes I’ll accept a PR

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

No branches or pull requests

2 participants