8000 [UX]: "An argument doesn't have a generator set!" · Issue #37 · Seelengrab/Supposition.jl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[UX]: "An argument doesn't have a generator set!" #37

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

Open
jariji opened this issue Apr 12, 2024 · 2 comments
Open

[UX]: "An argument doesn't have a generator set!" #37

jariji opened this issue Apr 12, 2024 · 2 comments
Labels
UX Issues relating to UX

Comments

@jariji
Copy link
Contributor
jariji commented Apr 12, 2024

What happened?

julia> Supposition.@check function checkassociativeinstance(a::Data.Floats(),b::Data.Floats(),c::Data.Floats())
       (a + b) + c == a + (b + c)
       end
ERROR: LoadError: ArgumentError: An argument doesn't have a generator set!
in expression starting at REPL[13]:1

How could this be communicated better?

It says "An argument doesn't have a generator set!" but

  • I don't know what a generator set is
  • Why is it yelling at me (with a !)

Julia Version

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × AMD Ryzen 9 3900XT 12-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
  Threads: 17 on 24 virtual cores
Environment:
  JULIA_NUM_THREADS = 12

Package Environment

(@main) pkg> st Supposition
Status `~/.julia/environments/main/Project.toml`
  [5a0628fe] Supposition v0.3.1
@jariji jariji added the UX Issues relating to UX label Apr 12, 2024
@jariji jariji changed the title [UX]: [UX]: "An argument doesn't have a generator set!" Apr 12, 2024
@Seelengrab
Copy link
Owner

The syntax is a=Data.Floats(), not a::Data.Floats(); i.e. you're assigning/setting a to use elements from Data.Floats(). It's not a type assertion, because Data.Floats() is not a type, and you can reuse properties defined in this way with other generators that produce other element types.

Would "An argument doesn't have a generator assigned!" be better? I'm using exclamation marks here to indicate a critical problem, not to yell (yelling would be "AN ARGUMENT DOESN'T HAVE A GENERATOR ASSIGNED!").

@jariji
Copy link
Contributor Author
jariji commented Apr 13, 2024

Ideally it would recognize this :: vs = syntax mistake specially and tell me. In #2 I apparently thought of :: too so I figure this won't be the last time somebody makes this mistake.

The next best thing might be

argument a has no Possibility assigned. Try a=Data.Just(3) or similar.

(Maybe giving an example is pushing it too far.) But using the word Possibility instead of "generator" seems good, since that's what's missing.

As for the !, we're in an error message so I already know it's a failure: I prefer a calmer experience - just the facts.

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

No branches or pull requests

2 participants
0