]> Repositorios git - scryer-prolog.git/commitdiff
better domain error in format_//2
authorMarkus Triska <[email protected]>
Sun, 7 Jun 2020 21:04:42 +0000 (23:04 +0200)
committerMarkus Triska <[email protected]>
Sun, 7 Jun 2020 21:59:37 +0000 (23:59 +0200)
Example:

    ?- format("", [hello]).
    caught: error(domain_error(empty_list,[hello]),format_//2)

src/prolog/lib/format.pl

index 18289094c5d9492aa09ac2e37242b291860d20dd..8b090cf68aa19325689c683f453e64f48f8a1746 100644 (file)
@@ -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]).