[PATCH] remove unused variable *EOF*

8 views
Skip to first unread message

Qian Yun

unread,
Oct 21, 2024, 5:26:56 AM10/21/24
to fricas-devel
This variable is not used anymore.

We can safely delete it.

- Qian
remove-unused-variable-EOF.patch

Waldek Hebisch

unread,
Oct 21, 2024, 10:09:46 AM10/21/24
to fricas...@googlegroups.com
On Mon, Oct 21, 2024 at 05:26:51PM +0800, Qian Yun wrote:
> This variable is not used anymore.
>
> We can safely delete it.

Hmm, AFAICS '|fin|' was used to implement ')fin'.

>
> - Qian
>
> --
> 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 fricas-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/8044bce5-e333-4b62-865e-43a0be45fcd2%40gmail.com.

> diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot
> index 81cddac4..4b8ad0ce 100644
> --- a/src/interp/int-top.boot
> +++ b/src/interp/int-top.boot
> @@ -117,7 +117,6 @@ runspad() ==
> ncTopLevel() ==
> -- Top-level read-parse-eval-print loop for the interpreter. Uses
> -- the Bill Burge's parser.
> - _*EOF_*: fluid := NIL
> $InteractiveMode :fluid := true
> $e:fluid := $InteractiveFrame
> int_loop()
> diff --git a/src/interp/macros.lisp b/src/interp/macros.lisp
> index 7130940d..1433cb5e 100644
> --- a/src/interp/macros.lisp
> +++ b/src/interp/macros.lisp
> @@ -235,9 +235,6 @@
>
> ; 22.2.1 Input from Character Streams
>
> -(defvar *EOF* NIL)
> -
> -
> ; 22.3 Output Functions
>
> ; 22.3.1 Output to Character Streams
> diff --git a/src/interp/scwrap2.boot b/src/interp/scwrap2.boot
> index 85c8d2f1..c4c1196a 100644
> --- a/src/interp/scwrap2.boot
> +++ b/src/interp/scwrap2.boot
> @@ -76,7 +76,6 @@ spadCompile1(name, pile_mode) ==
> $nopiles : local := pile_mode
> $comp370_apply : local := FUNCTION print_defun
> $file_apply : local := FUNCTION print_defun
> - _*EOF_* : local := false
> $edit_file : local := name
> $InteractiveMode : local := false
> $spad_scanner : local := true
> diff --git a/src/interp/server.boot b/src/interp/server.boot
> index 899730d2..a65cb751 100644
> --- a/src/interp/server.boot
> +++ b/src/interp/server.boot
> @@ -75,9 +75,8 @@ serverReadLine(stream) ==
> FORCE_-OUTPUT()
> not $SpadServer =>
> read_line(stream)
> - _*EOF_*: fluid := NIL
> line :=
> - while not $EndServerSession and not _*EOF_* repeat
> + while not $EndServerSession repeat
> if $NeedToSignalSessionManager then
> sockSendInt($SessionManager, $EndOfOutput)
> $NeedToSignalSessionManager := false
> diff --git a/src/interp/spad.lisp b/src/interp/spad.lisp
> index b6c7bfaa..e1200fa6 100644
> --- a/src/interp/spad.lisp
> +++ b/src/interp/spad.lisp
> @@ -55,10 +55,6 @@
> ; SYSTEM COMMANDS
> ;************************************************************************
>
> -(defun |fin| ()
> - (SETQ *EOF* 'T)
> - (THROW 'SPAD_READER NIL))
> -
> (defun QUOTIENT2 (X Y) (values (TRUNCATE X Y)))
>
> (defun INTEXQUO(X Y)


--
Waldek Hebisch

Qian Yun

unread,
Oct 21, 2024, 10:16:52 AM10/21/24
to fricas...@googlegroups.com
I think ")fin" is implemented in function "intloopReadConsole"
in "int-top.boot".

- Qian

Waldek Hebisch

unread,
Oct 29, 2024, 7:21:43 AM10/29/24
to fricas...@googlegroups.com
On Mon, Oct 21, 2024 at 10:16:47PM +0800, Qian Yun wrote:
> I think ")fin" is implemented in function "intloopReadConsole"
> in "int-top.boot".

AFAICS 'systemCommand(")fin")' does not get there.

>
> - Qian
>
> On 10/21/24 10:09 PM, Waldek Hebisch wrote:
> > On Mon, Oct 21, 2024 at 05:26:51PM +0800, Qian Yun wrote:
> > > This variable is not used anymore.
> > >
> > > We can safely delete it.
> >
> > Hmm, AFAICS '|fin|' was used to implement ')fin'.
> >
>
> --
> 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 fricas-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/bab2fcd3-d4ea-4517-a586-5491db445deb%40gmail.com.

--
Waldek Hebisch

Qian Yun

unread,
Oct 29, 2024, 9:33:25 AM10/29/24
to fricas...@googlegroups.com
'systemCommand("fin")' doesn't return to Lisp prompt,
and *EOF* plays no role in this?

How do you suggest to proceed?

- Qian

Waldek Hebisch

unread,
Oct 30, 2024, 2:58:39 PM10/30/24
to fricas...@googlegroups.com
On Tue, Oct 29, 2024 at 09:33:29PM +0800, Qian Yun wrote:
> 'systemCommand("fin")' doesn't return to Lisp prompt,
> and *EOF* plays no role in this?
>
> How do you suggest to proceed?

One way is to declare that 'systemCommand("fin")' does not work
and remove 'fin' from lists in 'setq.lisp'. Or implement it
so that it works: 'fin' would need to throw to correct place
and set appropriate flags so that this place knows what to do.

> - Qian
>
> On 10/29/24 7:21 PM, Waldek Hebisch wrote:
> > On Mon, Oct 21, 2024 at 10:16:47PM +0800, Qian Yun wrote:
> > > I think ")fin" is implemented in function "intloopReadConsole"
> > > in "int-top.boot".
> >
> > AFAICS 'systemCommand(")fin")' does not get there.
> >
> > >
> > > - Qian
> > >
> > > On 10/21/24 10:09 PM, Waldek Hebisch wrote:
> > > > On Mon, Oct 21, 2024 at 05:26:51PM +0800, Qian Yun wrote:
> > > > > This variable is not used anymore.
> > > > >
> > > > > We can safely delete it.
> > > >
> > > > Hmm, AFAICS '|fin|' was used to implement ')fin'.
> > > >
> > >
> > > --
> > > 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 fricas-devel...@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/bab2fcd3-d4ea-4517-a586-5491db445deb%40gmail.com.
> >
>
> --
> 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 fricas-devel...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/8f3870e5-ba70-453b-a858-c3f9cb3396eb%40gmail.com.

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