Skip to content

Commit

Permalink
FIXED: instantiation and type check for string arguments
Browse files Browse the repository at this point in the history
This addresses mthom#2790.

The issue first appeared in an example reported by @ak-1 in mthom#2788, and
was successfully analyzed by @flexoron. Many thanks!
  • Loading branch information
triska committed Jan 23, 2025
1 parent 00e6e32 commit bc0f614
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/format.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Written 2020-2024 by Markus Triska ([email protected])
Written 2020-2025 by Markus Triska ([email protected])
Part of Scryer Prolog.
I place this code in the public domain. Use it in any way you want.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Expand Down Expand Up @@ -187,7 +187,8 @@
elements_gluevars(Es, N1, N).

element_gluevar(chars(Cs), N0, N) -->
{ length(Cs, L),
{ must_be(chars, Cs),
length(Cs, L),
N is N0 + L }.
element_gluevar(glue(_,V), N, N) --> [V].
element_gluevar(goal(G), N, N) --> { G }.
Expand Down

0 comments on commit bc0f614

Please sign in to comment.