next up previous index
Next: 2-d matrices Up: Miscellaneous Previous: Time and date   Index

text_lines

In text-lines.diesel:

The text_lines data structure represents a series of lines with newlines separating them. The new_text_lines function breaks a string after newlines into separate text lines. The lines function provides access to the lines of text. The indent function adds count spaces to the front of each text line. The as_collector and as_string functions convert the text_lines object to a collector or a flat string representation, with embedded newlines.

extend module Stdlib;
module TextLines;
class text_lines;
  field lines(:text_lines):array[string];
  fun new_text_lines(s:string):text_lines;
  fun indent(tl:text_lines, i:int):void;
  fun as_collector(tl:text_lines):collector[string];
end module TextLines;


next up previous index
Next: 2-d matrices Up: Miscellaneous Previous: Time and date   Index

Cecil/Vortex Project