Should Ludus distinguish between functions and procedures? #98
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: twc/ludus#98
Loading…
Reference in New Issue
Block a user
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?
It seems like it's worth playing around with an enforced distinction between procedures and functions.
Functions would be exactly as written, with the exception that a function name cannot end in a bang. They would not be allowed to call procedures.
Procedures would be introduced by the
to
reserved word, and would be required to have a name that ends in a bang.This would be enforced as statically as possible; there would definitely be some runtime cost (but we incur that anyway, for most things).
Procedures could call other procedures and functions; functions could only call other functions.
A procedure call would have to come only at the end of a synthetic expression.
Procedure calls could only come: at the toplevel or in procedure definitions. And in those, they can only be bare lines in a block or in a terminal expression (
then
orelse
;match
orwhen
clauses, etc.).