Re: Locals revisited

Liste des Groupes 
Sujet : Re: Locals revisited
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 28. Mar 2025, 00:42:17
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <19029ff0c8e7cf53335fe62639308e7f92d10240@i2pn2.org>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 27/03/2025 11:02 pm, albert@spenarnc.xs4all.nl wrote:
In article <87semzmwok.fsf@nightsong.com>,
Paul Rubin  <no.email@nospam.invalid> wrote:
albert@spenarnc.xs4all.nl writes:
In hindsight my locals definition is not convincing, because carnal
knowledge about the behaviour of the return stack is required.
>
It's ok if it's for a specific implementation.  But what I'm having
trouble seeing is how the locals get popped in case of an exception.
 
 
I showed it as an example of the pretty convincing usefulness
of CO. For this the example had to have to be portable.
 
A simpler example would be
\ Temporary set  some-rounding-mode  for the duration of this word.
: rounding set-rounding-mode CO truncate-mode set-rounding-mode ;
...

Actually it was that example which caused me to *not* go ahead
and implement ;: in the kernel despite a cost of only one header.
How many calls to 'rounding' will you encounter in an application?
My guess is one.  The usual example is HEX: but I already had (H.N)
that's more flexible.  For me at least locals was more credible but
again it fell into a range.  For a single use I'd do it manually;
for extensive use (where exceptions etc are likely) a proper locals
may be the only option.  OTOH such decision-making is exactly what
Forth has always been about.



Date Sujet#  Auteur
25 Mar 25 * Locals revisited12albert
26 Mar 25 `* Re: Locals revisited11Paul Rubin
27 Mar 25  +* Re: Locals revisited2mhx
27 Mar 25  i`- Stacks (was: Locals revisited)1Anton Ertl
27 Mar 25  +* Re: Locals revisited4Anton Ertl
27 Mar 25  i+- Re: Locals revisited1albert
27 Mar 25  i`* Re: Locals revisited2Paul Rubin
28 Mar 25  i `- Re: Locals revisited1Anton Ertl
28 Mar 25  `* Re: Locals revisited4dxf
30 Mar 25   `* Re: Locals revisited3dxf
30 Mar 25    `* Re: Locals revisited2dxf
31 Mar 25     `- Re: Locals revisited1sjack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal