4 ms·
> Please just let me end rules with a trailing comma instead of a period, I'm begging you. The reason Prolog doesn't support trailing commas is exactly the sam
by cbarrick 9mo ago
> Please just let me end rules with a trailing comma instead of a period, I'm begging you.
The reason Prolog doesn't support trailing commas is exactly the same reason JSON doesn't support trailing commas: the language is designed to be parsed by an operator precedence parser, and the comma is an infix operator.
The fact that Prolog is a purely operator precedence syntax, with a dynamic operator table, allows you to build DSLs embedded in Prolog. CLP(FD) uses this to create the #= operator.
- usgroup 9mo agoGenerally speaking, Prolog syntax is ridiculously simple and uniform. Its pattern matching is the most universal of any programming language partly because of this.