Hello Matthias & All:

>> But again, I'm not sure that I understood you correctly.
>> Matthias
>
> Your new cookbook entry regarding protecting deferred words from
> subsequent change (ie, "sealing") made it clear that our objectives are
> different. My aim is speed, how to remove a level of indirection that
> was born just as a necessity to solve a forward reference... Discovering
> those Edefer variable calls is not trivial. Originally I thought of
> doing so via a "just-in-time" like method of optimization, ie a
> "runtime" method. Now I think that better would be to optimize the
> bytecode "offline"...

Here is my current solution to eliminating defer indirection in simple
forward reference cases:

variable back&forth
\ use forward referenced word 
: forth&  dp back&forth ! -1 ,  ;  immediate
\ use forward referenced xt 
: &forth  postpone (literal) -1 , dp 1- back&forth !  ;  immediate
\ forward reference resolver (put anywhere in referenced word)
: &back&  latest @ back&forth @ !i  ;  immediate

\ 1st calling 2nd examples:
\
\ : first1  ." first1 " forth& ;
\ : second1  ." second1" &back&  ;
\
\ : first2  ." first2 " &forth execute  ;
\ : second2  ." second2" &back&  ;

Comments or is this "cookbook grade" :-)

Thanks, Enoch.


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to