RANDOM error message
Bug #598986 reported by
Stas Boukarev
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
RANDOM has an error message in its code: http://
But it's never reached because RANDOM is proclaimed as
(defknown random ((or (float (0.0)) (integer 1)) &optional random-state)
(or (float 0.0) (integer 0)) ())
and you get not a very helpful error:
The value -1 is not of type
(OR (SINGLE-FLOAT (0.0)) (DOUBLE-FLOAT (0.0d0)) (INTEGER 1)).
tags: | added: review |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Stas Boukarev <email address hidden> writes:
> Public bug reported: git.boinkor. net/gitweb/ sbcl.git? a=blob; f=src/code/ target- random. lisp;h= 2f7d1a623c68cb2 270e2602b15fca5 c67f2a5345; hb=HEAD# l373
>
> RANDOM has an error message in its code: http://
> But it's never reached because RANDOM is proclaimed as
>
> (defknown random ((or (float (0.0)) (integer 1)) &optional random-state)
> (or (float 0.0) (integer 0)) ())
>
> and you get not a very helpful error:
> The value -1 is not of type
> (OR (SINGLE-FLOAT (0.0)) (DOUBLE-FLOAT (0.0d0)) (INTEGER 1)).
I think that there might be an explicit-check defknown flag; I'm not
sure that its semantics are exactly right, but that's one thing to
check. Failing that, a different approach might be to get that
complicated type to unparse to (REAL (0)), which is at least relatively
simple.
Christophe