Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mild Shock Newsgroups: comp.lang.prolog Subject: Cannot consult/1 after listing/1 (Was: Scryer Prolog has dethroned SWI-Prolog) Date: Wed, 28 May 2025 12:09:28 +0200 Message-ID: <1016nco$28f4$1@solani.org> References: <100v02i$93oj$1@solani.org> <1011fck$a9rv$1@solani.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 28 May 2025 10:09:28 -0000 (UTC) Injection-Info: solani.org; logging-data="74212"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.20 Cancel-Lock: sha1:cebyWyGheWyrbhUM3YZAnIeJbwk= X-User-ID: eJwNy8kRwCAMBLCWwCcpx14v/ZcQRm+5xg6khYf5fbxur/SGUaBKzEiSH3E4KDCW225qSmm9ytzRPOcmsOoHifEXDg== In-Reply-To: <1011fck$a9rv$1@solani.org> I retract my claim that Scryer Prolog has dethroned anything. Its still in a quite bad state. It also shows that generating annonymous variables, has also some use cases, where its not only an arbitrary feature but rather a necessity. Take this real world example, from a file case.pl: :- dynamic(sys_get_code_list/6). sys_get_code_list(-1, _, _, _, [], _) :- !. sys_get_code_list(H, H, _, _, [H], _) :- !. sys_get_code_list(H, _, 1, _, [H], _) :- !. sys_get_code_list(H, D, 0, S, [H|L], F) :- !, sys_get_code(S, J, F), sys_get_code_list(J, D, 0, S, L, F). sys_get_code_list(H, D, M, S, [H|L], F) :- sys_get_code(S, J, F), N is M-1, sys_get_code_list(J, D, N, S, L, F). If I use Scyer Prolog listing/1 I get, I added the dynamic manually: :- dynamic(sys_get_code_list/6). sys_get_code_list(-1,A,B,C,[],D) :- !. sys_get_code_list(A,A,B,C,[A],D) :- !. sys_get_code_list(A,B,1,C,[A],D) :- !. sys_get_code_list(A,B,0,C,[A|D],E) :- !, sys_get_code(C,F,E), sys_get_code_list(F,B,0,C,D,E). sys_get_code_list(A,B,C,D,[A|E],F) :- sys_get_code(D,G,F), H is C-1, sys_get_code_list(G,B,H,D,E,F). If I put the generated code into a file case2.pl, I suddently get a lot of warnings: $ target/release/scryer-prolog ?- [case2]. % Warning: singleton variables A, B, C, D at line 1 of case2.pl % Warning: singleton variables B, C, D at line 3 of case2.pl % Warning: singleton variables B, C, D at line 5 of case2.pl true. Mild Shock schrieb: > Hi, > > Interestingly Scryer Prolog does many things right. > I find the following test case: > > /* Scryer Prolog 0.9.4-403 */ > ?- length(L,2), f(L) = R, S = [_A]. > L = [_B, _C], > R = f([_B, _C]), > S = [_A]. > > While SWI-Prolog still makes the following error. The > newly generated _A and _B are not checked whether they > already appear in the answer elsewhere, causing a name clash: > > /* SWI-Prolog 9.3.22 */ > ?- length(L,2), f(L) = R, S = [_A]. >  = [_A, _B], > R = f([_A, _B]), > S = [_A]. > > Other Prolog systems that avoid the clash as well are > Trealla Prolog, and since today Dogelog Player. > > Bye > > Mild Shock schrieb: >> Hi, >> >> It is time for the 2025 Prolog Awards. >> Are you excited yet? >> >> https://9gag.com/gag/aPAXyEP >> >> Here is the list: >> >> 1. Place: Scryer Prolog, it uses rustyline, >> very convenient: >> >> app     gives append >> a  cycles through letter a predicates >> length(foo)  shows the matching braket in blue >> Etc.. >> >> -1. Place: SWI-Prolog, has no line edit at all >> >> Bye >