Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add :ns meta to more vars #604

Merged
merged 2 commits into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/sci/addons/future.clj
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
(ns sci.addons.future
{:no-doc true}
(:refer-clojure :exclude [future pmap])
(:require [sci.impl.namespaces :refer [copy-core-var core-var]])
(:require [sci.impl.vars :as vars]))

(def future* ^:sci/macro
(def future* ^{:sci/macro true
:ns vars/clojure-core-ns}
(fn [_ _ & body]
`(let [f# (~'binding-conveyor-fn (fn [] ~@body))]
(~'future-call f#))))
Expand Down Expand Up @@ -38,9 +40,9 @@
(update-in opts [:namespaces 'clojure.core]
assoc
'future future*
'future-call future-call
'future-cancel future-cancel
'future-cancelled? future-cancelled?
'future-done? future-done?
'future? future?
'pmap pmap))
'future-call (copy-core-var future-call)
'future-cancel (copy-core-var future-cancel)
'future-cancelled? (copy-core-var future-cancelled?)
'future-done? (copy-core-var future-done?)
'future? (copy-core-var future?)
'pmap (core-var 'pmap pmap)))
3 changes: 2 additions & 1 deletion src/sci/impl/opts.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
namespaces (-> namespaces
(update 'user assoc :aliases aliases)
(update 'clojure.core assoc 'global-hierarchy
(vars/->SciVar (make-hierarchy) 'global-hierarchy nil false)))
(vars/->SciVar (make-hierarchy) 'global-hierarchy
{:ns vars/clojure-core-ns} false)))
imports (if-let [env-imports (:imports env)]
(merge env-imports imports)
imports)]
Expand Down