Page 1 of 1

Fact initialization with if/then/else

Posted: 22 Jan 2022 13:35
by Gukalov
Impossible to initialize a fact using if/then/else expression.
It works if decorate the expression to a function.

Code: Select all

implement justClass class facts     fact1 : unsigned := erroneous. facts     fact2 : unsigned := %        if isErroneous(fact1) then 100 else fact1 end if.    % error c150 : Syntax error         { = if isErroneous(fact1) then 100 else fact1 end if}().  % O'k end implement justClass   class justClass : justClass properties     fact1 : unsigned. end class justClass   interface justClass properties     fact2 : unsigned. end interface justClass
Is it right?

Thank you.

Re: Fact initialization with if/then/else

Posted: 24 Jan 2022 12:29
by Thomas Linder Puls
This problem does not exist in Visual Prolog 10.