Search found 13 matches

by Jaetan
Fri Nov 05, 2010 1:14 pm
Forum: Wish list
Topic: Hierarchical Namespaces
Replies: 3
Views: 9220

Re: Hierarchical Namespaces

The namespaces in C++ are very static in nature... For a dynamic language, did you look for example at the namespaces in GNU Smalltalk and Python ? Python, not being an "objects only" language, could provide interesting ideas I believe.
by Jaetan
Sun Aug 22, 2010 10:06 am
Forum: GNU Prolog
Topic: Logtalk compatibility with GNU Prolog
Replies: 2
Views: 7511

Re: Logtalk compatibility with GNU Prolog

Thank you, Paulo :D GNU Prolog is my compiler of choice when generating self-contained executables. Since it has no support for modules, I find Logtalk is very much needed when developing with GNU Prolog. The decision to drop support for it, while understandable, scared me (and maybe a few others to...
by Jaetan
Wed Aug 19, 2009 2:10 pm
Forum: XSB
Topic: Tabled DCG
Replies: 2
Views: 7137

Re: Tabled DCG

Thank you for your advice. I will stop my "do it all in Logtalk" approach and hide code that is specific to a Prolog back-end behind a Logtalk interface. As for XSB's word/3 dynamic predicate, calling tphrase_set_string/1 shows it asserts clauses in XSB's dcg module, without possibility of choice. S...
by Jaetan
Wed Aug 19, 2009 1:48 pm
Forum: XSB
Topic: :- auto_table.
Replies: 2
Views: 6910

Re: :- auto_table.

The directive auto_table/0 cannot be supported in the same way. Adding support for this directive would imply changes to the Logtalk compiler itself in order to identify all the object predicates that would be tabled. Ah, I had not thought of this. So supporting anything that requires some level of...
by Jaetan
Wed Aug 19, 2009 11:13 am
Forum: XSB
Topic: Tabled DCG
Replies: 2
Views: 7137

Tabled DCG

I am trying to use a tabled DCG from within a Logtalk object. To this end, I would like to be able to call tphrase/1 without having to do the same kind of analysis as Logtalk does in phrase/2. Specifically, I'd like to be able to write: :- object( parse ). :- public( parse/2 ). parse( N, T ) :- tphr...
by Jaetan
Wed Aug 19, 2009 10:43 am
Forum: XSB
Topic: :- auto_table.
Replies: 2
Views: 6910

:- auto_table.

Hello, using the :- auto_table directive inside an object gives the following error on compilation: | ?- logtalk_compile( [ toto ] ). % >>> compiling source file toto... % compiling object toto... % ERROR! domain_error(directive,auto_table / 0) % in directive (:-auto_table) ++Error[XSB/Runtime] Unha...
by Jaetan
Thu May 14, 2009 11:06 am
Forum: GNU Prolog
Topic: Generating a stand-alone executable
Replies: 4
Views: 11340

Re: Generating a stand-alone executable

The goal X = 0'' is syntactically correct. That's definitely a bug in GNU Prolog. Not sure about the second one. Have you already sent a bug report to Daniel Diaz? I just did today. Nice :-) Is there a public URL for your project that I could add to the Logtalk links page? Not yet. But I will tell ...
by Jaetan
Wed May 13, 2009 10:38 am
Forum: GNU Prolog
Topic: Generating a stand-alone executable
Replies: 4
Views: 11340

Re: Generating a stand-alone executable

Thank you for your help. Following your advice, I was able to generate a stand-alone executable :D I had to add also a few other dummy predicate definitions, among which -- gasp -- ensure_loaded/1, which, contrary to the comment in gnu.pl, is only defined as a directive for GNU Prolog. I also tested...
by Jaetan
Tue May 12, 2009 11:54 am
Forum: GNU Prolog
Topic: Generating a stand-alone executable
Replies: 4
Views: 11340

Generating a stand-alone executable

Hello, I switched my Prolog compiler from SWI Prolog 5.7.8 to GNU Prolog 1.3.1, as I would like to compile my Logtalk code to a (small) stand-alone executable. The Prolog source generated by logtalk_compile still depends on some internal Logtalk definitions, and I do not know what to do to resolve t...
by Jaetan
Mon Apr 27, 2009 3:18 pm
Forum: Help
Topic: Multiple dispatch
Replies: 7
Views: 11979

Re: Multiple dispatch

Either an atom or a compound term. I.e. nothing prevents an object parameter to be the identifier of another parametric object. You may also share parameters between them. I see. That is how I can reintroduce the flexibility that I would have got from a multiple dispatch system. And, as a bonus, th...
by Jaetan
Mon Apr 27, 2009 10:04 am
Forum: Help
Topic: Multiple dispatch
Replies: 7
Views: 11979

Re: Multiple dispatch

The "viewpoints" and "parametric" examples demonstrate attractive features, that I will indeed need :) . I also gather from the Reference Manual that an object's parameter can be any Prolog term. However, I did not see anything like an object identifier... If I want to parametrize an object with ano...
by Jaetan
Thu Apr 09, 2009 3:20 pm
Forum: Help
Topic: Multiple dispatch
Replies: 7
Views: 11979

Re: Multiple dispatch

I agree these multi-methods do not belong to any of the objects which take part in its execution. On the other hand, we can choose to resolve a call like object1 doSomethingWith: object2 with: object3 to something like Dispatcher callMethod: #doSomethingWith:with: fromTypes: { object1 type . object2...
by Jaetan
Thu Apr 09, 2009 12:08 pm
Forum: Help
Topic: Multiple dispatch
Replies: 7
Views: 11979

Multiple dispatch

Hello, I would like to know if Logtalk already supports multiple dispatch. I believe I can parametrize the calls to methods with arbitrary terms (for example, something like the identifiers of objects representing the types of the arguments) to select the method to use from the types of the actual a...