home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / prolog / 2424 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  1.8 KB

  1. Path: sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!oxuniv!marques
  2. From: marques@vax.oxford.ac.uk
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: Why can't integers become principal functors?
  5. Message-ID: <1993Jan21.114237.11426@vax.oxford.ac.uk>
  6. Date: 21 Jan 93 11:42:37 GMT
  7. References: <CHIK.93Jan7114812@ss38.icot.or.jp> <CHIK.93Jan14104559@ss38.icot.or.jp>
  8. Distribution: comp
  9. Organization: Oxford University Library Automation Team
  10. Lines: 30
  11.  
  12. In article <CHIK.93Jan14104559@ss38.icot.or.jp>, chik@icot.or.jp (Takashi Chikayama) writes:
  13. > Thank you very much to those who responded to my question posted in
  14. > article <CHIK.93Jan7114812@ss38.icot.or.jp>.  I'd like to thank you
  15. > all and summarize the responses here.
  16. > My original question was:
  17. >> Can somebody explain why integers cannot be the principal functor of
  18. >> non-atomic functors?  Are there any theoretical reasons?  Any
  19. >> implementational difficulties?  Or just for compatibility with
  20. >> previous implementations?
  21. [Stuff removed]
  22. > Thank you again to all those who responded.
  23. > Takashi Chikayama
  24. > ICOT
  25.  
  26. A few years back I wrote a little prolog interpreter for my Commodore 64.
  27. Now it stored atom names in a hash table.  Each entry in this table also 
  28. had other pointers to the procedure corresponding to this name, the operator
  29. settings etc.  Numbers were not stored in the hash table and this could
  30. explain why some implementations don't allow numbers, since under the above
  31. scheme there would be no way to get from the number to its procedures, or
  32. any other useful information that had to be common to all instances of the same
  33. number.  Anyway my interpreter did support arbitary functor names, you
  34. could create something like f(f(a))(x, y) but you got an error if you tried
  35. to use it in call().
  36. -- 
  37. Jose Marques, Systems Programmer
  38.  %INCLUDE STDDIS; /* Standard Disclaimer */
  39.