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