I really have better things to do than to respond to provocation, but here goes.
Richard has been advocating for ages the writing of steadfast predicates: he could be named the prophet of steadfastness. That does not mean that I have lost all vestiges of common sense. I repeat: I have advocated that *exported* predicates be steadfast.
So, when Richard writes in a public forum a predicate that does not look steadfast, he should expect remarks.
I was explicitly *sketching* an implementation of *one* predicate, namely between/3. It was obvious to any reader with kindergarten-level reading and conversational skills that between1/3 was part of that sketch. Some trouble was in fact taken to ensure that the predicate which was the topic of the message was steadfast.
# Bart, as usual, you make such fuzz out of nothing, but actually, # you are right, between_aux/3 is not steadfast. Here is a # steadfast version:
The thing is that for a predicate which is intended to be called in only one place, there is no *point* in adding overheads just to satisfy a criterion which isn't really relevant.
It never occurred to me that Bart Demoen was yanking my chain.
His second answer uses the "official definition of steadfastness". That definition was written at a moment that there was no standard about Prolog modules and where Prolog systems with modules typically allowed to bypass the intended hiding of non-exported predicates:
Well, no. between/3 goes back to DEC-10 Prolog. Now in old DEC-10 compiled Prolog a predicate really was not visible outside its module unless you explicitly said so. (Old DEC-10 Prolog basically had the "assembler" model of name control.) Unfortunately, the file system where I keep some of this stuff suddenly disappeared this morning, so I can't quote chapter and verse.
What is more, even when "The Craft of Prolog" was written, it was written in the context of Dave Bowen's XREF program (which he had adapted to Quintus Prolog), so that despite the module overriding that had been provided for the sake of the debugger, one could be quite sure that there were no *static* calls to a private predicate. (XREF goes back to DEC-10 Prolog.) To be sure, one could not be sure about dynamic calls using call/1 (although XREF did quite a good job of tracing those too), but then a dynamic call using call/1 could replace the entire module with anyone you please, as could a static call to compile/1.
One of the key steps that should have been required as part of the standardisation process for ISO Prolog (and even more so for ISO Prolog modules) is the production of a version of XREF (or XREF-like functionality) working with ISO syntax and semantics.
If I were rewriting The Craft of Prolog, I think that "how to use XREF" and "how to build an XREF" would not just deserve mention (as, to my regret, they were not mentioned), they would deserve an entire chapter. ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------