uncaught exception

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

uncaught exception

Csányi Pál
Hi,

I searched the mailing list's archive and found exactly one such a
thread with this  topic. I don't found any useful advices for this
problem out there.

So, the problem is as follows.

My operating system is ArchLinux and there I have instaled gprolog out there.

I found several tutorials on the Internet. In every case when I'm
trying to consult a prolog program at gprolog prompt, I get the
message eg.:

| ?- [Tutorial0.pro].
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?

--
Regards from Pal

_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog
Reply | Threaded
Open this post in threaded view
|

Re: uncaught exception

emacstheviking
>
> | ?- [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.

The page on consulting:

    http://www.gprolog.org/manual/gprolog.html#sec10


:_
Cheers,
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?
>
> --
> Regards from Pal
>
> _______________________________________________
> Users-prolog mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/users-prolog


--
me <[hidden email]>

_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog
Reply | Threaded
Open this post in threaded view
|

Re: uncaught exception

Csányi Pál
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 <[hidden email]>:
>>
>> | ?- [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

_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog