Search found 48 matches

by Victor NOEL
Fri Jul 18, 2008 10:57 am
Forum: Wish list
Topic: List handling predicates and unification of variables
Replies: 1
Views: 5267

List handling predicates and unification of variables

Hello, I am currently playing with constraints and as they are manipulated using variables, I had a few problems using existing predicates for manipulating lists. Some of them unify variables (=), some not, for example in list.lgt, they all unify variable, but sort/2 does not. And in varlist.lgt, th...
by Victor NOEL
Tue Jul 15, 2008 12:36 pm
Forum: Help
Topic: Checking that all definitions of a predicate succeed
Replies: 4
Views: 6792

Re: Checking that all definitions of a predicate succeed

This is what I did an it worked well :]

Thanks you for the idea !

Victor
by Victor NOEL
Tue Jul 15, 2008 9:06 am
Forum: Help
Topic: Checking that all definitions of a predicate succeed
Replies: 4
Views: 6792

Re: Checking that all definitions of a predicate succeed

From your description, I assume you're defining aliases in the object in order to access the predicate definition in each category (since the definition in the first imported category will override the definitions in the remaining categories). Is my interpretation correct? Yes, exactly, I made a li...
by Victor NOEL
Mon Jul 14, 2008 3:23 pm
Forum: Help
Topic: Checking that all definitions of a predicate succeed
Replies: 4
Views: 6792

Checking that all definitions of a predicate succeed

Hello, Before starting, I would like to warn that what I want to do is maybe the bad way to do it :) I have the following problem : Several categories implement the same protocol that states that they should declare a predicate with one or zero answer. An object imports these categories, and want to...
by Victor NOEL
Mon Jun 09, 2008 1:39 pm
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 68818

Re: Gorgias port

Hi, besides the comments in my updated post above, it would be nice if, for simple cases, the user does not need to include the directives you invented. I.e. your application could provide suitable defaults for simple cases. Or maybe those defaults are already in place and I just missed them. Yes, ...
by Victor NOEL
Fri Jun 06, 2008 8:53 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 68818

Re: Gorgias port

Hello, I think I have something good, using term_expansion to add the correct alias and clauses for imported categories. (in hooks.lgt) If you have some time and can take a look at it, it would be cool :) You can see it here : https://dev.crazydwarves.org/trac/Gorgias/browser There is 3 categories t...
by Victor NOEL
Thu Jun 05, 2008 3:32 pm
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 68818

Re: Gorgias port

That's a matter of defining an alias/3 directive per imported category. You should add the directives, however, to the object importing the categories, not one of the categories (see my updated post above). You are absolutely right ! I can't understand how I didn't see that :) Thanks for your help,...
by Victor NOEL
Thu Jun 05, 2008 3:02 pm
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 68818

Re: Gorgias port

What do you mean by "the same behavior"? Making the result on the test/1 message independent of the category order? The alias/3 predicate directive allows you to give an alias to a predicate when the lookup operations access the specified entity. So, if you want to use an overridden definition, you...
by Victor NOEL
Thu Jun 05, 2008 12:05 pm
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 68818

Re: Gorgias port

The behavior of your sample code when you send the message test/1 to your object is the expected and correct one. The imported categories are always searched in the order of their declarations. I.e. by default Logtalk uses a depth-first lookup for both predicate declarations and predicate definitio...
by Victor NOEL
Thu Jun 05, 2008 8:12 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 68818

Re: Gorgias port

For now, just send me an archive with that version by mail. I will take a look later. I was able to make a little example that show what I want to do : :- object(test, imports([cata, catb, catc])). :- end_object. :- protocol(a). :- public([test1/1]). :- end_protocol. :- category(cata). :- calls(a)....
by Victor NOEL
Wed Jun 04, 2008 11:52 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 68818

Re: Gorgias port

Hello, I need your help again for my refactor of gorgias. I think I found a good way to express extensibility of gorgias : What I do is : gorgias is still a category, like before, but I add to it the attacks/5 and resolve/2 predicates, attacks0/6 (called by attacks/5) and resolveone/3 (called by res...
by Victor NOEL
Thu May 29, 2008 2:43 pm
Forum: Help
Topic: call with "::" in predicate used with a meta-predicate
Replies: 5
Views: 7558

Re: call with "::" in predicate used with a meta-predicate

You may find this behavior too restrictive. It is, however, the behavior necessary to avoid the misuse of meta-predicates to break object encapsulation. Ok, I understand : ) Do you have a recommended way to do what I want ? For now, I wrote a predicate that do the job of map, and I can keep it like...
by Victor NOEL
Thu May 29, 2008 11:57 am
Forum: Help
Topic: call with "::" in predicate used with a meta-predicate
Replies: 5
Views: 7558

Re: call with "::" in predicate used with a meta-predicate

Ok, this is a simple example : :- object(theobject, instantiates(theclass)). expand(a, 1). expand(b, 2). expand(c, 3). :- end_object. :- object(theclass, specializes(logtalk)). :- private([expand/2]). :- public([dojob/2]). dojob(From, To) :- meta::map(unexpand, From, To). unexpand(Expanded, Unexpand...
by Victor NOEL
Thu May 29, 2008 9:42 am
Forum: Help
Topic: Logtalk + JPL : Concurrent call to logtalk_load
Replies: 6
Views: 8292

Re: Logtalk + JPL : Concurrent call to logtalk_load

Ok, thanks you for all your answers :)
by Victor NOEL
Thu May 29, 2008 9:21 am
Forum: Help
Topic: Logtalk + JPL : Concurrent call to logtalk_load
Replies: 6
Views: 8292

Re: Logtalk + JPL : Concurrent call to logtalk_load

Do you mean by defining my agents in prolog ? So to not use java and JPL ? Possibly. Why exactly you're using Java? For giving your agents a graphical user interface? In fact I am not using java, but scala, which is : (from its homage scala-lang.org) "Scala is a general purpose programming language...