Re: how to use literal?

Ethan Gardener <[email protected]>
Newsgroups gmane.comp.lang.forth.gforth
Message-ID <1536915956.3340651.1507879088.0E6FC39E@webmail.messagingengine.com>
On Fri, Sep 14, 2018, at 9:58 AM, Bernd Paysan wrote:
> Am Freitag, 14. September 2018, 10:54:47 CEST schrieb Ethan Gardener:
> > here 1024 allot : mypad literal 1024 ;
> 
> This does not work, because : put a colon-sys on the stack, which literal will 
> then compile into the word.

i see.

> > : mypad [ here 1024 allot ] literal 1024 ;  ok
> 
> This doesn't work, because you ALLOT space inside the definition you just want 
> to write.

oh of course!

> Gforth-specific solution:
> 
> here 1024 allot >r : mypad [ r> ] literal 1024 ;
> 
> That works in Gforth, because you can use >R and R> in the interpreter as long 
> as it is balancing within one line.

thanks!

-- 
The lyf so short, the craft so long to lerne. -- Chaucer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.