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


Groups > comp.lang.forth > #19468

Re: On-the-fly updating of word definitions?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!postnews2.euro.net!news.wanadoo.nl!not-for-mail
From mhx@iae.nl (Marcel Hendrix)
Subject Re: On-the-fly updating of word definitions?
Newsgroups comp.lang.forth
Message-ID <99951798018434@frunobulax.edu> (permalink)
Date Tue, 5 Feb 2013 18:08:04 +0200
References <85mwvjgog8.fsf@junk.nocrew.org>
X-Newsreader iForth 2.0 console (October 21, 2006)
Lines 23
Organization Wanadoo
NNTP-Posting-Date 05 Feb 2013 17:07:59 GMT
NNTP-Posting-Host s529d937f.adsl.online.nl
X-Trace 1360084079 dr6.euro.net 251 82.157.147.127:49236
X-Complaints-To abuse@wanadoo.nl
Xref csiph.com comp.lang.forth:19468

Show key headers only | View raw


Lars Brinkhoff <lars.spam@nocrew.org> writes Re: On-the-fly updating of word definitions?

> How about this?  I'm not sure the return address manipulation is portable.
[..]

It works in iForth. However, you forgot "1+" to include the count in the
allotted area. It matters for 64bit Forths.

\ Run time: The return address points to a counted string.
\ Try to find that word, and execute it.  Return to the right place.
: ([ex])   r@ find if execute else count type abort" not found" then
           r> count + align >r ;

\ Compile ([ex]), and append a word name to the definition.
: [execute]   postpone ([ex])  bl word count nip 1+ allot align ; immediate
\ -----------------------------------------------^^

\ Sample usage.
: foo [execute] bar ; \ bar can now be redefined at will
: bar ." hello" cr ;

-marcel

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


Thread

On-the-fly updating of word definitions? AKE <assadebrahim2000@gmail.com> - 2013-02-03 06:18 -0800
  Re: On-the-fly updating of word definitions? Mark Wills <forthfreak@gmail.com> - 2013-02-03 07:15 -0800
    Re: On-the-fly updating of word definitions? AKE <assadebrahim2000@gmail.com> - 2013-02-03 07:25 -0800
  Re: On-the-fly updating of word definitions? Bruno Gauthier <bgauthier@free.fr> - 2013-02-03 16:24 +0100
    Re: On-the-fly updating of word definitions? AKE <assadebrahim2000@gmail.com> - 2013-02-03 07:33 -0800
    Re: On-the-fly updating of word definitions? Mark Wills <forthfreak@gmail.com> - 2013-02-03 09:27 -0800
  Re: On-the-fly updating of word definitions? Paul Rubin <no.email@nospam.invalid> - 2013-02-03 07:34 -0800
    Re: On-the-fly updating of word definitions? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-03 10:32 -0600
      Re: On-the-fly updating of word definitions? "Elizabeth D. Rather" <erather@forth.com> - 2013-02-03 08:44 -1000
    Re: On-the-fly updating of word definitions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-04 16:07 +0000
      Re: On-the-fly updating of word definitions? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-02-04 17:27 -0800
      Re: On-the-fly updating of word definitions? Mark Wills <forthfreak@gmail.com> - 2013-02-04 23:57 -0800
        ACTION-OF (was: On-the-fly updating of word definitions?) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-05 11:45 +0000
        Re: On-the-fly updating of word definitions? stephenXXX@mpeforth.com (Stephen Pelc) - 2013-02-05 12:58 +0000
          Re: On-the-fly updating of word definitions? Mark Wills <forthfreak@gmail.com> - 2013-02-05 05:20 -0800
  Re: On-the-fly updating of word definitions? Lars Brinkhoff <lars.spam@nocrew.org> - 2013-02-05 09:22 +0100
    Re: On-the-fly updating of word definitions? mhx@iae.nl (Marcel Hendrix) - 2013-02-05 18:08 +0200

csiph-web