Thread View: comp.lang.prolog
3 messages
3 total messages
Started by Takashi Chikayama
Thu, 07 Jan 1993 02:48
Why can't integers become principal functors?
Author: Takashi Chikayama
Date: Thu, 07 Jan 1993 02:48
Date: Thu, 07 Jan 1993 02:48
6 lines
742 bytes
742 bytes
Can somebody explain why integers cannot be the principal functor of non-atomic functors? Are there any theoretical reasons? Any implementational difficulties? Or just for compatibility with previous implementations? Takashi Chikayama
Re: Why can't integers become principal functors?
Author: Peter Van Roy
Date: Fri, 08 Jan 1993 12:54
Date: Fri, 08 Jan 1993 12:54
16 lines
1280 bytes
1280 bytes
In article <CHIK.93Jan7114812@ss38.icot.or.jp>, chik@icot.or.jp (Takashi Chikayama) writes: > Can somebody explain why integers cannot be the principal functor of > non-atomic functors? Are there any theoretical reasons? Any > implementational difficulties? Or just for compatibility with > previous implementations? > > Takashi Chikayama There is no fundamental reason why not. Maybe it was done because it was imagined it would make it easier to implement efficient arithmetic. As an example of the other approach, the LIFE language (and a fortiori the Wild_LIFE interpreter) allows numbers (and strings too) as main functors, since arguments may be attached to any sort, and numbers are sorts. Peter
Re: Why can't integers become principal functors?
Author: marques
Date: Thu, 21 Jan 1993 11:42
Date: Thu, 21 Jan 1993 11:42
30 lines
1885 bytes
1885 bytes
In article <CHIK.93Jan14104559@ss38.icot.or.jp>, chik@icot.or.jp (Takashi Chikayama) writes: > Thank you very much to those who responded to my question posted in > article <CHIK.93Jan7114812@ss38.icot.or.jp>. I'd like to thank you > all and summarize the responses here. > > My original question was: > >> Can somebody explain why integers cannot be the principal functor of >> non-atomic functors? Are there any theoretical reasons? Any >> implementational difficulties? Or just for compatibility with >> previous implementations? [Stuff removed] > Thank you again to all those who responded. > > Takashi Chikayama > ICOT A few years back I wrote a little prolog interpreter for my Commodore 64. Now it stored atom names in a hash table. Each entry in this table also had other pointers to the procedure corresponding to this name, the operator settings etc. Numbers were not stored in the hash table and this could explain why some implementations don't allow numbers, since under the above scheme there would be no way to get from the number to its procedures, or any other useful information that had to be common to all instances of the same number. Anyway my interpreter did support arbitary functor names, you could create something like f(f(a))(x, y) but you got an error if you tried to use it in call(). -- Jose Marques, Systems Programmer %INCLUDE STDDIS; /* Standard Disclaimer */
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads