parentheses in DCG
I am started check how to use DCG and I was wondering what are parentheses
{} are used for, when I need it and when I don't ?
For example:
read_lines -->
{ read_line_to_codes(current_input, Codes) },
( { Codes == end_of_file } -> []
; { atom_codes(Line, Codes) },
[Line],
read_lines
).
This code is one of replies on that question: Avoid linear cost of
append/3 in Prolog
No comments:
Post a Comment