Re: JESS: If else enhanced into Jess7.1
"Ernest Friedman-Hill" <[email protected]>
| Newsgroups | gmane.comp.java.jess |
|---|---|
| Message-ID | <[email protected]> |
Didn't we just answer this question the other day on this list? Yes, in older versions of Jess, that last "else" would be interpreted as one of the elements of the first "else" clause, and taking the "else" would execute both function calls. But Jess 7.1 parses if-then-else more carefully, and the repeated "else" is caught and reported as an error. On Sep 6, 2010, at 2:15 AM, [email protected] wrote: > > I observed a difference between 7.1 and 7.0 where an "if" can have > multiple "else" was not result an error into 7.0 but 7.1 can catch > this wrong block. Is this true or I have misunderstood the thing. > > Sample code : > > (if (> 5 9) then > > (printout t "Test -1 ") > > else > (printout t "Test -2 ") > else > (printout t "Test - 3 ") > ) > > In 7.0 the code results in :: Test-2 Test-3 > While 7.1 :: Exception in thread "main" Jess reported an error in > routine Jesp.Jesp.parseFuncall. > Message: No new blocks after 'else' block in 'if' at token 'else'. > > > Avdhesh DIXIT > Consultant Specialist | HSBC Technology and Services - Global > Technology > HSBC Software Development (India) Private Limited --------------------------------------------------------- Ernest Friedman-Hill Informatics & Decision Sciences, Sandia National Laboratories PO Box 969, MS 9012, Livermore, CA 94550 http://www.jessrules.com -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [email protected]' in the BODY of a message to [email protected], NOT to the list (use your own address!) List problems? Notify [email protected]. --------------------------------------------------------------------