Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!orion.oac.uci.edu!eaiu088 From: eaiu088@orion.oac.uci.edu (Alisa Tannirat) Newsgroups: comp.lang.prolog Subject: taking a predicate name as an argument Message-ID: <2624D004.805@orion.oac.uci.edu> Date: 12 Apr 90 18:59:15 GMT References: <35047@brunix.UUCP> Reply-To: eaiu088@orion.oac.uci.edu (Alisa Tannirat) Organization: UC Irvine Department of ICS Lines: 18 how do i take a predicate name as an argument and use it as a basis for selecting an operation on the other arguments? for example, question(+, X, Y, Answer):- Answer is X + Y. question(*, X, Y, Answer):- Answer is X * Y i would like question to be general enough to take any operator and perform it on X and Y resulting in Answer. please e-mail me, the information would be appreciated. alisa tannirat