A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/HyperSpec/Body/m_w_op_1.htm below:

CLHS: Macro WITH-OPEN-STREAM

CLHS: Macro WITH-OPEN-STREAM Macro WITH-OPEN-STREAM

Syntax:

with-open-stream (var stream) declaration* form*

=> result*

Arguments and Values:

var---a variable name.

stream---a form; evaluated to produce a stream.

declaration---a declare expression; not evaluated.

forms---an implicit progn.

results---the values returned by the forms.

Description:

with-open-stream performs a series of operations on stream, returns a value, and then closes the stream.

Var is bound to the value of stream, and then forms are executed as an implicit progn. stream is automatically closed on exit from with-open-stream, no matter whether the exit is normal or abnormal. The stream has dynamic extent; its extent ends when the form is exited.

The consequences are undefined if an attempt is made to assign the the variable var with the forms.

Examples:

 (with-open-stream (s (make-string-input-stream "1 2 3 4"))
    (+ (read s) (read s) (read s))) =>  6

Side Effects:

The stream is closed (upon exit).

Affected By: None.

Exceptional Situations: None.

See Also:

close

Notes: None.

The following X3J13 cleanup issues, not part of the specification, apply to this section:
Copyright 1996-2005, LispWorks Ltd. All rights reserved.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4