Sujet : Re: bye with exit status
De : ruvim.pinka (at) *nospam* gmail.com (Ruvim)
Groupes : comp.lang.forthDate : 08. Nov 2024, 13:16:18
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vgkvei$369hb$1@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla Thunderbird
On 2024-11-08 15:34, Anthony Howe wrote:
On 2024-11-07 17:04, Ruvim wrote:
On 2024-11-07 22:50, Anthony Howe wrote:
On 2024-11-07 06:56, Ruvim wrote:
I would like to find a more appropriate name for this word than "bye- status".
>
(bye) ( u -- )
>
Seems apropos, short, to the point and indicative of an internal word.
>
Yes, and because of the latter this name cannot be used for a standard word. Standard words are not internal words, but are part of the public interface.
But the precedent for defining and exposing an internal word has been set in the standard with Locals `(local)`. So defining `(bye)` seems reasonable.
`(local)` is a good example when a better names was not found. I'm not sure this form of naming should be used for standard words.
What about the following options:
>
badbye ( n -- never )
- because it's probably not normal termination
- if n is 0, then it's false-bad (i.e, good)
`badbye` - did you have a bad breakup as a teen? If you're a JJ Abrams fan maybe why not `badrobot`.
goodbye ( n -- never )
- ironically when n is not zero
Well I had suggested `bye-bye` and tossed the idea of `goodbye` cause is not so good.
getout ( n -- never )
- send control very far from here
Sounds like something from a horror movie <deep sinister voice>get-out! get out of the house!</>
What about "die" ? ;-)
It is used in 8th and in Perl.
BTW, the name "halt" for that is used in FreePascal.
<
https://www.freepascal.org/docs-html/rtl/system/halt.html>
Maybe borrow from non-english:
`ciao` `sayonara` `fini`
Maybe ask someone with young children and see what they come up with. Bet you get some "interesting" answers.
Other, more technical variants:
exit-process ( n -- never )
exit-system ( n -- never )
SIGTERM is a good association with processes.
>
Perhaps, SIGTERM can be send to another process too.
That would probably something like kill(2), eg: kill(1234, SIGTERM)
Okay. What name to choose for the word that terminates the thread/task of the caller?
If we take "exit-process" to terminate the own process,
then "exit-thread" or "exit-task" can be used for thread/task.
With "exit" it is clear that it's about the own thread or process of the caller.
-- Ruvim