slice-errors now report the parameters to the slicing operation

db4
Slava Pestov 2008-11-21 21:00:30 -06:00
parent 2cbc979460
commit d504d6b8de
2 changed files with 3 additions and 4 deletions

View File

@ -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" ;

View File

@ -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