Re: Ann: SWI-Prolog 7.1.0

"Richard A. O'Keefe" <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 7/12/2013, at 10:54 PM, Jan Wielemaker wrote:
> 
> All true.  Just, Prolog systems can also nicely generate a switch-on-tag
> from code such as
> 
> do(X) :- atom(X), ....
> do(X) :- number(X), ...
> do(X) :- string(X), ...

Some can, some can't, some could but don't.
For what it's worth, in Xerox Quintus Prolog, numbers (other
than immediate integers) and strings had the *same* tag.

> 
> etc.  Properly implemented, the above should be faster than code like this
> 
> do(atom(X)) :-
> do(number(X)) :-
> do(string(X)) :-

That's *if* the distinctions you want to make are aligned
with Prolog built-in types.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.