update docs for stream-tell
							parent
							
								
									770405359e
								
							
						
					
					
						commit
						84fd08d86b
					
				| 
						 | 
				
			
			@ -24,7 +24,22 @@ HELP: limit
 | 
			
		|||
        "    \"123456\" <string-reader> 3 stream-throws limit"
 | 
			
		||||
        "    100 swap stream-read ."
 | 
			
		||||
        "] [ ] recover ."
 | 
			
		||||
        "T{ limit-exceeded }"
 | 
			
		||||
"""T{ limit-exceeded
 | 
			
		||||
    { n 1 }
 | 
			
		||||
    { stream
 | 
			
		||||
        T{ limited-stream
 | 
			
		||||
            { stream
 | 
			
		||||
                T{ string-reader
 | 
			
		||||
                    { underlying "123456" }
 | 
			
		||||
                    { i 3 }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            { mode stream-throws }
 | 
			
		||||
            { count 4 }
 | 
			
		||||
            { limit 3 }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}"""
 | 
			
		||||
    }
 | 
			
		||||
    "Returning " { $link f } " on exhaustion:"
 | 
			
		||||
    { $example
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,6 +86,14 @@ HELP: stream-copy
 | 
			
		|||
{ $description "Copies the contents of one stream into another, closing both streams when done." } 
 | 
			
		||||
$io-error ;
 | 
			
		||||
 | 
			
		||||
HELP: stream-tell
 | 
			
		||||
{ $values
 | 
			
		||||
     { "stream" "a stream" } { "n" integer }
 | 
			
		||||
}
 | 
			
		||||
{ $description "Returns the index of the stream pointer if the stream is seekable." }
 | 
			
		||||
{ $notes "Stream seeking is not supported on streams that do not have a known length, e.g. TCP/IP streams." } ;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
HELP: stream-seek
 | 
			
		||||
{ $values
 | 
			
		||||
     { "n" integer } { "seek-type" "a seek singleton" } { "stream" "a stream" }
 | 
			
		||||
| 
						 | 
				
			
			@ -274,8 +282,11 @@ $nl
 | 
			
		|||
}
 | 
			
		||||
"This word is only required for string output streams:"
 | 
			
		||||
{ $subsections stream-nl }
 | 
			
		||||
"This word is for streams that allow seeking:"
 | 
			
		||||
{ $subsections stream-seek }
 | 
			
		||||
"These words are for seekable streams:"
 | 
			
		||||
{ $subsections
 | 
			
		||||
    stream-tell
 | 
			
		||||
    stream-seek
 | 
			
		||||
}
 | 
			
		||||
{ $see-also "io.timeouts" } ;
 | 
			
		||||
 | 
			
		||||
ARTICLE: "stdio-motivation" "Motivation for default streams"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue