Skip to content

syntax_error incomplete_reduction read_term #1930

Answered by pmoura
mvolkmann asked this question in Q&A
Discussion options

You must be logged in to vote

Standard compliant and thus more portable (also better style):

eval(Operator, L, R, Result) :-
  (    Operator == (+) -> Result is L + R
  ;    Operator == (-) -> Result is L - R
  ;    fail
  ).

Replies: 2 comments 17 replies

Comment options

You must be logged in to vote
2 replies
@mvolkmann
Comment options

@mvolkmann
Comment options

Comment options

You must be logged in to vote
15 replies
@mvolkmann
Comment options

@triska
Comment options

@mvolkmann
Comment options

@triska
Comment options

@mvolkmann
Comment options

Answer selected by mvolkmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants