Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

lineread

lineread( 
[ p_inputPort ] 
) 
=> t / nil / l_results

Description

Parses the next line in the input port into a list that you can further manipulate. It is used by the interpreter’s top level to read in all input and understands SKILL and SKILL++ syntax.

Only one line of input is read in unless there are still open parentheses pending at the end of the first line, or binary infix operators whose right-hand argument has not yet been supplied, in which case additional input lines are read until all open parentheses have been closed and all binary infix operators satisfied. The symbol t is returned if lineread reads a blank input line and nil is returned at the end of the input file.

Arguments

p_inputPort

Input port. The default is piport.

Value Returned

t

If the next line read in is blank.

nil

If the input port is at the end of file.

l_results

A list of the objects read in from the next (logical) input line

Examples

lineread(piport)       ; Reads in the next input expression
f 1 2 + ; First input line of the file being read
3 ; Second input line
=> (f 1 (2 + 3))
lineread(piport)
f(a b c) ; Another input line of the file
=> ((f a b c))   ; Returns a list of input objects

Related Topics

gets

infile

linereadstring


Return to top
 ⠀
X