Search found 280 matches

by Martin Meyer
21 May 2015 14:56
Forum: Visual Prolog
Topic: Callback Actions for Exceptions and Failure
Replies: 13
Views: 8520

Callback Actions for Exceptions and Failure

Hello Thomas, for some purposes it could be very beneficial, if callback predicates could be set, which are called a) whenever an exception occurs, b) whenever something has failed, i.e. each time backtracking has been performed. The purpose, for which I would like to use the callback predicates, is...
by Martin Meyer
18 May 2015 8:35
Forum: Visual Prolog
Topic: Conflicting support instances
Replies: 8
Views: 4415

Hello Thomas,

your counter example is greatly enlightening the subtyping thing, thanx!

Best regards
Martin
by Martin Meyer
15 May 2015 23:09
Forum: Visual Prolog
Topic: Conflicting support instances
Replies: 8
Views: 4415

Despite object being a supertype of range , user_defined{object} is no supertype of user_defined{range} , and hence the compiler throws that type incompatibility error. I wonder whether this behavior of the compiler has an inherent reason or could be changed in a future VIP version. Below variant of...
by Martin Meyer
15 May 2015 11:25
Forum: Visual Prolog
Topic: Conflicting support instances
Replies: 8
Views: 4415

Hi Peter, I suppose the conflicting support instances error is correct behavior of the compiler. The compiler throws it, because for example interface range (directly) supports expression{range} and (indirectly) also supports expression{user_defined} . Thus in one way it's stated, that in the interf...
by Martin Meyer
27 Feb 2015 11:44
Forum: Visual Prolog
Topic: Debug File Flag
Replies: 6
Views: 3894

Yes Thomas, I am used to define a constant debug in main.cl to toggle my self-made debug configuration on/off. The program sections, I am conditionally switching on/off in compilation via the constant, contain predicates, which output the contents of structures (for example collections) through stdI...
by Martin Meyer
26 Feb 2015 14:27
Forum: Visual Prolog
Topic: Debug File Flag
Replies: 6
Views: 3894

Thx for the info, Thomas!

Maybe you could introduce a new build-in constant in a future release to make the flag available at compile time?

Many regards
Martin
by Martin Meyer
26 Feb 2015 10:22
Forum: Visual Prolog
Topic: Debug File Flag
Replies: 6
Views: 3894

Debug File Flag

Hi Thomas and all,

in Project Settings in the Version Information tab in line File Flags the first flag is named Debug. How to query the flag in a program? I would like to use it in the way:

Code: Select all

#if debug = true #then     ... my add-on code for debugging purposes ... #endif
Regards
Martin
by Martin Meyer
19 Feb 2015 17:52
Forum: Visual Prolog
Topic: Definition of property as a predicate
Replies: 4
Views: 3424

I suppose, such syntax cannot be allowed, because that leads to semantic ambiguity: When a fact, which has a function type, could be declared in the way facts optimum : (real*) -> real. then it should work in the same way to declare a fact having a predicate type by facts optimum : (real*). The late...
by Martin Meyer
16 Feb 2015 10:20
Forum: Visual Prolog
Topic: Free parameter error
Replies: 1
Views: 2471

Free parameter error

Hello Thomas, please have a look at below construct. It does not compile (in build 7501). Regards Martin interface obj1{@Type1} properties value : @Type1. end interface obj1 %--- interface obj2{@Type2} properties from obj1{@Type2} value end interface obj2 %--- interface obj3{@Type3} properties from ...
by Martin Meyer
14 Feb 2015 17:59
Forum: Visual Prolog
Topic: Generic predicates
Replies: 6
Views: 4450

I am trying to answer your first two questions. Thomas may correct me, when am wrong: to 1) object and X (in the place you used it) have different meanings: Tutorial http://wiki.visual-prolog.com/index.php?title=Introduction_to_Classes_and_Objects says >> object is an implicitly defined interface th...
by Martin Meyer
13 Feb 2015 20:46
Forum: Visual Prolog
Topic: Compiler warning/Calling from a parent class to a child class
Replies: 7
Views: 4420

So, applying the (perfectly explained!) support pattern to Peter's example, the code would look like below. Correct? Regards Martin interface reproduction predicates perform : (). properties type : string. end interface reproduction /****************************************************************/ ...
by Martin Meyer
11 Feb 2015 21:16
Forum: Visual Prolog
Topic: Compiler warning/Calling from a parent class to a child class
Replies: 7
Views: 4420

Hi Peter, in below code the compiler will throw errors, when implementing the property type in class reproduction is forgotten. Regards, Martin interface reproduction_support predicates perform:(). end interface reproduction_support class reproduction_support:reproduction_support end class implement...
by Martin Meyer
30 Jan 2015 21:33
Forum: Visual Prolog
Topic: Predicate Constant
Replies: 14
Views: 7191

No problem, with next release will be also fine.

Many regards
Martin
by Martin Meyer
30 Jan 2015 15:30
Forum: Visual Prolog
Topic: Predicate Constant
Replies: 14
Views: 7191

In the new features list http://wiki.visual-prolog.com/index.php?title=New_Features_in_Visual_Prolog_7.5#Build_7501 I see an entry "Problem with predicate constants". But when I try to replace the class fact from the example by constants personIdSet_union : function{personIdSet PersonIdSetA, personI...
by Martin Meyer
30 Jan 2015 15:00
Forum: Visual Prolog
Topic: Generic predicates
Replies: 6
Views: 4450

Hi Peter, why do you want to have two (or even more) predicates get_text and get_sheet resp. try_text and try_sheet at all, rather than better using respectively one, which serves all purposes by means of polymorphism? It can be done like in below code. Regards Martin interface folder{@Type} predica...