Search found 147 matches

by Peter Muraya
8 Mar 2015 10:36
Forum: Visual Prolog
Topic: Order of delegation and inheritance: does it matter?
Replies: 5
Views: 5538

Order of delegation and inheritance: does it matter?

The message is clear: no guarantee. Thanks.
by Peter Muraya
7 Mar 2015 10:24
Forum: Visual Prolog
Topic: Order of delegation and inheritance: does it matter?
Replies: 5
Views: 5538

Order of delegation and inheritance: does it matter?

Thanks Thomas.
Ok, so the order matters, and on further investigation, I have seen that it is first-delegation-comes-first. I can live with the problem, until it is fixed, but is there some sort of guarantee that this order always stay them same?
by Peter Muraya
6 Mar 2015 13:56
Forum: Visual Prolog
Topic: Order of delegation and inheritance: does it matter?
Replies: 5
Views: 5538

Order of delegation and inheritance: does it matter?

Hi all, Does the order of delegating interfaces to facts matter? And if so, why is it not the case for inheritance? I ask these questions because my program behaved unexpectedly when I used delegation rather than inheritance and I could not figure out a very logical explanation for this. In the samp...
by Peter Muraya
24 Feb 2015 10:11
Forum: Visual Prolog
Topic: Refactor
Replies: 2
Views: 3408

Refactoring

Am I missing something about the Refactor option on the IDE? It simply renames the .pack file currently being pointed at -- which I find unsatisfactory. The nodes on my IDE tree usually correspond to some class, say xx. I expected that renaming such a node to, say yy, will lead to the following acti...
by Peter Muraya
23 Feb 2015 12:05
Forum: Visual Prolog
Topic: Parser generator invalid code
Replies: 9
Views: 4216

Parser generator invalid code

Many thanks.
by Peter Muraya
23 Feb 2015 10:21
Forum: Visual Prolog
Topic: Compiler warning/Calling from a parent class to a child class
Replies: 7
Views: 4412

Compiler warning/Calling from a parent class to a child class

I now appreciate the value of "predicates from xxx" for implementing the Support pattern, but I don't understand the use of "supports" as used by Martin in the following code. implement incubation supports reproductionSite %What does this do? inherits reproductionSupport facts type:string := "INCUBA...
by Peter Muraya
23 Feb 2015 9:43
Forum: Visual Prolog
Topic: Parser generator invalid code
Replies: 9
Views: 4216

Parser generator invalid code

Thanks. So, if I really wanted a cursor for the [t_comp] token I would need two rules. Correct?

Code: Select all

Exp{mkBinOP(Op,A,B, MyCursor)} ==>Exp{A}, Comp{op(MyCursor, Op)}, Exp{B}. Comp{op(Cursor, Op)} ==> [t_comp]{Op}.
by Peter Muraya
22 Feb 2015 10:10
Forum: Visual Prolog
Topic: Parser generator invalid code
Replies: 9
Views: 4216

Parser generator invalid code

Thanks. I looked at the grammar in expressionGrm and found the following code that uses A,B as parse tree reference names. nonterminals exp : expression. rules exp { mkBinOp(Op, A, B) } ==> exp { A }, [t_cmp] { Op }, exp { B }. Then I looked the LALR parser documentation and found this similar examp...
by Peter Muraya
21 Feb 2015 10:59
Forum: Visual Prolog
Topic: Parser generator invalid code
Replies: 9
Views: 4216

Parser generator invalid code

Hi,
I have now upgraded to VP 7.5 and had a brief look at the folder vpiLalrGen. Could you please point me to the documentation, if any, of a vpiGrm file?
Thanks
by Peter Muraya
20 Feb 2015 10:58
Forum: Visual Prolog
Topic: Definition of property as a predicate
Replies: 4
Views: 3420

Definition of property as a predicate

The point a semantic ambiguity makes sense. Thanks.
by Peter Muraya
19 Feb 2015 17:10
Forum: Visual Prolog
Topic: Parser generator invalid code
Replies: 9
Views: 4216

Parser generator invalid code

Thanks Thomas. Now I have 2 compelling reasons to upgrade to VP 7.5: the updated parser generator and the code re-factoring option that I badly need.
by Peter Muraya
19 Feb 2015 12:25
Forum: Visual Prolog
Topic: Definition of property as a predicate
Replies: 4
Views: 3420

Definition of property as a predicate

/* interface test domains optimum_function = (real*)->real. properties optimum:optimum_function. end interface class test:test end class implement test facts optimum:optimum_function:=erroneous. end implement */ interface test properties optimum:(real*)->real. end interface class test:test end clas...
by Peter Muraya
18 Feb 2015 15:47
Forum: Visual Prolog
Topic: Parser generator invalid code
Replies: 9
Views: 4216

Parser generator invalid code

productions EXPRESSION = /* This expression without the cursor tracking generates valid code*/ /*EXPRESSION plus EXPRESSION -> plus(EXPRESSION, EXPRESSION),*/ /* With the :CURSOR the generated invalid code*/ EXPRESSION plus:CURSOR EXPRESSION -> plus(EXPRESSION, CURSOR, EXPRESSION) /* Other arithmet...
by Peter Muraya
18 Feb 2015 14:45
Forum: Visual Prolog
Topic: Find string position given line and column location
Replies: 6
Views: 5087

Find string position given line and column location

Thanks Thomas, I understand your approach. The string I am inserting came about after adopting an approach that uses generic interfaces and classes in place of the non-generic ones. In my earlier code I had a definitions like:- interface fertilization supports reproduction end interface After parame...
by Peter Muraya
17 Feb 2015 17:47
Forum: Visual Prolog
Topic: Find string position given line and column location
Replies: 6
Views: 5087

Find string position given line and column location

/***************************************************************************** Insert specified text at the current cursor position in the file being edited ******************************************************************************/ implement main open core clauses run():- console::init(), /* R...