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


Groups > comp.lang.forth > #45583

Re: 8th version of "create... does>"

From Ron Aaron <rambamist@gmail.com>
Newsgroups comp.lang.forth
Subject Re: 8th version of "create... does>"
Date 2016-02-16 19:31 +0200
Organization A noiseless patient Spider
Message-ID <n9vm7a$5d3$1@dont-email.me> (permalink)
References <n9uvpq$gur$1@dont-email.me> <KZadnaZ99qHVrl7LnZ2dnUU7-S2dnZ2d@supernews.com> <n9vc8s$smk$1@dont-email.me> <2016Feb16.173433@mips.complang.tuwien.ac.at>

Show all headers | View raw


On 16/02/2016 18:34, Anton Ertl wrote:

> The Gforth development version has SET-DOES>, which is similar to the
> USE above.  E.g.:
> 
> : constant ( n "name" -- ) 
>   create , ['] @ set-does> ;

OK.

> Moreover, the fixing up is hard to implement in Forth systems that
> directly compile to flash.

That's actually very interesting, I hadn't considered that.  Though as a
matter of fact in 8th we do need to use "mprotect()" or its equivalent
system calls in order to work properly on mobile devices.  So I guess
we're already compiling directly to flash memory in any event.

> In <http://www.complang.tuwien.ac.at/anton/euroforth/ef15/papers/ertl.pdf>
> I suggest a word DOES-CREATE that does both at once.  The example
> above would become
> 
> : const ( n "name" -- )
>   ['] @ does-create , ;

I'll try to take a look at that, thanks for the information.

> ... And we have an implementation where we have a special "current-word"
> structure that can be changed up to the next definition and is then
> frozen in order to share data between similar words (and then we have
> thought about unfreezing words, changing them, and refreezing them);
> so the fixup approach also causes problems for RAM-based systems;
> maybe we could solve these problems by doing the setup first, and then
> creating the word with a header that does not need further fixups;

Well, "fixing up is hard to do", to badly misquote a song.  Moving bits
of code around is apt to run into issues when some other code calls into
the being-moved-around bits.  So, so far in 8th we don't reclaim any
"forget"-ed words, nor any newly-unused anonymous words.  The amount of
effort to do it without creating problems just doesn't seem like a good
use of my time at present.  Or perhaps you were talking about something
completely different?

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


Thread

8th version of "create... does>" Ron Aaron <rambamist@gmail.com> - 2016-02-16 13:08 +0200
  Re: 8th version of "create... does>" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-02-16 08:33 -0600
    Re: 8th version of "create... does>" Ron Aaron <rambamist@gmail.com> - 2016-02-16 16:41 +0200
      Re: 8th version of "create... does>" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-02-16 08:44 -0600
      Re: 8th version of "create... does>" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-16 16:34 +0000
        Re: 8th version of "create... does>" Ron Aaron <rambamist@gmail.com> - 2016-02-16 19:31 +0200
          Re: 8th version of "create... does>" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-17 17:10 +0000

csiph-web