Docs: document operator support (full prefix + infix; postfix unsupported by design) #31
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-prolog#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Document the operator model explicitly:
prlgsupports prefix andinfix operators, and postfix is not supported — by design. Users coming
from teaching texts (e.g. Clause and Effect) reasonably assume all three
fixities plus
op/3; the docs should set the boundary clearly.What to document
precedence and type (xfx/xfy/yfx, fy/fx), so users know exactly what parses.
compound:
2 + 3≡+(2, 3),- a≡-(a). Anything writable with anoperator is writable in functor notation.
postfix operators and none are planned. Rationale worth including:
X yfis just thecompound
yf(X); the term, and therefore everything unification/resolutionsees, is identical.
standard only defines the postfix types so a program could declare one
via
op/3.op/3(user-defined operators of any fixity) is also not supported, sothere is no path to a postfix operator at all.
-3folds to a negative number, not thecompound
-(3)(use- a/- Xfor prefix-as-term examples).Prerequisite
The "full prefix + infix" claim is only accurate once the operator table is
complete — currently blocked by:
+,\)** ^ >> << xor div /\ \/ :)Write the documentation to match the table after those land (or document the
current subset honestly in the meantime).
Context
Drives the
loglingsoperator chapter, where we teach prefix + infix asrunnable lessons and present postfix as "the language has it; this engine is a
deliberate subset" — so accurate engine docs let the curriculum cite them.
Reported against
prlg0.4.1.#35