-HELP: peek
-{ $values
- { "n" integer }
- { "seq/f" "a sequence or f" }
-}
-{ $description "Reads the next " { $snippet "n" } " elements from the stream and seeks the stream to before the read." } ;
-
-HELP: peek1
-{ $values
- { "elt" "an element or f" }
-}
-{ $description "Reads the next object from a stream and seeks the stream to before the read." } ;
-
-HELP: stream-peek
-{ $values
- { "n" integer } { "stream" "an input stream" }
- { "seq/f" "a sequence or f" }
-}
-{ $contract "Peeks " { $snippet "n" } " elements from the stream. Outputs " { $link f } " on stream exhaustion." }
-{ $notes "Most code only works on one stream at a time and should instead use " { $link peek } "; see " { $link "stdio" } "." }
-$io-error ;
-
-HELP: stream-peek1
-{ $values
- { "stream" "an input stream" }
- { "elt/f" "an element or f" }
-}
-{ $contract "Peeks an element from the stream. Outputs " { $link f } " on stream exhaustion." }
-{ $notes "Most code only works on one stream at a time and should instead use " { $link peek1 } "; see " { $link "stdio" } "." }
-$io-error ;
-