A failing in a predicate in a list of re or ost conditions currently causes messages similar to one below to be displayed:
These exception messages could be made significantly more descriptive by allowing specific messages strings to be associated with each predicate in re and ost conditions.
Predicate functions and there associated messages strings could be specified as a pair of values in a map:
The following would then produce an error message as follows:
This would allow predicates without messages to specified alongside pairs of associated predicate message pairs as follows:
This change would not break any existing functionality and still allow for predicates to be predefined elsewhere in code.
As a result pre and post conditions could provide a natural means of further documenting the ins and outs of a function, simplify the process of providing meaningful output when developing libraries and perhaps make the language better suited to teaching environments
All Clojure platforms