[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uncaught exception
From: |
Csányi Pál |
Subject: |
Re: uncaught exception |
Date: |
Mon, 14 Jul 2014 12:05:43 +0200 |
Hello Sean,
>> uncaught exception: error(syntax_error('user_input:2 (char:11) , | ]
>> or operator expected in list'),read_term/3)
>> | ?-
>>
>> The Tutorial0.pro was edited in Emacs and has the following contents:
>> <file>
>> likes(mary,food).
>> likes(mary,wine).
>> likes(john,wine).
>> likes(john,mary).
>>
>> </file>
>>
>> So what is the problem, why can't I consult this file into gprolog?
2014-07-14 11:50 GMT+02:00 me <address@hidden>:
>>
>> | ?- [Tutorial0.pro].
>
> Normally you don't need to put the file extension on at all and `consult`
> expects an atom so at the very least the above line maybe ought to look like:
>
> ?- ['Tutorial0].
> Apart from that I can't see anything else wrong with the information you
> gave... see how the above works out.
Yes, indeed:
| ?- ['Tutorial0'].
compiling /home/cspal/Emacs/Prolog/Tutorial0.pro for byte code...
/home/cspal/Emacs/Prolog/Tutorial0.pro compiled, 4 lines read - 540
bytes written, 10 ms
yes
| ?- ['Tutorial0.pro'].
compiling /home/cspal/Emacs/Prolog/Tutorial0.pro for byte code...
/home/cspal/Emacs/Prolog/Tutorial0.pro compiled, 4 lines read - 540
bytes written, 12 ms
yes
| ?-
So my mistake was that that I don't put the file name between '
characters, like: 'Tutorial0'
> The page on consulting:
>
> http://www.gprolog.org/manual/gprolog.html#sec10
When I follow this abowe, it hangs forever:
| ?- [user].
compiling user for byte code...
Why it hangs forever?
--
Regards from Pal