[m-users.] DCGs: equivalent of Prolog's phrase/2 and phrase/3 predicates?

Volker Wysk post at volker-wysk.de
Sun May 9 02:03:26 AEST 2021


Am Samstag, den 08.05.2021, 16:58 +0100 schrieb Sean Charles
(emacstheviking):
> Before setting off to the tattoo parlour I made one small change to keep it more ‘DCG’, I removed {true} and put in [] instead./..
> 
> skip_ws -->
>     ( if   ([' '];['\t'])
>       then skip_ws
>       else []
>     ).
> 
> Nice work though!

The effect of Prolog-cuts can often be achieved with if-then-else.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20210508/6fd2c512/attachment.sig>


More information about the users mailing list