better domain error in format_//2
Example:
?- format("", [hello]).
caught: error(domain_error(empty_list,[hello]),format_//2)
This commit is contained in:
@@ -158,7 +158,7 @@ element_gluevar(glue(_,V), N, N) --> [V].
|
||||
|
||||
cells([], Args, Tab, Es) -->
|
||||
( { Args == [] } -> cell(Tab, Tab, Es)
|
||||
; { domain_error(no_remaining_arguments, Args, format_//2) }
|
||||
; { domain_error(empty_list, Args, format_//2) }
|
||||
).
|
||||
cells([~,~|Fs], Args, Tab, Es) --> !,
|
||||
cells(Fs, Args, Tab, [chars("~")|Es]).
|
||||
|
||||
Reference in New Issue
Block a user