From 1ceedba77388d78cb43279ee24abcc0894e6373b Mon Sep 17 00:00:00 2001 From: Jesse McDonald Date: Tue, 27 Oct 2020 16:59:00 -0500 Subject: [PATCH] redefine 2CONSTANT in terms of CREATE DOES>, saving two cells per use --- startup.4th | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/startup.4th b/startup.4th index 2985123..f679422 100644 --- a/startup.4th +++ b/startup.4th @@ -1255,7 +1255,8 @@ DEFER REFILL : CONSTANT CREATE LATEST >DFA ! ; \ Same for double-cell constants; no DFA trick this time -: 2CONSTANT : POSTPONE 2LITERAL POSTPONE ; ; +: 2CONSTANT ( x1 x2 -- ) CREATE HERE 2 CELLS ALLOT 2! + DOES> ( -- x1 x2 ) 2@ ; \ Define a single-cell named variable which returns its data address when executed. \ The initial value is formally undefined. This implementation sets it to NULL.