[From nobody Mon Jun 26 09:08:46 2006 X-Account-Key: account5 Return-Path: <sfandino@yahoo.com> Received: from csmtpmx10.frontal.correo (10.20.102.10) by ems4.backend.correo (7.2.070) id 44894AAB009332E1 for salvafg@terra.es; Mon, 26 Jun 2006 17:56:38 +0200 Received: from web52715.mail.yahoo.com (206.190.48.238) by csmtpmx10.frontal.correo (7.2.056.6) id 44198B7901C8A9C4 for salvafg@terra.es; Mon, 26 Jun 2006 17:56:37 +0200 Received: (qmail 14072 invoked by uid 60001); 26 Jun 2006 15:56:35 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=gILHeIkYyt943/2OtB8UsGo1PvRqhMhjtWPawfH9MSJqL/SBdgBYgUJcCHnFP+SUWFOJe6pu3gC12lnh9Kc/fP80djv91Nh4Zx6f8BgZkYBPC0OvL7JT5FyFxgapg0EpP+1oiQuw9BoP1BC86bss36gJM2aGCVFfMSWDtJ6+CzQ= ; Message-ID: <20060626155635.14070.qmail@web52715.mail.yahoo.com> Received: from [83.50.160.217] by web52715.mail.yahoo.com via HTTP; Mon, 26 Jun 2006 08:56:34 PDT Date: Mon, 26 Jun 2006 08:56:34 -0700 (PDT) From: =?utf-8?q?Salvador=20Fandi=C3=83=C2=B1o?= <sfandino@yahoo.com> Reply-To: =?utf-8?q?Salvador=20Fandi=C3=83=C2=B1o?= <sfandino@yahoo.com> Subject: Fw: [SWIPL] Interfacing Perl and Swipl To: salvafg@terra.es MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ----- Forwarded Message ---- From: Yohann THOMAS <yohann.thomas@orange-ft.com> To: Salvador Fandi=C3=83=C2=B1o <sfandino@yahoo.com> Cc: prolog@science.uva.nl Sent: Monday, June 26, 2006 4:41:31 PM Subject: Re: [SWIPL] Interfacing Perl and Swipl Hi Salvador, Thanks a lot, now it works well on my Linux platform (but explicitely=20 loading the 'sgml' module was not necessary). However, it still does not work on Mac OS X, and I wonder whether the=20 trouble comes from the DynaLoader, as you say, or from something else. Here is the error I have with Mac OS : Can't load=20 '/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/Language/Prolog/Yaswi/= Low/Low.bundle'=20 for module Language::Prolog::Yaswi::Low:=20 dlopen(/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/Language/Prolog/= Yaswi/Low/Low.bundle,=20 9): Symbol not found: _boot_DynaLoader Referenced from:=20 /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/Language/Prolog/Yaswi/L= ow/Low.bundle Expected in: dynamic lookup at=20 /Library/Perl/5.8.6/darwin-thread-multi-2level/Language/Prolog/Yaswi.pm=20 line 53 Compilation failed in require at=20 /Library/Perl/5.8.6/darwin-thread-multi-2level/Language/Prolog/Yaswi.pm=20 line 53. BEGIN failed--compilation aborted at=20 /Library/Perl/5.8.6/darwin-thread-multi-2level/Language/Prolog/Yaswi.pm=20 line 53. Compilation failed in require at ./main.pl line 7. BEGIN failed--compilation aborted at ./main.pl line 7. What do you think about this ? Nevertheless, the good news is that it works on Linux ! :-) Thanks again. Yohann Salvador Fandi=C3=83=C2=B1o a =C3=A9crit : > Hi Yohann, > > It was not possible to use SWI-Prolog C extensions from Language::Prolog:= :Yaswi, but I have just uploaded a new version of the module (0.10) to CPAN= that adds support for that feature under some OSs: Linux, Solaris, maybe o= thers (unfortunately, I have to use a feature from the DynaLoader that is n= ot available everywhere). > > And you also need to load the 'sgml' module where load_xml_file/2 is defi= ned explicetely from your code. > > That code works for me: > > use Language::Prolog::Yaswi qw(:query :load); > use Language::Prolog::Types::overload; > use Language::Prolog::Sugar 'auto_functor', vars =3D>[qw(T)]; > > swi_use_modules(library(sgml)); > > swi_set_query(load_xml_file('/etc/gaim/prefs.xml',T)); > > while(swi_next) { > print "Query =3D ", swi_query(), "\n"; > } > > > Cheers, > > - Salva. > > =20 > ----- Original Message ---- > From: Yohann THOMAS <yohann.thomas@orange-ft.com> > To: prolog@science.uva.nl > Cc: Yohann THOMAS <yohann.thomas@orange-ft.com> > Sent: Thursday, June 22, 2006 5:40:23 PM > Subject: [SWIPL] Interfacing Perl and Swipl > > Hello everybody, > > I'm trying to interface SWI-prolog with Perl using the CPAN module=20 > Language::Prolog::Yaswi. > Executing Prolog queries from Perl works well with self-defined=20 > predicates, but I have problems with internal functions of Swi-Prolog. > For example, I can't execute "load_xml_file" from Perl. > > In fact, here is the Perl code : > > -------------------------------------------------------------- > use Language::Prolog::Yaswi ':query'; > use Language::Prolog::Types::overload; > use Language::Prolog::Sugar functors =3D> [qw (load_xml_file)], > vars =3D> [qw (T)]; > > swi_set_query(load_xml_file('foo.xml',T)); > > while(swi_next) { > printf "Query=3D".swi_query()."\n"; > } > -------------------------------------------------------------- > > > Executing the Perl script returns this error : > > -------------------------------------------------------------- > error(existence_error(procedure, '/'(load_xml_file, 2)), _100) > -------------------------------------------------------------- > > Note that load_xml_file('foo.xml',T). works well when I call it from swip= l. > > Any idea ? Does anybody have ever tried this ? > > Thanks, > > Yohann > > > > ------------ > For further info, please visit http://www.swi-prolog.org/ > > To unsubscribe, send a plaintext mail with "unsubscribe prolog <e-mail>" > in its body to majordomo@science.uva.nl > > > > =20 ]