Skip to content

1.0.13

Compare
Choose a tag to compare
@wouterbeek wouterbeek released this 28 Mar 20:13
· 31 commits to master since this release

1.0.13 (2021-03-28)

This release introduces support for creating simple command-line interfaces. The SWI-Prolog standard library includes a module called optparse, but is relatively complex and performs many exponential checks. Also, the here included support library is intended to be decomposed into reusable parts (e.g., calculating width-delimited text is part of string_ext). The command-line interface support is only an initial version currently, but the intention is to extended this over time.

Here follows the full list of changes:

call_ext

  • Renamed call_bool/2 to call_boolean/2. This is more consistent with the name of the Prolog type boolean.

cli, cli_arguments, cli_help, cli_version

  • Added a new module that makes it easy to write CLI tools.

dcg

  • Added dcg_char//1 for parsing/generating one single character.

  • Renamed dcg_bool//1 to dcg_pp_boolean//1. This is more consistent with the name of the Prolog type boolean, and indicates the pretty-print purpose better.

  • Added dcg_boolean//1 for parsing/generating Boolean values.

  • Added dcg_peek//1 which can be useful for simple debugging.

dict

  • Fixed instantiation (-, +, ?) of predicate dict_get/3.

print_ext

  • Renamed call_print_bool/1 to call_print_boolean/1 and renamed print_bool/1 to print_boolean/1. These are more consistent with the name of the Prolog type boolean.

rest-server

  • Removed http_server_init/1. It is better to use the SWI-Prolog standard library predicates for initialization an HTTP server instead.

string_ext

  • Added max_string_length/2 for calculating the length of the longest given string.

  • Added message_lines/3 and words_lines/[3,4] for generating width-delimited displays of text.