Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #19446
| Newsgroups | comp.lang.forth |
|---|---|
| Subject | Re: On-the-fly updating of word definitions? |
| References | <f4412dce-5396-42ce-8c87-0a6c7ab6f6f4@googlegroups.com> |
| From | Lars Brinkhoff <lars.spam@nocrew.org> |
| Organization | nocrew |
| Date | 2013-02-05 09:22 +0100 |
| Message-ID | <85mwvjgog8.fsf@junk.nocrew.org> (permalink) |
How about this? I'm not sure the return address manipulation is portable.
\ 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 allot align ; immediate
\ Sample usage.
: foo [execute] bar ; \ bar can now be redefined at will
: bar ." hello" cr ;
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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