1

Ok I am trying to use the permutation function and i get a weird type error exception.

permutation(X,[1,2,3]).
X = [1,2,3]

When I type a semicolon I get the following error:

ERROR: Type error: 'character_code' expected, found '-1' (an integer)
ERROR: In:
ERROR:    [11] char_code(_8378,-1)
ERROR:    [10] '$in_reply'(-1,'?h') at z/somepath/swipl/boot/init.pl:779

Is this a problem with my installation or am I doing something wrong? I want it to give all the possible combinations

I am running swi-pl on windows.

UPDATE:

I found out that it is only happening when i am running it on powershell, does anybody know why?

  • 3
    Post your code, from this point without the code it could be anything.... – coder Jun 18 '17 at 10:59
  • 2
    Are you using SWI Prolog's `permutation` or did you write your own? SWI already has one, which is a bad idea to redefine. If you wrote your own, choose a different name (perhaps, `permute`). And as @coder says, please show your code. This question is useless without it. – lurker Jun 18 '17 at 11:08
  • 1
    @lurker no I used the default one. I am just launching prolog and running this line. – Dimitris Karagiannis Jun 18 '17 at 11:20

0 Answers0