read
read( [p_inputPort] ) =>g_result/nil/t
Description
Parses and returns the next expression from an input port.
Returns the next expression regardless of how many lines the expression takes up - even if there are other expressions on the same line. If the next line is empty, returns t. If the port is positioned at end of file, then it returns nil.
Arguments
Values Returned
Examples
Suppose the file SkillSyntaxFile.il contains the following expressions. A blank line follows the second expression:
define( x 1 )
define( y 2 )
procedure( add( x y ) x+y )
myPort = infile( "SkillSyntaxFile.il" ) => port:SkillSyntaxFile.il" read( myPort )
=> define(x 1)
read( myPort )
=> define(y 2)
read( myPort )
=> t
read( myPort )
=> procedure((add x y) (x + y ) )
read( myPort )
=> nil
close( myPort )
=> t
Related Topics
Return to top