#16 Different behaviour of "+" and "*"

open
nobody
None
5
2012-09-16
2006-06-23
Anonymous
No

When I consult term
s(+,X,0,X).
I get error message:

"SYNTAX ERROR:
ubc.cs.JLog.Parser.SyntaxErrorException: Expected ')'
at 5 : line,char(1,5)"

Same for "-" sign.

BUT NO error for signs "*" and "/"

Regards,
matejickaj (signAT) gmail (signDOT) com

Discussion

  • Glendon Holst
    Glendon Holst
    2006-06-24

    Logged In: YES
    user_id=436806

    This is a bug in the parser. The difference is that + and - are also unary
    operators, while * and / are only binary.

    This is an issue in lists as well as parentheses, e.g.: L = ['+', a] or L=(+,a).

    A work around is to enclose symbols which are unary operators in
    parentheses if an atom is desired.

    e.g.:

    L=[(+),a].
    L=((+),a).