From the hub, in category: "Development Practices"

A dependable term-expansion mechanism

This post is external to PrologHub

Logtalk provides a dependable term-expansion mechanism that gives the user full and fine-grained control on if, when, and how expansions are applied. This is accomplished by introducing the concept of hook object and by allowing expansion rules to be defined and applied without relying on multifile predicates.

A hook object is simply an ...


Meta-messages for lazy coders

This post is external to PrologHub

One of the frequent excuses for coders to avoid using the message printing mechanism is that they require defining tokenization rules for the messages and that is too much work when they can just call write/1 instead. We can try to argue about laziness but the coders do have a point. To easy the pain of using the message printing mechanism ...


Localizing an application for multiple languages

This post is external to PrologHub

Applications often need to be localized in multiple natural languages. Textual elements of an application user interface such as banners, messages, and questions should use the native language of the user. The best practice in this case is to decouple the application core logic from the natural language used when interacting with the user. Customizing the application for additional natural languages should be ...


A category at the top

This post is external to PrologHub

Logtalk supports both prototypes and classes/instances. While classes and instances provide a clear distinction between abstractions and materializations of those abstractions, prototypes are usually used to represent concrete, one of a kind entities. But prototypes can also be derived...


Object and predicate aliases

This post is external to PrologHub

Naming is a non-trivial problem in programming. A good name conveys meaning, contributing to code readability. But there’s always a natural contention between descriptive names and concise names that help avoid excess verbosity. What’s a good name may also depend on its usage context. Moreover, if every library developer always use ...


The cost of defaulty representations

This post is external to PrologHub

Logic programming applications that acquire and process external data are common. We don’t always have a choice on the format of the data during acquisition. But we can often decide how to represent the data internally. Our data representation choices can have a significant performance impact. To illustrate ...


Generating code coverage reports

This post is external to PrologHub

You wrote a set of tests for your project and all pass. Time to celebrate? Well, depends. How good is your tests code coverage? Are all predicates being called? Are all predicate clauses being tried? How do you know? If you answer is akin to “by visual inspection”, you may be in trouble. Will you be able to ...