home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / prolog / 1559 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  1.4 KB

  1. Path: sparky!uunet!mcsun!uknet!keele!csa09
  2. From: csa09@seq1.keele.ac.uk (Paul Singleton)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: SICStus Prolog singleton warnings slow down while consulting a file
  5. Message-ID: <3840@keele.keele.ac.uk>
  6. Date: 19 Aug 92 11:32:21 GMT
  7. References: <1992Aug17.210426.14213@cs.sfu.ca>
  8. Organization: University of Keele, England
  9. Lines: 25
  10.  
  11. From article <1992Aug17.210426.14213@cs.sfu.ca>, by gregory@cs.sfu.ca (Gregory Sidebottom):
  12.  
  13. > Try starting your singlton variables with the underscore symbol.  This
  14. > tells the compiler that you know it's a singlton variable, even though
  15. > you want to give it a meaningful name.  So you can write:
  16. > p(_SomethingMeaningful).
  17. > and not get a warning in Sicstus.  But note that variables beginning
  18. > with an underscore are not anonymous--the two variable symbols in:
  19. > p(_X) :- q(_X).
  20. > denote the same variable. 
  21.  
  22. In which case the compiler ought to give a warning "Multiple occurences of
  23. a variable for which the singleton variable check has been suppressed'.
  24.  
  25. I suggest that such variables are known as "Singleton" variables as opposed
  26. to "singleton" variables ...
  27. ----
  28.   __   __    Paul Singleton (Mr)           JANET: paul@uk.ac.keele.cs
  29.  |__) (__    Computer Science Dept.        other: paul@cs.keele.ac.uk
  30.  |  .  __).  Keele University, Newcastle,    tel: +44 (0)782 621111 x7355
  31.              Staffs ST5 5BG, ENGLAND         fax: +44 (0)782 713082
  32.