summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-07-15 19:34:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-07-15 19:34:44 -0700
commitf0874f294b1d70e9e4a9ac79a16788f286755c40 (patch)
treec27a73bf1bd09a1346c4188ed7f9c7ca32d7bedc /stdlib
parentc30b2adac82ee1922883551363874779b0083d83 (diff)
downloadtxr-f0874f294b1d70e9e4a9ac79a16788f286755c40.tar.gz
txr-f0874f294b1d70e9e4a9ac79a16788f286755c40.tar.bz2
txr-f0874f294b1d70e9e4a9ac79a16788f286755c40.zip
compiler: move material into constfun.tl
* stdlib/compiler.tl (%effect-free-funs%, %effect-free%, %functional-funs%, %functional%): Move variables into stdlib/constfun.tl * stdlib/constfun.tl %effect-free-funs%, %effect-free%, %functional-funs%, %functional%): Moved here. * stdlib/optimize.tl: Use load-for to express dependency on constfun module; don't depend on the compiler having loaded it.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/compiler.tl30
-rw-r--r--stdlib/constfun.tl30
-rw-r--r--stdlib/optimize.tl2
3 files changed, 32 insertions, 30 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index 8e8ba3c0..df54ba33 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -331,36 +331,6 @@
(defvarl %bin-op% (relate %nary-ops% %bin-ops% nil))
-(defvarl %effect-free-funs%
- '(append append* revappend list list* zip interpose copy-list reverse
- flatten flatten* flatcar flatcar* tuples remq remql remqual
- keepq keepq keepqual remq* remql* remq* make-sym gensym
- mkstring copy-str upcase-str downcase-str cat-str split-str spl
- split-str-set sspl tok-str tok tok-where list-str trim-str
- get-lines lazy-str length-str-> length-str->= length-str-<
- length-str-<= vector vec vector-list list-vector list-vec
- copy-vec sub-vec cat-vec acons acons-new aconsql-new alist-remove
- copy-cons copy-tree copy-alist plist-to-alist improper-plist-to-alist
- merge sort shuffle list-seq vec-seq str-seq copy sub seq-begin
- iter-begin rcons make-like nullify symbol-value symbol-function
- symbol-macro boundp fboundp mboundp special-operator-p special-var-p
- copy-fun func-get-form func-get-name func-get-env functionp
- interp-fun-p vm-fun-p fun-fixparam-count fun-optparam-count
- fun-variadic sys:ctx-form sys:ctx-name range range* rlist rlist*
- repeat pad weave promisep rperm perm comb rcomb source-loc
- source-loc-str macro-ancestor cptr-int cptr-obj cptr-buf
- int-cptr cptrp cptr-type cptr-size-hint))
-
-(defvarl %effect-free% (hash-uni %const-foldable%
- (hash-list %effect-free-funs% :eq-based)))
-
-
-(defvarl %functional-funs%
- '(chain chand juxt andf orf notf iff iffi dup flipargs if or and
- progn prog1 prog2 retf apf ipf callf mapf tf umethod uslot))
-
-(defvarl %functional% (hash-list %functional-funs% :eq-based))
-
(defvarl assumed-fun)
(defvar *in-compilation-unit* nil)
diff --git a/stdlib/constfun.tl b/stdlib/constfun.tl
index 0f66ac41..143ecbb0 100644
--- a/stdlib/constfun.tl
+++ b/stdlib/constfun.tl
@@ -61,3 +61,33 @@
rangep from to in-range in-range* nullify))
(defvarl %const-foldable% (hash-list %const-foldable-funs% :eq-based))
+
+(defvarl %effect-free-funs%
+ '(append append* revappend list list* zip interpose copy-list reverse
+ flatten flatten* flatcar flatcar* tuples remq remql remqual
+ keepq keepq keepqual remq* remql* remq* make-sym gensym
+ mkstring copy-str upcase-str downcase-str cat-str split-str spl
+ split-str-set sspl tok-str tok tok-where list-str trim-str
+ get-lines lazy-str length-str-> length-str->= length-str-<
+ length-str-<= vector vec vector-list list-vector list-vec
+ copy-vec sub-vec cat-vec acons acons-new aconsql-new alist-remove
+ copy-cons copy-tree copy-alist plist-to-alist improper-plist-to-alist
+ merge sort shuffle list-seq vec-seq str-seq copy sub seq-begin
+ iter-begin rcons make-like nullify symbol-value symbol-function
+ symbol-macro boundp fboundp mboundp special-operator-p special-var-p
+ copy-fun func-get-form func-get-name func-get-env functionp
+ interp-fun-p vm-fun-p fun-fixparam-count fun-optparam-count
+ fun-variadic sys:ctx-form sys:ctx-name range range* rlist rlist*
+ repeat pad weave promisep rperm perm comb rcomb source-loc
+ source-loc-str macro-ancestor cptr-int cptr-obj cptr-buf
+ int-cptr cptrp cptr-type cptr-size-hint))
+
+(defvarl %effect-free% (hash-uni %const-foldable%
+ (hash-list %effect-free-funs% :eq-based)))
+
+(defvarl %functional-funs%
+ '(chain chand juxt andf orf notf iff iffi dup flipargs if or and
+ progn prog1 prog2 retf apf ipf callf mapf tf umethod uslot))
+
+(defvarl %functional% (hash-list %functional-funs% :eq-based))
+
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl
index b6cbbb10..6ba0685e 100644
--- a/stdlib/optimize.tl
+++ b/stdlib/optimize.tl
@@ -25,6 +25,8 @@
;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
;; POSSIBILITY OF SUCH DAMAGE.
+(load-for (usr:var %const-foldable% "constfun"))
+
(compile-only
(defstruct live-info nil
(defined 0)