Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Yaswi with modules

2 views
Skip to first unread message

Steffen Schwigon

unread,
Jan 9, 2006, 10:30:03 AM1/9/06
to per...@perl.org
Hi!

I'm using Language::Prolog::Yaswi.

Everything works ok with 'consult'ing prolog files.

When I write all my prolog in modules (without public/export
declaration) I have problems to use them in L::P::Yaswi.

My mini example (see attachments) has a predicate give_me_sth/2, that
can be used this way in pure swi prolog:

$ pl
?- use_module('a.swipl').
?- use_module('b.swipl').
?- module(a).
a: ?- give_me_sth(2, Answer).
Answer = 222 ;
a: ?- module(b).
b: ?- give_me_sth(2, Answer).
Answer = 2 ;

However I'm not able to call it from Perl with L::P::Yaswi. I always
get: error(existence_error(procedure, '/'(give_me_sth, 2)), _100).

I thought it should basically used this way:

swi_use_modules ( "./a.swipl", "./b.swipl" );
local $swi_module = 'a'; ### or 'b'
swi_set_query( give_me_sth(2, Answer) );
swi_var(Answer);

Please see attachment for full mini example.

If someoene please could give me a hint what I'm doing wrong ...

I'm no prolog wizard anyway, so it's also possible I'm doing
something wrong there.

(Greeti+Tha)nX
Steffen
--
Steffen Schwigon <schw...@webit.de>
Dresden Perl Mongers <http://dresden-pm.org/>

a.swipl
b.swipl
use_swi.pl
0 new messages