commit 8c78ee84f72b344f9901bc14aac566d100e0c05b
parent 5cff8c8e52213881ade1059ae72e41a6ebed53df
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 9 Aug 2022 15:16:34 -0400
Add "does'"
Diffstat:
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/tests/kernel.fs b/fs/tests/kernel.fs
@@ -36,6 +36,8 @@ fooinit
foo 42 #eq
bar 102 #eq
+54 ' foo does' !
+foo 55 #eq
\ case
: foo ( n ) case
diff --git a/fs/xcomp/bootlo.fs b/fs/xcomp/bootlo.fs
@@ -71,7 +71,9 @@
4 const CELLSZ
: alias ' code compile (alias) , ;
: doer code compile (does) CELLSZ allot ;
+\ TODO: 5 is hardcoded, might not work on all arches
: does> r> ( exit current definition ) current 5 + ! ;
+: does' ( w -- 'data ) 5 + CELLSZ + ;
: &+ ( n -- ) doer , does> @ + ;
: &@ ( n -- ) doer , does> @ @ ;
: &w@ ( n -- ) doer , does> @ w@ ;