Reading the manual

Hi, I just started playing with prolog yesterday (did a few sections in the excellent web tutorial - love those exercises, will try to finish it tonight!).

Today at work I realized that I had finished my sprint and I want to make a small code-review reminder tool, all it does is query the github repo I work on for open pull requests using the github API, then scan through those pull requests to see which reviewers have been requested and then uses the slack API to post reminders to a channel if I was requested for any of them.

If I make this a cron job and use curl then I’ve already finished the project, but I figured this would be a nice simple project to play with prolog and also has the potential to grow into a more featureful tool.

One of the first things I wanted to do was to read my github token from an environment variable. Simple enough, just use the command getenv, the manual describes it like this:

getenv (+Name, -Value)

Get environment variable. Fails silently if the variable does not exist. Please note that environment variable names are case-sensitive on Unix systems and case-insensitive on Windows.

Now I’ve been trying for a while to find some mention of what the + and the - are for, my suspicion is that it is something like an input vs output idea for the relation but I have found no mention anywhere of how to read the manual and would like to have some confirmation.

Thank you

1 Like

Your wish is my command. :wink:

See: Type, mode and determinism declaration headers and Notation of Predicate Descriptions

The keyword to remembering this is modes.

2 Likes