printlev
printlev(g_valuex_levelx_length[p_outputPort] ) => nil
Description
Prints a list with a limited number of elements and levels of nesting.
Lists are normally printed in their entirety no matter how many elements they have or how deeply nested they are. Applications have the option, however, of setting upper limits on the number of elements and the levels of nesting shown when printing lists. These limits are sometimes necessary to control the volume of interactive output because the SKILL top-level automatically prints the results of expression evaluation. Limits can also protect against the infinite looping on circular lists possibly created by programming mistakes.
Two integer variables, print length and print level (specified by x_length and x_level), control the maximum number of elements and the levels of nesting that are printed. List elements beyond the maximum specified by print length are abbreviated as “...” and lists nested deeper than the maximum level specified by print level are abbreviated as &. Both print length and print level are initialized to nil (meaning no limits are imposed) by SKILL, but each application is free to set its own limits.
The printlev function is identical to print except that it takes two additional arguments specifying the maximum level and length to be used in printing the expression.
Arguments
Value Returned
Examples
List = '(1 2 (3 (4 (5))) 6)
=> '(1 2 (3 (4 (5))) 6)
printlev(List 100 2)
(1 2 ...)
=> nil
printlev(List 3 100)
(1 2 (3 (4 &)) 6)
=> nil
printlev(List 3 3 p) ; Assumes port p exists.
(1 2 (3 (4 &)) ...) ; Prints to port p.
=> nil
Related Topics
Return to top