Minor fixes
parent
28184dc835
commit
2e01391105
|
@ -90,7 +90,8 @@ M: object like drop ;
|
||||||
|
|
||||||
: pop* ( seq -- ) dup length 1- swap set-length ;
|
: pop* ( seq -- ) dup length 1- swap set-length ;
|
||||||
|
|
||||||
: pop ( seq -- ) dup length 1- swap [ nth ] 2keep set-length ;
|
: pop ( seq -- elt )
|
||||||
|
dup length 1- swap [ nth ] 2keep set-length ;
|
||||||
|
|
||||||
: all-equal? ( seq -- ? ) [ = ] monotonic? ;
|
: all-equal? ( seq -- ? ) [ = ] monotonic? ;
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ HELP: pop*
|
||||||
{ $see-also peek pop } ;
|
{ $see-also peek pop } ;
|
||||||
|
|
||||||
HELP: pop
|
HELP: pop
|
||||||
{ $values { "seq" "a resizable mutable sequence" } }
|
{ $values { "seq" "a resizable mutable sequence" } { "elt" "an object" } }
|
||||||
{ $description "Outputs the last element after removing it and shortening the sequence." }
|
{ $description "Outputs the last element after removing it and shortening the sequence." }
|
||||||
{ $side-effects "seq" }
|
{ $side-effects "seq" }
|
||||||
{ $errors "Throws an error if the sequence is empty." }
|
{ $errors "Throws an error if the sequence is empty." }
|
||||||
|
|
|
@ -34,7 +34,7 @@ strings vectors ;
|
||||||
: ?head ( seq begin -- newseq ? )
|
: ?head ( seq begin -- newseq ? )
|
||||||
2dup head? [ length tail t ] [ drop f ] if ;
|
2dup head? [ length tail t ] [ drop f ] if ;
|
||||||
|
|
||||||
: tail? ( seq end -- newseq ? )
|
: tail? ( seq end -- ? )
|
||||||
2dup [ length ] 2apply < [
|
2dup [ length ] 2apply < [
|
||||||
2drop f
|
2drop f
|
||||||
] [
|
] [
|
||||||
|
|
|
@ -21,15 +21,15 @@ HELP: step1b
|
||||||
{ $examples
|
{ $examples
|
||||||
{ $table
|
{ $table
|
||||||
{ "Input:" "Output:" }
|
{ "Input:" "Output:" }
|
||||||
{ "feed" } { "feed" }
|
{ "feed" "feed" }
|
||||||
{ "agreed" } { "agree" }
|
{ "agreed" "agree" }
|
||||||
{ "disabled" } { "disable" }
|
{ "disabled" "disable" }
|
||||||
{ "matting" } { "mat" }
|
{ "matting" "mat" }
|
||||||
{ "mating" } { "mate" }
|
{ "mating" "mate" }
|
||||||
{ "meeting" } { "meet" }
|
{ "meeting" "meet" }
|
||||||
{ "milling" } { "mill" }
|
{ "milling" "mill" }
|
||||||
{ "messing" } { "mess" }
|
{ "messing" "mess" }
|
||||||
{ "meetings" } { "meet" }
|
{ "meetings" "meet" }
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,4 @@ HELP: <plain-writer>
|
||||||
{ $values { "stream" "an input stream" } { "new-stream" "an input stream" } }
|
{ $values { "stream" "an input stream" } { "new-stream" "an input stream" } }
|
||||||
{ $description "Wraps an input stream in a stream supporting the extended stream output protocol in a trivial way." }
|
{ $description "Wraps an input stream in a stream supporting the extended stream output protocol in a trivial way." }
|
||||||
{ $notes "Stream constructors should call this word to wrap streams that do not natively support the extended stream output protocol." }
|
{ $notes "Stream constructors should call this word to wrap streams that do not natively support the extended stream output protocol." }
|
||||||
{ $see "stream-protocol" } ;
|
{ $see-also "stream-protocol" } ;
|
||||||
|
|
Loading…
Reference in New Issue