Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Extend-your-language/EchoLisp/extend-your-language.l
Normal file
23
Task/Extend-your-language/EchoLisp/extend-your-language.l
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
(define-syntax-rule
|
||||
(if2 cond1 cond2 both cond1-only cond2-only none) ;; new syntax
|
||||
;; will expand to :
|
||||
(if cond1
|
||||
(if cond2 both cond1-only)
|
||||
(if cond2 cond2-only none)))
|
||||
→ #syntax:if2
|
||||
|
||||
(define (num-test n)
|
||||
(if2 (positive? n) (exact? n)
|
||||
"positive and exact"
|
||||
"positive and inexact"
|
||||
"negative and exact"
|
||||
"negative and inexact"))
|
||||
|
||||
(num-test 3/4)
|
||||
→ "positive and exact"
|
||||
(num-test -666)
|
||||
→ "negative and exact"
|
||||
(num-test -666.42)
|
||||
→ "negative and inexact"
|
||||
(num-test PI)
|
||||
→ "positive and inexact"
|
||||
Loading…
Add table
Add a link
Reference in a new issue