encodings

Tips and tricks when running Logtalk using YAP as the back-end compiler

Moderator: Paulo Moura

Post Reply
joerg
Posts: 40
Joined: Fri Dec 21, 2007 9:38 am

encodings

Post by joerg » Fri May 23, 2008 10:44 am

Hello,

I was not able to use different encodings in YAP 5.11. (YAP 5.12 is so unstable that I could not use it at all on my system.)

When I compile a simple Logtalk file that starts with ":- encoding('UTF-8')." I get the following error message:

?- logtalk_load(tmp).
<<< loading source file tmp...
>>> compiling source file tmp...
% YAP: no handler for error error(error(resource_error(text_encoding_support),directive(encoding(UTF-8))),logtalk_load(tmp))
?-

When I try to compile babel.lgt from the examples that come with Logtalk, I get this error message:

?- logtalk_load(babel).
<<< loading source file babel...
>>> compiling source file babel...
ERROR! syntax_error(read(_673),between(1,1,2),'
<==== HERE ====>
',[atom('ï')-1,atom('»¿')-1,atom(:-)-2,atom(encoding)-2,'('-2,atom('UTF-8')-2,')'-2],1,1)
in: ['SYNTAX ERROR'|local_sp(142799816,[],[])]
above line: 3
% YAP: no handler for error error(error(syntax_error(read(_1351),between(1,1,2),
<==== HERE ====>
,[atom(ï)-1,atom(»¿)-1,atom(:-)-2,atom(encoding)-2,(-2,atom(UTF-8)-2,)-2],1,1),[SYNTAX ERROR|local_sp(142799816,[],[])]),logtalk_load(babel))
?-

What am I doing wrong?

Jörg

(By the way: In German, 'Joerg' is a valid variant of 'Jörg', or, more generally, 'oe' is a valid variant of 'ö'.)

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: encodings

Post by Paulo Moura » Fri May 23, 2008 11:16 am

joerg wrote: I was not able to use different encodings in YAP 5.11. (YAP 5.12 is so unstable that I could not use it at all on my system.)
...
What am I doing wrong?
Nothing. You need to use the YAP 5.1.3, currently in development. I found (and Vítor fixed) a number of bugs in the YAP support for different encodings in previous versions. At Logtalk startup (with the default setting of "verbose" for the "startup_message" flag), check the value of the "encoding_directive" flag. For YAP versions 5.1.1 and 5.1.2 it should read "unsupported". If you decide to install the current YAP CVS version, try the Logtalk "encodings" example. The only trouble should be with the "mythology" source file that is encoded in UTF-32, which YAP doesn't support.
joerg wrote: (By the way: In German, 'Joerg' is a valid variant of 'Jörg', or, more generally, 'oe' is a valid variant of 'ö'.)
I suspected that much from your email address. Thanks for the confirmation.

Best regards,

Paulo

P.S. The current development version of Logtalk includes improved support for Emacs.
Paulo Moura
Logtalk developer

joerg
Posts: 40
Joined: Fri Dec 21, 2007 9:38 am

Re: encodings

Post by joerg » Fri May 23, 2008 11:55 am

Hello Paulo,

thanks for your quick answer and for having added more Emacs support.

Where can I get the current development version of YAP? The link given on the YAP homepage (http://www.dcc.fc.up.pt/~vsc/Yap/downloads.html) produces a 404 error.

Jörg

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: encodings

Post by Paulo Moura » Fri May 23, 2008 12:06 pm

joerg wrote: Where can I get the current development version of YAP? The link given on the YAP homepage (http://www.dcc.fc.up.pt/~vsc/Yap/downloads.html) produces a 404 error.
I assume that you're referring to the SourceForge link in the URL. Same problem here. Are the CVS checkout commands in the URL above also giving you access errors? As far as I know, CVS is mandatory for getting the latest development version; there are no "nightly builds" available.

Best regards,

Paulo
Paulo Moura
Logtalk developer

joerg
Posts: 40
Joined: Fri Dec 21, 2007 9:38 am

Re: encodings

Post by joerg » Fri May 23, 2008 1:13 pm

Applying the oh-no-not-yet-another-readme-file way of reading, I mistook the cvs notes for installation notes.

I have installed Yap 5.13 now and it seems to work with the encoding examples. I get an error when loading logtalk, though. You will probably know this error, but here it is, just in case:

% reconsulting /home/schuster/bin/logtalk/lgt2315/configs/yap.config...
ERROR!! at file /home/schuster/bin/logtalk/lgt2315/configs/yap.config, near line 98.
PERMISSION ERROR- in line 98, system predicate forall/2: modifying static procedure forall/2

Jörg

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: encodings

Post by Paulo Moura » Fri May 23, 2008 2:58 pm

joerg wrote: I have installed Yap 5.13 now and it seems to work with the encoding examples. I get an error when loading logtalk, though. You will probably know this error, but here it is, just in case:

% reconsulting /home/schuster/bin/logtalk/lgt2315/configs/yap.config...
ERROR!! at file /home/schuster/bin/logtalk/lgt2315/configs/yap.config, near line 98.
PERMISSION ERROR- in line 98, system predicate forall/2: modifying static procedure forall/2
Vítor added the forall/2 predicate as a built-in a few days ago (this predicate is specified in the current ISO Prolog Core Revision proposal). Simply remove the definition of the forall/2 predicate found on the YAP config file. The next Logtalk version, out in a few days, will include the updated YAP config file (and will require YAP 5.1.3 as YAP 5.1.2 stable is broken on Windows and cannot be used to run Logtalk).

Best regards,

Paulo
Paulo Moura
Logtalk developer

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest