Re: THROW codes and ambiguous conditions

Liste des GroupesRevenir à cl forth 
Sujet : Re: THROW codes and ambiguous conditions
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forth
Date : 08. Jun 2025, 08:56:26
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Jun8.095626@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5
User-Agent : xrn 10.11
albert@spenarnc.xs4all.nl writes:
In article <87plff4938.fsf@nightsong.com>,
Paul Rubin  <no.email@nospam.invalid> wrote:
dxf <dxforth@gmail.com> writes:
For (.) (D.) (U.) that's certainly not the case in Gforth.
I said the Standard hadn't factored them out.  Several forths of course
have factored them out.
>
Well I think you were saying the standard SHOULD have factored them out,
presumably because they are both useful to users, and reasonably
necessary parts of the underlying implementation that could have been
exported, as opposed to just giving more clutter for implementers to
supply.
>
It is occasionally useful to have conversions to a string that
not immediately prints. Even figforth had a (D.R) that was a
D.R without the type.

It's not in the fig-Forth Installation Manual / Glossary / Model Release !

http://wiki.yak.net/1089/fig-FORTH_Manuals_May79.pdf

nor in the source code.

https://raw.githubusercontent.com/ForthHub/FIG-Forth/refs/heads/master/fig.fth

But thanks to the #-set a conversion is very short :
  : (.) 0 <# #S #> ;
I tend to define such word in the application , otherwise you end up
adding (.) (U.) (D.) (UD.) (D.R) to the standard.

Your (.) looks more like (U.) to me.

Alternatively, add

  >string-execute ( ... xt – ... c-addr u  ) gforth-1.0 "to-string-execute"
 
  Execute xt while the standard output (type, emit, and everything that
  uses them) is redirected to a string. The resulting string is c-addr
  u, which is in heap memory; it is the responsibility of the caller of
  >string-execute to free this string.

Then you can do

' d.r >string-execute

instead.  This approach has some overhead, however.

- 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 2023 proceedings: http://www.euroforth.org/ef23/papers/
EuroForth 2024 proceedings: http://www.euroforth.org/ef24/papers/

Date Sujet#  Auteur
31 May 25 * THROW codes and ambiguous conditions40dxf
31 May 25 +* Re: THROW codes and ambiguous conditions7Anton Ertl
31 May 25 i+* Re: THROW codes and ambiguous conditions2dxf
3 Jun 25 ii`- Re: THROW codes and ambiguous conditions1sjack
31 May 25 i`* Re: THROW codes and ambiguous conditions4Anton Ertl
1 Jun 25 i `* Re: THROW codes and ambiguous conditions3albert
1 Jun 25 i  `* Re: THROW codes and ambiguous conditions2Anton Ertl
1 Jun 25 i   `- Re: THROW codes and ambiguous conditions1albert
1 Jun 25 `* Re: THROW codes and ambiguous conditions32Hans Bezemer
2 Jun 25  +- Re: THROW codes and ambiguous conditions1dxf
2 Jun 25  `* Re: THROW codes and ambiguous conditions30albert
3 Jun 25   `* Re: THROW codes and ambiguous conditions29dxf
3 Jun 25    +* Re: THROW codes and ambiguous conditions25Anton Ertl
4 Jun 25    i`* Re: THROW codes and ambiguous conditions24dxf
4 Jun 25    i `* Re: THROW codes and ambiguous conditions23sean
5 Jun 25    i  +- Re: THROW codes and ambiguous conditions1dxf
5 Jun 25    i  `* Re: THROW codes and ambiguous conditions21albert
6 Jun 25    i   +- Re: THROW codes and ambiguous conditions1dxf
6 Jun 25    i   `* Re: THROW codes and ambiguous conditions19sean
6 Jun 25    i    `* Re: THROW codes and ambiguous conditions18albert
6 Jun 25    i     `* Re: THROW codes and ambiguous conditions17sean
7 Jun 25    i      `* Re: THROW codes and ambiguous conditions16dxf
7 Jun 25    i       `* Re: THROW codes and ambiguous conditions15sean
7 Jun 25    i        +- Re: THROW codes and ambiguous conditions1dxf
7 Jun 25    i        +* Re: THROW codes and ambiguous conditions12Anton Ertl
7 Jun 25    i        i`* Re: THROW codes and ambiguous conditions11dxf
7 Jun 25    i        i `* Re: THROW codes and ambiguous conditions10Paul Rubin
8 Jun 25    i        i  +* Re: THROW codes and ambiguous conditions4Paul Rubin
8 Jun 25    i        i  i+- Re: THROW codes and ambiguous conditions1dxf
8 Jun 25    i        i  i+- Re: THROW codes and ambiguous conditions1Anton Ertl
10 Jun 25    i        i  i`- Re: THROW codes and ambiguous conditions1Paul Rubin
8 Jun 25    i        i  +- Re: THROW codes and ambiguous conditions1dxf
8 Jun 25    i        i  `* Re: THROW codes and ambiguous conditions4Anton Ertl
8 Jun 25    i        i   `* Re: THROW codes and ambiguous conditions3dxf
9 Jun 25    i        i    `* Re: THROW codes and ambiguous conditions2dxf
9 Jun 25    i        i     `- Re: THROW codes and ambiguous conditions1LIT
7 Jun 25    i        `- Re: THROW codes and ambiguous conditions1LIT
3 Jun 25    +- Re: THROW codes and ambiguous conditions1John
4 Jun 25    `* Re: THROW codes and ambiguous conditions2dxf
6 Jun 25     `- Re: THROW codes and ambiguous conditions1Hans Bezemer

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal