Re: 0 SET-ORDER why?

Liste des GroupesRevenir à cl forth 
Sujet : Re: 0 SET-ORDER why?
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forth
Date : 26. Jun 2024, 08:49:10
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2024Jun26.094910@mips.complang.tuwien.ac.at>
References : 1
User-Agent : xrn 10.11
Krishna Myneni <krishna.myneni@ccreweb.org> writes:
Why is 0 a valid argument to SET-ORDER (from the optional Search-Order
word set)? It can leave a Forth system in a non-recoverable state.

So what?  There are lots of ways to put a Forth system in a
non-recoverable state.

Sentences are separated for emphasis: "If n is zero, empty the search
order."  Why?

Why not?  It's what I would expect from 0 SET-ORDER anyway.

Is your question: "What potential uses does an empty search order
have?" ?

I have seen postings that suggest to use EVALUATE for converting
untrusted input into a number.  There is of course no security
precautions in these postings, but at the very least one could empty
the search order before the EVALUATE and restore it after the EVALUATE
(with the EVALUATE being wrapped with CATCH).  I thought about writing
out the source code, but the main things that would demonstrate is how
inconvenient GET-ORDER and SET-ORDER with their arbitrary number of
stack items are, and how inconvenient the arbitrary number of stack
items produced by EVALUATE is.

Of course, with recognizer sequences, the better way is to use a
recognizer sequence that only contains the number recognizers you
want, no need to mess with the search order.

In kForth (32/64), the sequence
>
0 SET-ORDER
>
leaves the Forth system in a non-recoverable state, and I have to use
Ctrl-C to break out back to the OS shell. This appears to be true in
Gforth as well, although Gforth traps Ctrl-C, so maybe one has to kill
the process from another shell.

In Gforth you can leave the text interpreter in the traditional Unix
way of doing Ctrl-D at the start of a line.

Restoring an empty search order to some more usable default by the
system CATCH handler would be a potential convenience feature, but I
have not experienced an empty search order as a problem yet, and I
don't remember users asking for such a feature, either.  And it would
only catch

0 SET-ORDER

but not the functionally equivalent

WORDLIST 1 SET-ORDER

So why nerf one and not the other?

- anton
--
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: https://forth-standard.org/
   EuroForth 2024: https://euro.theforth.net

Date Sujet#  Auteur
26 Jun 24 * 0 SET-ORDER why?64Krishna Myneni
26 Jun 24 +* Re: 0 SET-ORDER why?3minforth
26 Jun 24 i+- Re: 0 SET-ORDER why?1albert
26 Jun 24 i`- Re: 0 SET-ORDER why?1Krishna Myneni
26 Jun 24 `* Re: 0 SET-ORDER why?60Anton Ertl
26 Jun 24  +* Re: 0 SET-ORDER why?26dxf
26 Jun 24  i`* Re: 0 SET-ORDER why?25Ruvim
27 Jun 24  i +* Re: 0 SET-ORDER why?9dxf
27 Jun 24  i i+* Re: 0 SET-ORDER why?2Gerry Jackson
28 Jun 24  i ii`- Re: 0 SET-ORDER why?1dxf
28 Jun 24  i i`* Re: 0 SET-ORDER why?6Ruvim
28 Jun 24  i i +* Re: 0 SET-ORDER why?4dxf
28 Jun 24  i i i`* Re: 0 SET-ORDER why?3Ruvim
28 Jun 24  i i i `* Re: 0 SET-ORDER why?2dxf
1 Jul 24  i i i  `- Re: 0 SET-ORDER why?1dxf
29 Jun 24  i i `- Re: 0 SET-ORDER why?1dxf
27 Jun 24  i `* Re: 0 SET-ORDER why?15Gerry Jackson
27 Jun 24  i  +* Re: 0 SET-ORDER why?2albert
27 Jun 24  i  i`- Re: 0 SET-ORDER why?1minforth
27 Jun 24  i  +- Re: 0 SET-ORDER why?1dxf
27 Jun 24  i  +* Re: 0 SET-ORDER why?7Krishna Myneni
27 Jun 24  i  i+* Re: 0 SET-ORDER why?4Krishna Myneni
27 Jun 24  i  ii+* Re: 0 SET-ORDER why?2Gerry Jackson
28 Jun 24  i  iii`- Re: 0 SET-ORDER why?1Krishna Myneni
28 Jun 24  i  ii`- Re: 0 SET-ORDER why?1dxf
29 Jun 24  i  i`* Re: 0 SET-ORDER why?2Krishna Myneni
30 Jun 24  i  i `- Re: 0 SET-ORDER why?1albert
28 Jun 24  i  `* Re: 0 SET-ORDER why?4Ruvim
28 Jun 24  i   +* Re: 0 SET-ORDER why?2albert
28 Jun 24  i   i`- Recognizer protocol (was: 0 SET-ORDER why?)1Ruvim
4 Jul 24  i   `- Re: 0 SET-ORDER why?1Gerry Jackson
26 Jun 24  +* Re: 0 SET-ORDER why?3albert
26 Jun 24  i+- Re: 0 SET-ORDER why?1minforth
26 Jun 24  i`- Re: 0 SET-ORDER why?1Krishna Myneni
26 Jun 24  `* Re: 0 SET-ORDER why?30Krishna Myneni
28 Jun 24   `* Re: 0 SET-ORDER why?29Anton Ertl
28 Jun 24    +- Re: 0 SET-ORDER why?1Hans Bezemer
29 Jun 24    `* Re: 0 SET-ORDER why?27Krishna Myneni
30 Jun 24     `* Re: 0 SET-ORDER why?26dxf
30 Jun 24      `* Re: 0 SET-ORDER why?25Krishna Myneni
30 Jun 24       `* Re: 0 SET-ORDER why?24Krishna Myneni
30 Jun 24        `* Re: 0 SET-ORDER why?23minforth
30 Jun 24         `* Re: 0 SET-ORDER why?22Krishna Myneni
30 Jun 24          `* Re: 0 SET-ORDER why?21minforth
1 Jul 24           `* Re: 0 SET-ORDER why?20Krishna Myneni
1 Jul 24            +* Re: 0 SET-ORDER why?2mhx
1 Jul 24            i`- Re: 0 SET-ORDER why?1Krishna Myneni
1 Jul 24            `* Re: 0 SET-ORDER why?17Ruvim
1 Jul 24             +* Re: 0 SET-ORDER why?12Krishna Myneni
1 Jul 24             i+* Re: 0 SET-ORDER why?6dxf
2 Jul 24             ii+- Re: 0 SET-ORDER why?1dxf
3 Jul 24             ii`* Re: 0 SET-ORDER why?4Krishna Myneni
3 Jul 24             ii `* Re: 0 SET-ORDER why?3dxf
3 Jul 24             ii  `* Re: 0 SET-ORDER why?2albert
3 Jul 24             ii   `- Re: 0 SET-ORDER why?1dxf
1 Jul 24             i+* Re: 0 SET-ORDER why?3albert
2 Jul 24             ii`* Re: 0 SET-ORDER why?2sjack
2 Jul 24             ii `- Re: 0 SET-ORDER why?1dxf
2 Jul 24             i`* Re: 0 SET-ORDER why?2Ruvim
3 Jul 24             i `- Re: 0 SET-ORDER why?1Krishna Myneni
21 Sep 24             `* Re: 0 SET-ORDER why?4Anthony Howe
22 Sep 24              `* Re: 0 SET-ORDER why?3Ruvim
22 Sep 24               `* Re: 0 SET-ORDER why?2Anthony Howe
22 Sep 24                `- Re: 0 SET-ORDER why?1Ruvim

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal