[PATCH] some typo fixes and misc cleanups

4 views
Skip to first unread message

Qian Yun

unread,
Oct 21, 2023, 7:02:27 AM10/21/23
to fricas-devel
This patch contains some typo fixes and misc cleanups.

A little bit of explanation:

The addition of "format" in "|compressOpen|" is to add a
newline, just like "|interpOpen|" etc.

The removal of "elapsedUserTime": it is used only once,
and there's another function that is exactly the same ("get_run_time").

"|fricas_probe_file|" already pads the argument when needed,
and returns "truename", so it can be simplified a bit.

- Qian

diff --git a/src/algebra/ffact.spad b/src/algebra/ffact.spad
index d4bb0e48..c9583bb6 100644
--- a/src/algebra/ffact.spad
+++ b/src/algebra/ffact.spad
@@ -1013,7 +1013,7 @@ UnivariateFiniteFieldFactorize(K, UP) : Exports ==
Implementation where
++ sufactor_square_free(p) factorizes p into prime factors.
++ p must be square free.
su_irreducible? : SUP -> Boolean
- ++ irreducible?(p) tests if p is irreducible.
+ ++ su_irreducible?(p) tests if p is irreducible.
++ p must be monic and square free.
irreducible? : UP -> Boolean
++ irreducible?(p) tests if p is irreducible.
diff --git a/src/hyper/lex.c b/src/hyper/lex.c
index 75577d17..85b845af 100644
--- a/src/hyper/lex.c
+++ b/src/hyper/lex.c
@@ -53,12 +53,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
* Note: The scanner reads from three separate input locations
depending on the
* value of the variable "input_type". If this variable is:
*
- * FromFile -- it read from the file pointed to by "cfile".
+ * FromFile -- it reads from the file pointed to by "cfile".
* FromString -- It reads from the string "input_string".
* FromSpadSocket -- It reads from the socket pointed to by spad_socket
* FromFD -- It reads from a file descriptor
*
- * New variable useAscii -- tells us if we we should translate
+ * New variable useAscii -- tells us if we should translate
* graphics characters on the fly
* initialised in init_scanner
*
diff --git a/src/interp/daase.lisp b/src/interp/daase.lisp
index 92911054..12f71d31 100644
--- a/src/interp/daase.lisp
+++ b/src/interp/daase.lisp
@@ -1209,7 +1209,8 @@ database.
(setq lst (read |$compress_stream|))
(setq |$compress_vector_length| (car lst))
(setq |$compress_vector|
- (make-array (car lst) :initial-contents (cdr lst))))))
+ (make-array (car lst) :initial-contents (cdr lst)))))
+ (format t "~&"))

(defun write-compress ()
(let (compresslist masterpos out)
diff --git a/src/interp/g-timer.boot b/src/interp/g-timer.boot
index 501092e2..1e3c61d2 100644
--- a/src/interp/g-timer.boot
+++ b/src/interp/g-timer.boot
@@ -193,7 +193,7 @@ DEFPARAMETER($inverseTimerTicksPerSecond,
1.0/$timerTicksPerSecond)

computeElapsedTime() ==
-- in total time lists, CAR is VIRTCPU and CADR is TOTCPU
- currentTime:= elapsedUserTime()
+ currentTime:= get_run_time()
currentGCTime:= elapsedGcTime()
gcDelta := currentGCTime - $oldElapsedGCTime
elapsedSeconds:= $inverseTimerTicksPerSecond *
diff --git a/src/interp/util.lisp b/src/interp/util.lisp
index 73064f15..bbca1727 100644
--- a/src/interp/util.lisp
+++ b/src/interp/util.lisp
@@ -114,9 +114,9 @@ from scratch.

"algebra/interp.daase"))
bin-parent-dir))
(error "Environment variable FRICAS is not set!")))
- (setq spadroot (pad-directory-name spadroot))
- (if (|fricas_probe_file| spadroot)
- (reroot (trim-directory-name (namestring (truename spadroot))))
+ (setq spadroot (|fricas_probe_file| spadroot))
+ (if spadroot
+ (reroot (trim-directory-name (namestring spadroot)))
(error "Environment variable FRICAS is not valid!")))

;;; Gnu Common Lisp (GCL) (at least 2.6.[78]) requires some changes
diff --git a/src/lisp/fricas-lisp.lisp b/src/lisp/fricas-lisp.lisp
index 67c413e8..b61e2a2f 100644
--- a/src/lisp/fricas-lisp.lisp
+++ b/src/lisp/fricas-lisp.lisp
@@ -1150,8 +1150,6 @@ with this hack and will try to convince the GCL
crowd to fix this.
(defmacro |replaceString| (result part start)
`(replace ,result ,part :start1 ,start))

-(defmacro |elapsedUserTime| () '(get-internal-run-time))
-
#+:GCL
(defmacro |elapsedGcTime| () '(system:gbc-time))
#-:GCL

Waldek Hebisch

unread,
Oct 21, 2023, 8:26:23 AM10/21/23
to fricas...@googlegroups.com
On Sat, Oct 21, 2023 at 07:02:23PM +0800, Qian Yun wrote:
> This patch contains some typo fixes and misc cleanups.
>
> A little bit of explanation:
>
> The addition of "format" in "|compressOpen|" is to add a
> newline, just like "|interpOpen|" etc.
>
> The removal of "elapsedUserTime": it is used only once,
> and there's another function that is exactly the same ("get_run_time").
>
> "|fricas_probe_file|" already pads the argument when needed,
> and returns "truename", so it can be simplified a bit.

Thanks, please commit.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages