--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.
PS: are you using the PlUnit package for testing? I guess this is one way to test the "internal" predicates.
On Thu, Jan 25, 2018 at 1:19 PM, Dan <gros...@gmail.com> wrote:
Hi all,Thank you.Perhaps for the testing code, exposing the internal predicate via explicit qualification is good enough.While "real" client code, is not "allowed" to do this ...Although, it does leave a "bad taste" since the purpose of testing is to ensure that the code works as expected, which includes, testing it in the manner its packaged as well.Dan
On Thursday, 25 January 2018 12:13:29 UTC+2, Dan wrote:Hi,I'd like to expose more than one (type) of interface for a module, and thereby more selectively allow importing predicates.For example, for testing, i want to expose lower level, "internal" predicates, and for regular use, only higher level ones?I guess, one simple approach is to split each module into two -- low-level predicates and higher-level predicates, and then expose both to the testing and only one to the client.Dan
--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
> send an email to swi-prolog+unsubscribe@googlegroups.com
> <mailto:swi-prolog+unsubscribe...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/swi-prolog
> <https://groups.google.com/group/swi-prolog>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+unsubscribe@googlegroups.com
> <mailto:swi-prolog+unsubscribe@googlegroups.com>.
--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.
Hi,
> On 26 Jan 2018, at 03:54, Peter Ludemann <peter.l...@gmail.com> wrote:
>
> Python seems to do fine with a convention that names staring with "_" are internal and other names are external (with a further convention that lists the names you get if you do an "import *"). (The "pylint" tool will complain if you access an internal name from another module.)
On the other hand, Prolog compilers (in general) are too permissive and often let the user get away with practices that are at best questionable. Calling a non-exported predicate using explicit qualification is one of them.
> The idea is that if you use an internal name, you have no right to complain if it changes or disappears. Similarly, for Prolog, if you use a predicate that's not listed as exported (by using the module:predicate form), you have no right to complain. Why would you need anything stronger?
That's a slippery slop. It may work for solo code warriors. Or for applications where a single individual can be aware all the details. I.e. when programming in the small. But in organizations with several developers, where new ones are hired and older ones move out but complex applications must be kept running, enforcing sane practices, including not breaking encapsulation boundaries, is a most. Of course, the availability and quality of tools make a difference.
Cheers,
Paulo
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.