Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make use-load overridable

  • Loading branch information...
commit 46d6d347eb70c5656c1fad8f06b179747ab3723b 1 parent 474b25a
@awwx awwx authored
View
1  ar.arc
@@ -31,6 +31,7 @@
(racket-hash-set! sig (racket-quote instring) (ar-toarc (racket-quote (str))))
(racket-hash-set! sig (racket-quote outstring) (ar-toarc (racket-quote ())))
(racket-hash-set! sig (racket-quote uniq) (ar-toarc (racket-quote ())))
+ (racket-hash-set! sig (racket-quote use-load) (ar-toarc (racket-quote (item))))
(racket-hash-set! sig (racket-quote ar-toarc) (ar-toarc (racket-quote (x))))
(racket-define-syntax-rule (ar-def name signature . body)
View
4 override-use-load-test-helper.arc
@@ -0,0 +1,4 @@
+(use arc)
+
+(defrule use-load (is item 'foo)
+ (prn "foo!"))
View
9 override-use-load.t
@@ -0,0 +1,9 @@
+(use test-by-example)
+
+(example-test (runtime '(override-use-load-test-helper)) #<<.
+
+> (use foo)
+prints: foo!\n
+
+.
+)
View
3  run
@@ -60,7 +60,8 @@
(begin
(if (eqv? (string-ref arg 0) #\-)
(do-option runtime arg)
- (do (lambda () (use-load runtime arg))))
+ (do (lambda ()
+ ((runtime-get runtime 'use-load) arg))))
(loop)))))))
(doit)
View
2  run.ss
@@ -25,7 +25,7 @@
(cdr form)))
((and (pair? form) (eq? (car form) 'use))
(for-each (lambda (item)
- (use-load runtime item))
+ ((runtime-get runtime 'use-load) item))
(cdr form)))
(else
(error "sorry, this primitive eval only knows how to do ail-code and use!" form))))
Please sign in to comment.
Something went wrong with that request. Please try again.