]> Repositorios git - scryer-prolog.git/commit
ADDED: Support for higher-order non-terminals phrase//[2,3]
authorMarkus Triska <[email protected]>
Sat, 6 Jan 2024 08:21:22 +0000 (09:21 +0100)
committerMarkus Triska <[email protected]>
Sat, 6 Jan 2024 13:02:13 +0000 (14:02 +0100)
commite702fe5c686ae1ddf3936a557ed0cb816d5f344f
tree1a780f48682efc4fb3e496353952d33f4596e30b
parented92e1b4f44081f60b1785c9006b848b95f965d9
ADDED: Support for higher-order non-terminals phrase//[2,3]

These non-terminals take a grammar rule body and additional arguments
as arguments. These arguments are appended to the first argument.

A key motivation for the introduction of these non-terminals is found
in the discussion and sample code provided by @bakaq in:

    https://github.com/mthom/scryer-prolog/discussions/2260

In this way, portable higher-order DCG programming is possible while
keeping the logical grammar rule expansion implementation dependent.

Example:

    ?- phrase(phrase('.', a, []), Cs).
       Cs = "a".
src/lib/dcgs.pl