(func adjust (text width) (def lines (list)) (def word "") (for-each (split text " ") (branch ((eq? 0 (length word)) (redef word _item_)) ((<= (+ (length word) 1 (length _item_)) width) (redef word (concat word " " _item_))) (#true (block (redef lines (append lines word)) (redef word _item_))))) (if (not (eq? 0 (length word))) (append lines word) lines))