سؤال

The following used maplist works in swi-prolog not in gprolog:

GNU Prolog 1.3.1
By Daniel Diaz
Copyright (C) 1999-2009 Daniel Diaz
| ?- maplist(writeln,[1,2,3]).
uncaught exception: error(existence_error(procedure,maplist/2),top_level/0)
| ?-

Regards!

هل كانت مفيدة؟

المحلول

I've just tested it on my gprolog:

GNU Prolog 1.4.1
By Daniel Diaz
Copyright (C) 1999-2012 Daniel Diaz
| ?- maplist(write,[1,2,3]).  
123

Therefore maplistis defined in newer versions.

Please also note that there is no writeln in gprolog, so if you need it, you will have to define it first.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top