4.3BSD/usr/contrib/icon/src/lib/segment.icn

#	SEGMENT(2)
#
#	Segment string
#
#	William H. Mitchell
#
#	Last modified 8/11/84
#

procedure segment(line,dlms)
   dlms := (any(dlms,line[1]) & ~dlms)
   ndlms := ~dlms
   line ? repeat {
      suspend tab(many(ndlms)) \ 1
      suspend tab(many(dlms)) \ 1
      pos(0) & break
      }
end