Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "canny_tudor"

Title:Canny bag o' Tudor
Rating:Not rated. Create the first rating!
Latest version:0.23.2
SHA1 sum:fc3925649e51c2cf5f5b4d576e87dda3d67040d8
Author:Roy Ratcliffe <roy@ratcliffe.me>
Maintainer:Roy Ratcliffe <roy@ratcliffe.me>
Packager:Roy Ratcliffe <roy@ratcliffe.me>
Home page:https://github.com/royratcliffe/canny_tudor
Download URL:https://github.com/royratcliffe/canny_tudor/releases/*.zip

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.1.0972538681b383b3aa51e323912a799d586bcea021https://github.com/royratcliffe/canny_tudor/archive/0.1.0.zip
0.1.10de86729cdf68b11c6f1dede59128dfd9b1f98622https://github.com/royratcliffe/canny_tudor/archive/0.1.1.zip
0.2.1bf748222b9a30a1e872717c222aa9123256b5a9d1https://github.com/royratcliffe/canny_tudor/archive/0.2.1.zip
0.3.0401e5a4461f7217821646d17f17bab89e01688cd2https://github.com/royratcliffe/canny_tudor/archive/0.3.0.zip
0.4.044d4f525a891768529742afe68e1ad375ce7d7971https://github.com/royratcliffe/canny_tudor/archive/0.4.0.zip
0.5.0846e2ed85b7a0e2ccd30402013c552b37cd450772https://github.com/royratcliffe/canny_tudor/archive/0.5.0.zip
0.5.129bf47e95f0ae93cadd2a599c86a08334bf0b9f92https://github.com/royratcliffe/canny_tudor/archive/0.5.1.zip
0.5.2aa195a1ab5d7087a93918f0896ac126fa903a4041https://github.com/royratcliffe/canny_tudor/archive/0.5.2.zip
0.6.0a24acaf73a72763669636bab2945d289f33542cd2https://github.com/royratcliffe/canny_tudor/archive/0.6.0.zip
0.6.1a8da067ec518f18ecb497e49d8b7ef578577e6121https://github.com/royratcliffe/canny_tudor/archive/0.6.1.zip
0.7.03542f5de1d509e2696cfe88f3314f4b45222aed63https://github.com/royratcliffe/canny_tudor/archive/0.7.0.zip
0.12.0895bc0cb2ebfcff982b2529d90fae9b0da893ea03https://github.com/royratcliffe/canny_tudor/archive/0.12.0.zip
0.13.0774a6dc6692506a9d63f09718a58ead3415d321a2https://github.com/royratcliffe/canny_tudor/archive/0.13.0.zip
0.14.0dd3504e80e471db644aae3c377f97a00f478adaa1https://github.com/royratcliffe/canny_tudor/archive/0.14.0.zip
0.15.047d00bfc11bbd84feea297b88063cfd976e02b071https://github.com/royratcliffe/canny_tudor/archive/0.15.0.zip
0.16.05b2963c3a365bc992af83ca865c1935e4083ffd14https://github.com/royratcliffe/canny_tudor/archive/0.16.0.zip
0.17.0f3ac8010caa84d2f1f05038baf3c1b282e688b153https://github.com/royratcliffe/canny_tudor/archive/0.17.0.zip
0.18.0e3148480b65d12d03eacd428bab9e6e3e5f26ac738https://github.com/royratcliffe/canny_tudor/archive/0.18.0.zip
0.19.014455e5680283d8afeaa9186baf845ba7ec7b0c06https://github.com/royratcliffe/canny_tudor/archive/0.19.0.zip
0.19.11f3c9ca809c12ef358b45c53ea8cf827114a78dc2https://github.com/royratcliffe/canny_tudor/archive/0.19.1.zip
0.20.07da4e681c201a1116ed5e07a34621522277225a01https://github.com/royratcliffe/canny_tudor/archive/0.20.0.zip
0.21.0e65284c14903b91a762aa44a81c164a260ef063e1https://github.com/royratcliffe/canny_tudor/archive/0.21.0.zip
0.21.1d60f7d09bfc2298c4d8e6630b0cd7d9cbd4e3efb9https://github.com/royratcliffe/canny_tudor/archive/0.21.1.zip
0.22.0f3c82995fdea3953fb7faf899f3d984253ec458a1https://github.com/royratcliffe/canny_tudor/archive/0.22.0.zip
0.23.065225ba6aa0ba34a867093a8430e32011be2a82f1https://github.com/royratcliffe/canny_tudor/archive/0.23.0.zip
0.23.2fc3925649e51c2cf5f5b4d576e87dda3d67040d825https://github.com/royratcliffe/canny_tudor/archive/0.23.2.zip

Canny bag o' Tudor

!cov !fail

See PDF for details.

This is an experimental SWI-Prolog 'pack' comprising technical spikes, or otherwise useful, Prolog predicates that do not seem to fit anywhere else.

The package name reflects a mixed bag of bits and pieces. It's a phrase from the North-East corner of England, United Kingdom. 'Canny' means nice, or good. Tudor is a crisp (chip, in American) manufacturer. This pack comprises various unrelated predicates that may, or may not, be tasty; like crisps in a bag, the library sub-folders and module names delineate the disparate components. If the sub-modules grow to warrant a larger division, they can ultimately fork their own pack.

The pack currently includes:

  • Docker-style random names
  • Operating system-related features:
    • Search path manipulation
    • Start and stop, upping and downing apps
  • SWI-Prolog extensions for dictionaries and compounds The pack comprises experimental modules subject to change and revision due to its nature. The pack's major version will always remain 0. Work in progress!

Apps

You can start or stop an app.

app_start(App)
app_stop(App)

App is some compound that identifies which app to start and stop. You define an App using property_for_app/2 multi-file predicate. You must at least define an app's path using, as an example:

os:property_for_app(path(path(mspaint)), mspaint) :- !.

Note that the Path is a path Spec used by process_create/3, so can include a path-relative term as above. This is enough to launch the Microsoft Paint app on Windows. No need for arguments and options for this example. Starting a running app does not start a new instance. Rather, it succeeds for the existing instance. The green cut prevents unnecessary backtracking.

You can start and continuously restart apps using app_up/1, and subsequently shut them down with app_down/1.

Apps testing

On a Windows system, try the following for example. It launches Microsoft Paint. Exit the Paint app after app_up/1 below and it will relaunch automatically.

?- [library(os/apps), library(os/apps_testing)].
true.

?- app_up(mspaint).
true.

?- app_down(mspaint).
true.

SWI-Prolog extensions

This includes the following.

Non-deterministic `dict_member(?Dict, ?Member)`

This predicate offers an alternative approach to dictionary iteration in Prolog. It makes a dictionary expose its leaves as a list exposes its elements, one by one non-deterministically. It does not unify with non-leaves, as for empty dictionaries.

?- dict_member(a{b:c{d:e{f:g{h:i{j:999}}}}}, Key-Value).
Key = a^b/c^d/e^f/g^h/i^j,
Value = 999.

?- dict_member(Dict, a^b/c^d/e^f/g^h/i^j-999).
Dict = a{b:c{d:e{f:g{h:i{j:999}}}}}.

Contents of pack "canny_tudor"

Pack contains 98 files holding a total of 502K bytes.