slice-errors now report the parameters to the slicing operation
parent
2cbc979460
commit
d504d6b8de
|
@ -206,9 +206,8 @@ M: no-cond summary
|
||||||
M: no-case summary
|
M: no-case summary
|
||||||
drop "Fall-through in case" ;
|
drop "Fall-through in case" ;
|
||||||
|
|
||||||
M: slice-error error.
|
M: slice-error summary
|
||||||
"Cannot create slice because " write
|
drop "Cannot create slice" ;
|
||||||
reason>> print ;
|
|
||||||
|
|
||||||
M: bounds-error summary drop "Sequence index out of bounds" ;
|
M: bounds-error summary drop "Sequence index out of bounds" ;
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ TUPLE: slice
|
||||||
: collapse-slice ( m n slice -- m' n' seq )
|
: collapse-slice ( m n slice -- m' n' seq )
|
||||||
[ from>> ] [ seq>> ] bi >r tuck + >r + r> r> ; inline
|
[ from>> ] [ seq>> ] bi >r tuck + >r + r> r> ; inline
|
||||||
|
|
||||||
ERROR: slice-error reason ;
|
ERROR: slice-error from to seq reason ;
|
||||||
|
|
||||||
: check-slice ( from to seq -- from to seq )
|
: check-slice ( from to seq -- from to seq )
|
||||||
pick 0 < [ "start < 0" slice-error ] when
|
pick 0 < [ "start < 0" slice-error ] when
|
||||||
|
|
Loading…
Reference in New Issue