fix stack effect of n*quot, use iota in core/slots
parent
b579d32e5c
commit
7eaa20a4c5
|
@ -272,8 +272,8 @@ HELP: nweave
|
|||
|
||||
HELP: n*quot
|
||||
{ $values
|
||||
{ "n" integer } { "seq" sequence }
|
||||
{ "seq'" sequence }
|
||||
{ "n" integer } { "quot" quotation }
|
||||
{ "quot'" quotation }
|
||||
}
|
||||
{ $examples
|
||||
{ $example "USING: generalizations prettyprint math ;"
|
||||
|
|
|
@ -7,7 +7,7 @@ IN: generalizations
|
|||
|
||||
<<
|
||||
|
||||
: n*quot ( n seq -- seq' ) <repetition> concat >quotation ;
|
||||
: n*quot ( n quot -- seq' ) <repetition> concat >quotation ;
|
||||
|
||||
: repeat ( n obj quot -- ) swapd times ; inline
|
||||
|
||||
|
@ -94,4 +94,4 @@ MACRO: nweave ( n -- )
|
|||
: nappend-as ( n exemplar -- seq )
|
||||
[ narray concat ] dip like ; inline
|
||||
|
||||
: nappend ( n -- seq ) narray concat ; inline
|
||||
: nappend ( n -- seq ) narray concat ; inline
|
||||
|
|
|
@ -222,7 +222,7 @@ M: slot-spec make-slot
|
|||
[ make-slot ] map ;
|
||||
|
||||
: finalize-slots ( specs base -- specs )
|
||||
over length [ + ] with map [ >>offset ] 2map ;
|
||||
over length iota [ + ] with map [ >>offset ] 2map ;
|
||||
|
||||
: slot-named ( name specs -- spec/f )
|
||||
[ name>> = ] with find nip ;
|
||||
|
|
Loading…
Reference in New Issue