From: Markus Triska Date: Thu, 23 Jan 2025 19:18:55 +0000 (+0100) Subject: FIXED: instantiation and type check for string arguments X-Git-Tag: v0.10.0~68^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=bc0f614bf934581db71aafd46ea1dd8277300707;p=scryer-prolog.git FIXED: instantiation and type check for string arguments This addresses #2790. The issue first appeared in an example reported by @ak-1 in #2788, and was successfully analyzed by @flexoron. Many thanks! --- diff --git a/src/lib/format.pl b/src/lib/format.pl index 2ac4744b..96266c5d 100644 --- a/src/lib/format.pl +++ b/src/lib/format.pl @@ -1,5 +1,5 @@ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Written 2020-2024 by Markus Triska (triska@metalevel.at) + Written 2020-2025 by Markus Triska (triska@metalevel.at) Part of Scryer Prolog. I place this code in the public domain. Use it in any way you want. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ @@ -187,7 +187,8 @@ elements_gluevars([E|Es], N0, N) --> 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 }.