Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
forthy42 committed Dec 28, 2017
2 parents 61c2b58 + 3d0a763 commit 13f7c68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions debugs.fs
Expand Up @@ -172,9 +172,9 @@ is ?warning
\ colon definitions on the current engine
threading-method 0= IF @ THEN ;

: replace-word ( xt2 xt1 -- ) \ gforth
\G make xt1 do xt2, both need to be colon definitions
['] branch >prim-code rot >colon-body rot >colon-body 2! ;
: replace-word ( xt1 xt2 -- ) \ gforth
\G make xt2 do xt1, both need to be colon definitions
swap >colon-body ['] branch >prim-code rot >colon-body 2! ;

\ watching variables and values

Expand Down
3 changes: 1 addition & 2 deletions float.fs
Expand Up @@ -188,8 +188,7 @@ si-prefixes count 2/ + Constant zero-exp
: prefix-number sfnumber ;
[THEN]

: flit, postpone Fliteral ;
' noop ' flit, ' flit, rectype: rectype-float
' noop ' fliteral ' fliteral rectype: rectype-float

: rec-float ( addr u -- r rectype-float | rectype-null )
\G recognize floating point numbers
Expand Down
8 changes: 8 additions & 0 deletions test/gforth.fs
Expand Up @@ -225,3 +225,11 @@ t{ 5. +foo## foo## -> 12. }t
t{ &foo## 2@ -> 12. }t
t{ 7e +foo% foo% -> 17e }t
t{ &foo% f@ -> 17e }t

\ replace-word

t{ : rw-test1 1 ; : rw-test2 2 ; -> }t
t{ rw-test1 -> 1 }t
t{ rw-test2 -> 2 }t
t{ ' rw-test1 ' rw-test2 replace-word -> }t
t{ rw-test2 -> 1 }t

0 comments on commit 13f7c68

Please sign in to comment.