home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l210 / 1.ddi / ANSWERS.ARC / ANS_163.PRO < prev    next >
Encoding:
Prolog Source  |  1988-06-21  |  389 b   |  16 lines

  1. /*
  2.    Turbo Prolog 2.0, Answer to Exercise on page 163.
  3.    
  4.    Copyright (c) 1986, 88 by Borland International, Inc
  5. */
  6.  
  7. Predicates
  8.   count ( real )      % reals can be larger than integers
  9. Clauses
  10.   count(Number) :-
  11.       write(Number), nl ,
  12.       New_number = Number + 1 ,
  13.       count(New_number) ,
  14.       write("This added call makes this clause non-tail recursive!").
  15. Goal
  16.   count(1).