aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
authorEduardo Julian2017-06-23 19:50:21 -0400
committerEduardo Julian2017-06-23 19:50:21 -0400
commit6b04fc4a718b7eb40e72fdb02a8fa4f7cf4ea64a (patch)
treedad5d396a27aa6141f3377aa1a078b84f2fe42d0 /stdlib/source
parenta282228247fd1c9c50a082f38d147a47804a905f (diff)
- Renamed lux/control/contract's "@pre" and "@post" to "pre" and "post".
Diffstat (limited to 'stdlib/source')
-rw-r--r--stdlib/source/lux/control/contract.lux12
1 files changed, 6 insertions, 6 deletions
diff --git a/stdlib/source/lux/control/contract.lux b/stdlib/source/lux/control/contract.lux
index ddeed5ca5..ef46bcb19 100644
--- a/stdlib/source/lux/control/contract.lux
+++ b/stdlib/source/lux/control/contract.lux
@@ -12,23 +12,23 @@
[]
(error! message)))
-(syntax: #export (@pre test expr)
+(syntax: #export (pre test expr)
{#;doc (doc "Pre-conditions."
"Given a test and an expression to run, only runs the expression if the test passes."
"Otherwise, an error is raised."
- (@pre (i.= 4 (i.+ 2 2))
- (foo 123 456 789)))}
+ (pre (i.= 4 (i.+ 2 2))
+ (foo 123 456 789)))}
(wrap (list (` (exec (assert! (~ (code;text (format "Pre-condition failed: " (%code test))))
(~ test))
(~ expr))))))
-(syntax: #export (@post test expr)
+(syntax: #export (post test expr)
{#;doc (doc "Post-conditions."
"Given a predicate and an expression to run, evaluates the expression and then tests the output with the predicate."
"If the predicate returns true, returns the value of the expression."
"Otherwise, an error is raised."
- (@post i.even?
- (i.+ 2 2)))}
+ (post i.even?
+ (i.+ 2 2)))}
(do @
[g!output (macro;gensym "")]
(wrap (list (` (let [(~ g!output) (~ expr)]