Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!uw-beaver!Teknowledge.COM!unix!unix.sri.com!dowding From: dowding@ai.sri.com (John Dowding) Newsgroups: comp.lang.prolog Subject: Compiler smartness? Message-ID: Date: 16 Nov 90 22:01:50 GMT Sender: news@unix.SRI.COM Distribution: comp Organization: SRI International, Menlo Park, CA Lines: 29 I was poking around in some old code, and came across the following clauses (names changed to protect the inocent): foo(Term, Term):- (var(Term) ; atomic(Term)), !. foo([Head|Tail], Result):- ... I was wondering if the following is more efficient: foo(Term, Term):- var(Term), !. foo(Term, Term):- atomic(Term), !. foo([Head|Tail], Result):- ... Are Prolog compilers (particularly, Quintus version 2.4) smart enough index correctly on the 1st argument in either or both of these cases? Thanks, John Dowding dowding@ai.sri.com