Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135032

Re: The joy of formatting

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: The joy of formatting
Date 2026-05-01 06:03 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2026May1.080355@mips.complang.tuwien.ac.at> (permalink)
References (1 earlier) <69f2ba42$1@news.ausics.net> <nnd$5188275e$5d740caa@15d7ec6ab0bb7dfb> <69f36016$1@news.ausics.net> <nnd$36020a68$7d940848@8c5641d01ac9a818> <69f3ec53$1@news.ausics.net>

Show all headers | View raw


dxf <dxforth@gmail.com> writes:
>From a Gforth include:
>
>: pn    ( n -- )  0 <# # # #> type ;
>: ;pn   [char] ; emit pn ;
>: ESC[  27 emit [char] [ emit ;
>: at-xy 1+ 1 under+ ESC[ pn ;pn [char] H emit ;

Here's another one (the one active when I invoke Gforth):

: #n ( n -- )  [: 0 #s 2drop ;] #10 base-execute ;
: #n; ( n -- )  #n ';' hold ;
: #esc[ ( -- )
    s\" \e[" holds ;

: vt100-at-xy ( u1 u2 -- )
  1+ swap 1+ <<# 'H' hold #n; #n #esc[ #0. #> type #>> ;

Benefits:

1) Works also as intended when invoked while BASE is not decimal
(BASE-EXECUTE).

2) Does not disturb any ongoing hold buffer usage (<<# ... #>>).

3) Stack effect comments.

- 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 2025 proceedings: http://www.euroforth.org/ef25/papers/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

The joy of formatting albert@spenarnc.xs4all.nl - 2026-04-29 15:41 +0200
  Re: The joy of formatting dxf <dxforth@gmail.com> - 2026-04-30 12:11 +1000
    Re: The joy of formatting Hans Bezemer <the.beez.speaks@gmail.com> - 2026-04-30 09:48 +0200
    Re: The joy of formatting albert@spenarnc.xs4all.nl - 2026-04-30 11:06 +0200
      Re: The joy of formatting Hans Bezemer <the.beez.speaks@gmail.com> - 2026-04-30 23:34 +0200
    Re: The joy of formatting albert@spenarnc.xs4all.nl - 2026-04-30 11:11 +0200
      Re: The joy of formatting dxf <dxforth@gmail.com> - 2026-04-30 23:58 +1000
        Re: The joy of formatting albert@spenarnc.xs4all.nl - 2026-04-30 18:11 +0200
          Re: The joy of formatting dxf <dxforth@gmail.com> - 2026-05-01 09:57 +1000
            Re: The joy of formatting anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-01 06:03 +0000
              Re: The joy of formatting dxf <dxforth@gmail.com> - 2026-05-03 23:09 +1000
                Re: The joy of formatting anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-03 14:11 +0000
                Re: The joy of formatting dxf <dxforth@gmail.com> - 2026-05-04 11:02 +1000
      Re: The joy of formatting minforth <minforth@gmx.net> - 2026-04-30 20:47 +0200
        Re: The joy of formatting Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-05-03 09:07 -0500

csiph-web