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


Groups > comp.lang.forth > #17774

Re: why bother with standards ?

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: why bother with standards ?
Date 2012-11-30 17:41 +0100
Organization 1&1 Internet AG
Message-ID <3379563.69VCYvQH20@sunwukong.fritz.box> (permalink)
References (11 earlier) <50b7a412.345554913@192.168.0.50> <7xsj7s44an.fsf@ruckus.brouhaha.com> <N--dnV-k9_fptCXNnZ2dnUVZ_oydnZ2d@supernews.com> <7xd2yvfvfr.fsf@ruckus.brouhaha.com> <kfidnahFC4P6xiXNnZ2dnUVZ_uKdnZ2d@supernews.com>

Show all headers | View raw


Elizabeth D. Rather wrote:
> It's certainly not hard to set this up in Forth, whether ITC or
> compiled. The need just doesn't arise often enough to have formalized
> it.

Works also in native code.  All you do is to insert a branch to the new 
word in the replaced word.  Something like:

: replace-word ( xt2 xt1 -- )
  \ make xt1 do xt2
  >body  here >r dp !  >r postpone AHEAD  r> >body dp !  postpone THEN
  r> dp ! ;

In bigForth and VFX you have to remove the >BODY to make it work (native 
code colon definitions have no body, they are only code ;-); you quite 
likely don't achieve full replacement in VFX due to the inliner, but if 
you want to do this sort of stuff, you can compile your program with 
inlining disabled.

: replace-word ( xt2 xt1 -- )
  \ make xt1 do xt2
  here >r dp !  >r postpone AHEAD  r> dp !  postpone THEN
  r> dp ! ;

In SwiftForth, I had more troubles.  Replacing dp with h didn't work.  I 
leave that as exercise to Elizabeth ;-).

Both words need to be colon definitions.  In a traditional ITC Forth 
(not primitive-centric, not native code), you can replace any word by 
any other, you make the replaced word a deferred word, and insert the xt 
of the target word into the body.  This always works.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

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


Thread

why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-19 16:03 +0000
  Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-19 16:06 +0000
  Re: why bother with standards ? daveyrotten <danw8804@gmail.com> - 2012-11-19 08:15 -0800
    Re: why bother with standards ? rickman <gnuarm@gmail.com> - 2012-11-19 12:07 -0500
    Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-20 02:27 +0100
      Re: why bother with standards ? Winston19842005 <winston19842005@yahoo.com> - 2012-11-19 21:59 -0500
        Re: why bother with standards ? Jason Damisch <jasondamisch@yahoo.com> - 2012-11-19 19:21 -0800
          Re: why bother with standards ? Mark Wills <forthfreak@gmail.com> - 2012-11-20 01:33 -0800
            Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-20 05:09 -0600
              Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-20 18:48 -0800
    Re: why bother with standards ? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-20 09:49 +0000
  Re: why bother with standards ? Pablo Hugo Reda <pabloreda@gmail.com> - 2012-11-19 10:59 -0800
  Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-19 19:06 -0500
  Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-19 14:25 -1000
    Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-19 20:29 -0800
      Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-20 05:42 -0500
        Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-20 17:23 +0000
          Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-20 21:05 -0500
            Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-21 14:24 +0000
        Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-20 18:24 -0800
      Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-20 03:07 -0800
        Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-20 17:35 +0000
        Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-20 21:02 -0500
          Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-21 02:04 -0800
        Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-20 19:21 -0800
          Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-21 01:34 -0800
          Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-21 04:51 -0500
            Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-21 04:43 -0600
              Re: why bother with standards ? Fritz Wuehler <fritz@spamexpire-201211.rodent.frell.theremailer.net> - 2012-11-21 20:34 +0100
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-21 12:04 -0800
                Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-22 21:19 -0500
                Re: why bother with standards ? Mark Wills <forthfreak@gmail.com> - 2012-11-23 02:05 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-23 03:05 -0800
                Re: why bother with standards ? Mark Wills <forthfreak@gmail.com> - 2012-11-23 03:22 -0800
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-23 12:13 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-23 12:24 -0800
                Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-23 10:43 -1000
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-23 15:10 -0600
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-23 13:40 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-23 13:44 -0800
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-24 01:29 +0100
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-24 04:54 -0600
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-24 16:56 -0800
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-25 04:16 -0600
                Re: why bother with standards ? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-26 14:48 +0000
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-23 09:12 -0600
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-23 22:00 -0800
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-23 03:52 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-23 07:34 -0800
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-23 09:57 -0600
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-23 20:09 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-24 04:53 -0800
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-24 14:32 +0100
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-24 21:01 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-25 02:22 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-25 02:27 -0800
                Re: why bother with standards ? awegel@arcor.de (Alex Wegel) - 2012-11-23 19:12 +0100
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-23 22:39 -0800
                Re: why bother with standards ? awegel@arcor.de (Alex Wegel) - 2012-11-24 16:54 +0100
                Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-25 05:09 -0500
                Re: why bother with standards ? mhx@iae.nl (Marcel Hendrix) - 2012-11-25 13:33 +0200
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-24 12:20 -0800
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-24 20:45 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-25 02:21 -0800
            Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-21 14:38 -0800
            Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-21 18:17 -0800
            Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-23 04:26 -0800
              Re: why bother with standards ? Ron Aaron <rambamist@gmail.com> - 2012-11-23 15:28 +0200
          Re: why bother with standards ? awegel@arcor.de (Alex Wegel) - 2012-11-21 17:29 +0100
      Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-20 17:21 +0000
        Re: why bother with standards ? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-21 13:00 +0000
          Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-21 14:31 +0000
          Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-21 17:41 -0800
          Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-21 20:33 -0800
            Re: why bother with standards ? Mark Humphries <mwh@intranetsys.com> - 2012-11-22 10:00 -0800
              Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-22 17:16 -0800
    Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-20 17:12 +0000
      Re: why bother with standards ? Josh Grams <josh@qualdan.com> - 2012-11-20 17:30 +0000
        Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-20 17:48 +0000
        Re: why bother with standards ? Andy Valencia <vandys@vsta.org> - 2012-11-20 19:40 +0000
          Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-20 19:50 +0000
            Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-20 15:41 -0800
              Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-21 14:43 +0000
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-21 08:46 -0800
          Re: why bother with standards ? Brad Eckert <hwfwguy@gmail.com> - 2012-11-20 14:09 -0800
      Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-24 10:41 -0800
        Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-24 11:37 -0800
          Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-24 22:32 -0800
            Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-25 07:54 -0800
              Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-25 17:02 -0800
                Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-25 16:20 -1000
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-25 19:44 -0800
                Re: why bother with standards ? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-26 14:59 +0000
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-26 11:37 -0800
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-26 13:05 -0800
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-26 15:29 -0800
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-26 16:38 -0800
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-26 19:37 -0800
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-26 20:29 -0800
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-26 22:22 -0800
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-26 23:03 -0800
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-27 01:09 -0800
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-27 08:52 -0800
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-27 10:43 -0800
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-27 12:01 -0600
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-28 23:37 -0800
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-29 00:00 -0800
                Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-28 22:13 -1000
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 01:11 -0800
                Re: why bother with standards ? Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2012-11-29 11:00 +0000
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-29 18:58 +0100
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 12:51 -0800
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-30 00:42 +0100
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 19:57 -0800
                Re: why bother with standards ? Mark Wills <forthfreak@gmail.com> - 2012-11-30 02:22 -0800
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-30 18:47 +0100
                Re: why bother with standards ? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-30 12:53 +0000
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-30 18:33 +0100
                Debuggers (Re: why bother with standards ?) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-29 13:44 +0000
                Re: Debuggers (Re: why bother with standards ?) Paul Rubin <no.email@nospam.invalid> - 2012-11-29 09:36 -0800
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-29 06:01 -0600
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 10:00 -0800
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-29 12:22 -0600
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 10:38 -0800
                Re: why bother with standards ? Coos Haak <chforth@hccnet.nl> - 2012-11-29 21:13 +0100
                Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-29 17:11 -1000
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-30 03:37 -0600
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-30 02:11 -0800
                Re: why bother with standards ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-30 05:24 -0600
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-30 11:23 -0800
                Re: why bother with standards ? the_gavino_himself <visphatesjava@gmail.com> - 2012-11-29 21:16 -0800
                Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-29 08:38 -1000
                Re: why bother with standards ? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-29 18:43 +0000
                Re: why bother with standards ? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-29 12:15 +0000
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 09:23 -0800
                Re: why bother with standards ? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-29 18:24 +0000
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 11:06 -0800
                Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-29 17:35 -1000
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 22:37 -0800
                Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-29 21:08 -1000
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-30 17:41 +0100
                Re: why bother with standards ? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-30 08:43 -1000
                Re: why bother with standards ? Mark Wills <forthfreak@gmail.com> - 2012-11-30 02:30 -0800
                Re: why bother with standards ? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-30 10:40 +0000
                Re: why bother with standards ? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-30 14:03 +0000
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-30 14:06 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-11-30 14:51 -0800
                Re: why bother with standards ? Howerd <howerdo@yahoo.co.uk> - 2012-11-30 14:58 -0800
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-12-02 18:02 -0800
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-12-03 16:34 +0100
                Re: why bother with standards ? Coos Haak <chforth@hccnet.nl> - 2012-12-03 21:39 +0100
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-12-03 14:49 -0800
                Re: why bother with standards ? Brad Eckert <hwfwguy@gmail.com> - 2012-12-05 09:24 -0800
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-12-05 11:26 -0800
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-12-05 11:39 -0800
                Re: why bother with standards ? Alex McDonald <blog@rivadpm.com> - 2012-12-05 15:32 -0800
                Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-12-05 20:57 -0500
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-12-05 18:55 -0800
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-12-05 20:01 -0800
                Re: why bother with standards ? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-12-06 19:05 -0500
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-12-06 16:14 -0800
                Re: why bother with standards ? Bill Marcum <bill@nowhere.invalid> - 2012-12-07 20:13 -0500
                Re: why bother with standards ? Brad Eckert <hwfwguy@gmail.com> - 2012-12-03 14:29 -0800
                Re: why bother with standards ? Mark Wills <forthfreak@gmail.com> - 2012-11-30 02:20 -0800
                Re: why bother with standards ? Doug Hoffman <glidedog@gmail.com> - 2012-11-30 06:52 -0500
                Re: why bother with standards ? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-29 19:12 +0100
                Re: why bother with standards ? Paul Rubin <no.email@nospam.invalid> - 2012-11-29 14:55 -0800
                Re: why bother with standards ? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-26 22:01 -0800
                Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-27 01:44 -0800
    Re: why bother with standards ? "Ed" <invalid@nospam.com> - 2012-11-21 12:40 +1100
      Re: why bother with standards ? Chris Hinsley <chris.hinsley@gmail.com> - 2012-11-21 14:51 +0000
  Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-21 19:24 -0800
    Re: why bother with standards ? visualforth@rocketmail.com - 2012-11-21 21:54 -0800
  Re: why bother with standards ? The Beez <the.beez.speaks@gmail.com> - 2012-11-24 08:03 -0800
    Re: why bother with standards ? "Ed" <invalid@nospam.com> - 2012-11-30 14:45 +1100
      Re: why bother with standards ? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-30 10:48 +0000
        Re: why bother with standards ? "Ed" <invalid@nospam.com> - 2012-12-04 03:52 +1100
          Re: why bother with standards ? The Beez <the.beez.speaks@gmail.com> - 2012-12-06 10:34 -0800
          Re: why bother with standards ? The Beez <the.beez.speaks@gmail.com> - 2012-12-06 10:37 -0800
  Re: why bother with standards ? the_gavino_himself <visphatesjava@gmail.com> - 2012-11-29 11:47 -0800

csiph-web