# HG changeset patch # User naryl # Date 2020-06-25 18:37:18 # Node ID a55235088b4ee1fe1936c680215cf91122df5c13 # Parent 42f159727584140277fce409075eee9920feacb0 Actually fix it diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -17,10 +17,6 @@ graphs: diagrams.png $(DIST): $(BIN) extras/* tar cfvJ $@ $< extras -upload: $(DIST) - curl --upload-file $(DIST) https://transfer.sh/$(DIST) - @echo - clean: rm -f $(BIN) $(DIST) @@ -29,4 +25,4 @@ clean-cache: fresh: clean clean-cache all -.PHONY: all graphs upload clean clean-cache fresh +.PHONY: all graphs clean clean-cache fresh diff --git a/src/api.ps b/src/api.ps --- a/src/api.ps +++ b/src/api.ps @@ -1,5 +1,5 @@ -(in-package txt2web) +(in-package txt2web.api) ;;; API deals with DOM manipulation and some bookkeeping for the ;;; intrinsics, namely variables @@ -212,12 +212,10 @@ ;;; "Syntax" (defun qspfor (name index from to step body) - (ps:for ((i from)) - ((< i to)) - ((incf i step)) - (set-var name index :num i) - (unless (await (funcall body)) - (return-from qspfor)))) + (loop :for i :from from :to to :by step + :do (set-var name index :num i) + :do (unless (await (funcall body)) + (return-from qspfor)))) ;;; Variables diff --git a/src/intrinsics.ps b/src/intrinsics.ps --- a/src/intrinsics.ps +++ b/src/intrinsics.ps @@ -1,5 +1,5 @@ -(in-package txt2web) +(in-package txt2web.lib) ;;;; Functions and procedures defined by the QSP language. ;;;; They can call api and deal with locations and other data directly. @@ -45,27 +45,27 @@ (api:var-real-name to) (multiple-value-bind (from-name from-slot) (api:var-real-name from) - (for ((i start)) - ((< i (min (api:array-size from-name) - (+ start count)))) - ((incf i)) - (api:set-var to-name (+ start i) to-slot - (api:get-var from-name (+ start i) from-slot)))))) + (loop :for i :from start :to (min (api:array-size from-name) + (+ start count)) + :do (api:set-var to-name (+ start i) to-slot + (api:get-var from-name (+ start i) from-slot)))))) (defun arrpos (name value &optional (start 0)) (multiple-value-bind (real-name slot) (api:var-real-name name) - (for ((i start)) ((< i (api:array-size name))) ((incf i)) - (when (eq (api:get-var real-name i slot) value) - (return-from arrpos i)))) + (loop :for i :from start :to (api:array-size name) + :do (when (eq (api:get-var real-name i slot) value) + (return-from arrpos i)))) -1) (defun arrcomp (name pattern &optional (start 0)) (multiple-value-bind (real-name slot) (api:var-real-name name) - (for ((i start)) ((< i (api:array-size name))) ((incf i)) - (when (funcall (getprop (api:get-var real-name i slot) 'match) pattern) - (return-from arrcomp i)))) + (loop :for i :from start :to (api:array-size name) + :do (when (funcall (getprop (api:get-var real-name i slot) + 'match) + pattern) + (return-from arrcomp i)))) -1) ;;; 6str