Strange: listing of Character values instead of the characters themselves
Peter Karlsson <[email protected]> Mon, 24 Jan 2011 14:36:06 +0100
| Newsgroups | gmane.comp.gnu.prolog.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have a short program doing permutations of a list of strings,
and it works ok in Strawberry Prolog.
But for some reason the gnu prolog lists all the character values in a name or
whatever you want to permute. Instead of the Strings themelves.
Of course I could convert that in some way, but I wonder why they
behave differently?
Best Regards,
/Peter Karlsson, Sweden
--------------------------------------------------------------------
%
% Testing permute & select
%
test :- example(Ex), permutation(Ex, Perm),
write(Perm), nl, fail.
test :- true.
example(["Peter","Diva","Ex","Newt","Xtra"]).
% Permutation & Select
%permutation(Xs, [Z|Zs]) :- select(Z, Xs, Ys), %permutation(Ys, Zs).
%permutation([],[]).
%select(X, [X|Xs], Xs).
%select(X, [Y|Ys], [Y|Zs]) :- select(X, Ys, Zs).
------------------------------------------------------------------------
Peter Karlsson / [email protected] / Täby, Sweden
_______________________________________________
Bug-prolog mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-prolog
4pk-www.jpg
(image/jpeg, 47.9 KB) - not displayed