Browse files

extract redefine-warning

  • Loading branch information...
1 parent d3dc5ee commit 721385b665faa06c6add6729af2208f194588a03 @awwx committed Jun 14, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 arc.arc
View
12 arc.arc
@@ -3,13 +3,17 @@
(assign do (annotate 'mac
(fn args `((fn () ,@args)))))
+(assign redefine-warning
+ (fn (var)
+ (if (bound var)
+ (do (ar-disp "*** redefining " (racket-current-error-port))
+ (ar-disp var (racket-current-error-port))
+ (ar-disp #\newline (racket-current-error-port))))))
+
(assign safeset
(annotate 'mac
(fn (var val)
- `(do (if (bound ',var)
- (do (ar-disp "*** redefining " (racket-current-error-port))
- (ar-disp ',var (racket-current-error-port))
- (ar-disp #\newline (racket-current-error-port))))
+ `(do (redefine-warning ',var)
(assign ,var ,val)))))
(assign assign-fn

0 comments on commit 721385b

Please sign in to comment.