"Return" a value from a predicate?

I’m using: SWI-Prolog version 8.0.2.

I’ve noticed that some system predicates return values like a standard function in a procedural programming language. In other words, the system predicate can appear on the right hand side of an equal sign and therefore used in an assignment statement to a Prolog variable.

Is there a way to similarly “return” a value from a standard SWI-Prolog predicate?

Can you give us a few examples?

Note that the =/2 predicate unifies two terms. I.e. variables, like any Prolog term, are not assigned to but unified with. There’s no significance on one of terms being used “on the right (or left) hand side”.