On Sat, Dec 09, 2023 at 08:59:13AM +0800, Qian Yun wrote:
> The code uses "cat" to display text file, which is usually not available
> on windows.
>
> Luckily writing a lisp version to display text file is not hard.
Having our own replacement for "cat" is reasonable. However,
why do not you do this in Boot?
>
> - Qian
>
> diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot
> index f7a20a2d..cd737039 100644
> --- a/src/interp/i-syscmd.boot
> +++ b/src/interp/i-syscmd.boot
> @@ -704,9 +704,9 @@ withAsharpCmd args ==
> --% )copyright -- display copyright notice
>
> summary l ==
> - OBEY STRCONC ('"cat ", $spadroot, '"/lib/summary")
> + print_text_file STRCONC($spadroot, '"/lib/summary")
> copyright () ==
> - OBEY STRCONC ('"cat ", $spadroot, '"/lib/copyright")
> + print_text_file STRCONC($spadroot, '"/lib/copyright")
>
> --% )credits -- display credit list
>
> diff --git a/src/interp/util.lisp b/src/interp/util.lisp
> index 400a2b94..29f7e5d1 100644
> --- a/src/interp/util.lisp
> +++ b/src/interp/util.lisp
> @@ -383,3 +383,10 @@ After this function is called the image is clean and
> can be saved.
> (|setIOindex| (- |$IOindex| 3))
> )
> )
> +
> +(defun |print_text_file| (filename)
> + (with-open-file (s filename :direction :input :if-does-not-exist nil)
> + (if s
> + (do ((l (read-line s nil) (read-line s nil)))
> + ((null l) nil)
> + (write-line l)))))
>
> --
> You received this message because you are subscribed to the Google Groups
> "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fricas-devel/993b9851-837f-48a8-920f-dbd27e5ef5f8%40gmail.com.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/ZXUhlAO0kdcZxVg1%40fricas.org.