For Programmers: Free Programming Magazines  


Home > Archive > Prolog > February 2005 > Re: List cons functor (was Re: The meaning of module overriding syntax mod:goal in di









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: List cons functor (was Re: The meaning of module overriding syntax mod:goal in di
Brian Hulley

2005-02-28, 3:59 pm

I think most existing code could quite easily be changed to use '[|]'/2
for lists since when the '.'/2 functor is used explicitly in existing
code it is always quoted, so perhaps a search-and-replace for '.'( with
'[|]'( would suffice to port most existing code (except for cases where
lists are being broken apart with =.. and the functor explicitly
compared with '.' ....)

Or perhaps there could be an option such as that used in C++ compilers
to specify whether to use K&R or Ansi scoping for the variable in a for
loop.

There would probably also have to be a convention for the term reader
such as "if the whitespace after the full stop contains a new line
character then the full stop is a terminator else it is treated like
any other atom" so that

a :- b . c . d.
e.

would be parsed as 2 clauses not one clause. (This kind of convention
is similar to the way that the functor atom has to be directly "glued"
onto the opening bracket for a compound term with no whitespace in
between.)

Cheers - Brian.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com