aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorp4bl0 <r _at_ uzy .dot. me>2012-07-18 16:31:01 (CEST)
committerp4bl0 <r _at_ uzy .dot. me>2012-07-18 16:31:01 (CEST)
commitda70b0284e7bc6af37da7dd4868f80d460042315 (patch)
tree363de2505feb49fb7dd57377ae3d900ed279ea56
parent84c077f73b641847527772f181a9bc857e5bb346 (diff)
downloadelispon-master.zip
elispon-master.tar.gz
refactoring unwrapHEADmaster
-rw-r--r--lib/stdlib.lpn26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/stdlib.lpn b/lib/stdlib.lpn
index f2c7589..6b044eb 100644
--- a/lib/stdlib.lpn
+++ b/lib/stdlib.lpn
@@ -23,19 +23,6 @@
(vau arguments env
(apply fexpr (eval (cons list arguments) env))))))))
-(define unwrap
- (vau args e
- (if (not (= (length args) 1))
- (error "unwrap: expecped 1 argument")
- (sequence
- (define app (eval (car args) e))
- (if (not (fexpr? app))
- (error "unwrap: expected fexpr")
- (sequence
- (define fexpr (%open-fexpr% app))
- (eval (car (cdr (car (cdr (cdr (car fexpr))))))
- (cdr fexpr))))))))
-
(define lambda
(vau args e
(wrap (eval (list vau (car args) (quote _) (car (cdr args))) e))))
@@ -57,6 +44,19 @@
(define cddar (lambda expr (cdr (cdr (car (car expr))))))
(define cdddr (lambda expr (cdr (cdr (cdr (car expr))))))
+(define unwrap
+ (vau args e
+ (if (not (= (length args) 1))
+ (error "unwrap: expecped 1 argument")
+ (sequence
+ (define app (eval (car args) e))
+ (if (not (fexpr? app))
+ (error "unwrap: expected fexpr")
+ (sequence
+ (define fexpr (%open-fexpr% app))
+ (eval (cadar (cddar fexpr))
+ (cdr fexpr))))))))
+
(define and
(vau args e
(if (null? args)
Pablo Rauzy — generated by cgit