Skip to content

WIP: Remove white space

Fana Mehari requested to merge remove-white-space into master

In the first iteration, lines is [] and the value of line is the first item from the collection which is nil. The first condition is a predicate, if the condition is true (checking if value of line is nil) evaluate the expression [word] that returns a list of word.

In the second cond expression is evaluated if the condition is true. fits compares the sum length of word, line and white space to the maximum length. If fits is true, append a concatenated line, word and space to previous lines (lines without line)

If fits condition is false, that means the sum length of line, space and word is greater than the maximum length, then the expression of :else is evaluated. That is consing the value of previous-lines to line and returns (line previous-lines) which is then passed as the last argument to (cons word) and returns (word line previous-lines).

Edited by Fana Mehari

Merge request reports