2 ms·
Yes, I do like the fact that Prolog infix operators are just optional sugar for standard prefix definitions. In talking against separators, in "Prolog-derived"
by white-flame 9y ago
Yes, I do like the fact that Prolog infix operators are just optional sugar for standard prefix definitions.
In talking against separators, in "Prolog-derived" languages like Erlang (and other custom derivations I've dealt with), separators are used even between clauses. Most other languages use separators just for fields, and use straight terminators for statements. Prolog itself gets a pass because these separators are literally ANDs and ORs which flow as logical expressions through the backtracking search.
Even toplevel expressions defining different match parameters for the same head require differentiating separators from a final terminator for that head in Erlang, whereas Prolog just deals with independently terminated head matches just fine. The Erlang code is much more removed from a logical AND/OR flow into more standard programming models, yet is still separator-based. Instead of thinking of the logical, partial evaluation possibilities of
x AND y AND z
it's a more traditional
statement 1,
statement 2,
statement 3.
with inconsistent characters at the end of each statement, when looking at it from a statement-centric point of view. Editing such code always requires a scan of the context of inter-statement relationship (especially when nesting) instead of just treating & terminating statements independently.
- zmonx 9y agoI agree, thank you for the clarification and additional examples!