gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] how to use literal?


From: Ethan Gardener
Subject: Re: [gforth] how to use literal?
Date: Fri, 14 Sep 2018 10:05:56 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]