Skip to content

Commit

Permalink
implement: config key num-cached-cuis
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhhk committed Mar 30, 2021
1 parent 8eb5c63 commit fb57c95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions medikanren/common.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@
(map (lambda (name)
(define path (path/data (symbol->string name)))
(define options (list (config-ref 'in-memory-names?)
(config-ref 'in-memory-cuis?)))
(config-ref 'in-memory-cuis?)
(config-ref 'num-cached-cuis)))
(cond ((directory-exists? path)
(when verbose? (printf "loading ~a\n" name))
(cons name (if verbose?
(time (apply make-db path options))
(apply make-db path options))))
(time (apply make-db (cons path options)))
(apply make-db (cons path options)))))
(else (when verbose?
(printf "cannot load ~a; " name)
(printf "directory missing: ~a\n" path))
Expand Down
1 change: 1 addition & 0 deletions medikanren/config.defaults.scm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

(in-memory-names? . #t)
(in-memory-cuis? . #t)
(num-cached-cuis . #f)

(query-results.write-to-file? . #t) ;; #t will write the query and results to file, #f will not
(query-results.file-name . "last.sx")
Expand Down
2 changes: 1 addition & 1 deletion medikanren/db.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
;; category*, predicate*

;; memory-usage: 0 1 2 3
(define (make-db db-dir (in-memory-names? #t) (in-memory-cuis? #t))
(define (make-db db-dir (in-memory-names? #t) (in-memory-cuis? #t) (num-cached-cuis #f))
(define (db-path fname) (expand-user-path (build-path db-dir fname)))
(define (open-db-path fname) (open-input-file (db-path fname)))
(define (open-db-path/optional fname)
Expand Down

0 comments on commit fb57c95

Please sign in to comment.