Skip to content

Commit

Permalink
rename use-load to use-apply
Browse files Browse the repository at this point in the history
  • Loading branch information
awwx committed Jul 8, 2011
1 parent 30bcb15 commit 2129a6d
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions ar.arc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +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 use-apply) (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)
Expand Down Expand Up @@ -402,7 +402,7 @@
(ar-def ac-use (items)
(cons (racket-quote racket-begin)
(map1 (racket-lambda (item)
(cons (racket-quote use-load)
(cons (racket-quote use-apply)
(list (list (racket-quote racket-quote)
item))))
items)))
Expand Down
2 changes: 1 addition & 1 deletion fninfo.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(let r (runtime '())
(= r!arcdir* arcdir*)
(r!use-load 'fninfo)
(r!use-apply 'fninfo)
(example-test r #<<.

> (fn-args isa)
Expand Down
4 changes: 4 additions & 0 deletions override-use-apply-test-helper.arc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(use arc)

(defrule use-apply (is item 'foo)
(prn "foo!"))
9 changes: 9 additions & 0 deletions override-use-apply.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(use test-by-example)

(example-test (runtime '(override-use-apply-test-helper)) #<<.
> (use foo)
prints: foo!\n
.
)
4 changes: 0 additions & 4 deletions override-use-load-test-helper.arc

This file was deleted.

9 changes: 0 additions & 9 deletions override-use-load.t

This file was deleted.

2 changes: 1 addition & 1 deletion run
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
(if (eqv? (string-ref arg 0) #\-)
(do-option runtime arg)
(do (lambda ()
((runtime-get runtime 'use-load) arg))))
((runtime-get runtime 'use-apply) arg))))
(loop)))))))

(doit)
12 changes: 6 additions & 6 deletions run.ss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(cdr form)))
((and (pair? form) (eq? (car form) 'use))
(for-each (lambda (item)
((runtime-get runtime 'use-load) item))
((runtime-get runtime 'use-apply) item))
(cdr form)))
(else
(error "sorry, this primitive eval only knows how to do ail-code and use!" form))))
Expand Down Expand Up @@ -111,12 +111,12 @@
(and (<= (string-length pat) (string-length str))
(equal? (substring str 0 (string-length pat)) pat)))

(define (use-load runtime item)
(define (use-apply runtime item)
(let ((loaded* (runtime-get runtime 'loaded*))
(usepath* (runtime-get runtime 'usepath*)))
(cond ((begins (asstring item) "git:")
(use-load runtime 'use-git)
((runtime-get runtime 'use-load) item))
(use-apply runtime 'use-git)
((runtime-get runtime 'use-apply) item))
((adir (asstring item))
(add-usepath runtime (asstring item)))
(else
Expand Down Expand Up @@ -146,8 +146,8 @@
(lambda (name value)
(runtime-set runtime name value)))
(runtime-set runtime 'load (lambda (filename) (ail-load runtime filename)))
(runtime-set runtime 'use-load (lambda (item)
(use-load runtime item)))
(runtime-set runtime 'use-apply (lambda (item)
(use-apply runtime item)))
(runtime-set runtime 'loadin (lambda (in)
(loadin runtime in)))
(runtime-set runtime 'add-usepath
Expand Down
2 changes: 1 addition & 1 deletion runtime.arc
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
(def runtime ((o uses) (o usepath (usepath*)))
(let runtime (new-runtime usepath)
(each item uses
(runtime!use-load item))
(runtime!use-apply item))
runtime))
2 changes: 1 addition & 1 deletion use-git.arc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(use git)

(defrule use-load (parse-git-spec item)
(defrule use-apply (parse-git-spec item)
(usepath* (cons (git-repo it) (usepath*))))

0 comments on commit 2129a6d

Please sign in to comment.