Differences From Artifact [be25af156ed3c2de]:
File user/marc/box.rx part of check-in [8ac11923ab] - Add .thread (now used by thread'); .fill to fix margin/width problems in .edge and .rule by marc on 2011-01-18 18:53:00. [annotate] [view]
To Artifact [956ace668efe5c42]:
File user/marc/box.rx part of check-in [600c7f8b01] - Update box.rx -- refactoring. by marc on 2011-01-18 22:43:19. [annotate] [view]
@@ -50,17 +50,19 @@
: .rule ( - ) '| putc '- .fill '| putc ;
( --[ Diagram for N contiguous cells ]---------------------- )
- 6 constant boxRows
+ 6 constant boxRows here boxRows allot constant boxtbl
+
+ boxtbl variable: currentRow
+ : boxRow, @currentRow ! currentRow ++ ;
- here dup boxRows allot constant boxtbl
- [ ( a- ) .edge drop ; ] over ! 1+
- [ ( a- ) .boxedn ; ] over ! 1+
- [ ( a- ) .rule drop ; ] over ! 1+
- [ ( a- ) @ .boxedn ; ] over ! 1+
- [ ( a- ) @ .lookup ; ] over ! 1+
- [ ( a- ) .edge drop ; ] swap !
+ [ ( a- ) .edge drop ; ] boxRow,
+ [ ( a- ) .boxedn ; ] boxRow,
+ [ ( a- ) .rule drop ; ] boxRow,
+ [ ( a- ) @ .boxedn ; ] boxRow,
+ [ ( a- ) @ .lookup ; ] boxRow,
+ [ ( a- ) .edge drop ; ] boxRow,
: (.row) ( aqn-aqn )
repeat dup 0 = if;
push over 1+ push tuck do pop swap pop 1- again ;
@@ -67,9 +69,9 @@
: .row ( aqn- ) cr (.row) 2drop drop ;
: (.cells) ( an- )
- 0 repeat dup 5 > if; dup 1+ push ( ann ) boxtbl + @ ( anq )
+ 0 repeat dup boxRows = if; dup 1+ push ( ann ) boxtbl + @ ( anq )
push 2dup pop swap .row ( an ) pop again ;
( --[ Utility words for finding the RET opcode ]------------ )