home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / prolog / 1560 < prev    next >
Encoding:
Text File  |  1992-08-19  |  2.0 KB  |  65 lines

  1. Newsgroups: comp.lang.prolog
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!sdd.hp.com!caen!umeecs!umn.edu!lynx!nmsu.edu!opus!ted
  3. From: ted@nmsu.edu (Ted Dunning)
  4. Subject: Re: SICStus Prolog singleton warnings slow down while consulting a file
  5. In-Reply-To: ken@aiai.ed.ac.uk's message of 18 Aug 92 17:16:03 GMT
  6. Message-ID: <TED.92Aug19112723@aeolia.nmsu.edu>
  7. Followup-To: comp.lang.prolog
  8. Sender: usenet@nmsu.edu
  9. Reply-To: ted@nmsu.edu
  10. Organization: Computing Research Lab
  11. References: <1992Aug17.172126.19111@watson.ibm.com> <5100@sersun1.essex.ac.uk>
  12.     <7240@skye.ed.ac.uk>
  13. Date: Wed, 19 Aug 1992 18:27:23 GMT
  14. Lines: 49
  15.  
  16.  
  17. In article <7240@skye.ed.ac.uk> ken@aiai.ed.ac.uk (Ken Johnson) writes:
  18.  
  19.    Path: nmsu.edu!lynx!umn.edu!umeecs!caen!uunet!mcsun!uknet!edcastle!aiai!ken
  20.    From: ken@aiai.ed.ac.uk (Ken Johnson)
  21.    Newsgroups: comp.lang.prolog
  22.    Keywords: singleton
  23.    Date: 18 Aug 92 17:16:03 GMT
  24.    References: <1992Aug17.172126.19111@watson.ibm.com> <5100@sersun1.essex.ac.uk>
  25.    Followup-To: comp.lang.prolog
  26.    Organization: Bugs-R-Us
  27.    Lines: 30
  28.  
  29.    In article <5100@sersun1.essex.ac.uk> palmm@essex.ac.uk (Palmer M J)
  30.    writes:
  31.  
  32.    #  Some systems (e.g.  Qunitus Prolog) allow you to use the form _VarName. 
  33.    #  This is still an anonymous variable but with a name.  You might like to
  34.    #  try this. 
  35.  
  36.    Forgive my pedantry, but (in Edinburgh Prolog) ocurrences of variables
  37.    with the same name are equal to each other, even if the name begins with
  38.    _.  So _A and _B, etc., are not anonymous variables.  The point is that
  39.    the singleton variable check is not applied to such variable names. 
  40.  
  41.  
  42. this isn't pedantry, it is error.  each occurence of _ *is* an
  43. anonymous variable.  it is true that _A is *not* anonymous.
  44.  
  45. for example:
  46.  
  47. Quintus Prolog Release 3.1.1 (Sun-4, SunOS 4.1)
  48. Copyright (C) 1990, Quintus Corporation.  All rights reserved.
  49. 2100 Geng Road, Palo Alto, California U.S.A. (415) 813-3800
  50.  
  51. | ?- [user].
  52. | diff(_,_).
  53. | diff2(_A,_A).
  54. % user compiled in module user, 0.033 sec 188 bytes
  55.  
  56. yes
  57. | ?- diff(2,3).
  58.  
  59. yes
  60. | ?- diff2(2,3).
  61.  
  62. no
  63. | ?- 
  64.