/Я language (β)/Tutorials/Command line task manager 10/

Full source code ⋅ Previous chapter ⋅ Next chapter

Previously we were printing out ASCII characters one by one immediately. This is fine, however you have more control and code look cleaner if you prepare a line before displaying it.

In our case (since we are using Depth behaviour) indentation is a List of Units.

type Indent = List Unit

For each indentation level we need to print out two Space characters:

> indent = level
>> `yok_` Plane @ List
>> `ha__'yo` Glyph `ha` Symbol `ha` Punctuate
>> `ha__` Adapt @ Twice `ho` derive @ List
>> `ha__` Space `hop` Space

Everything is ready to print an individial line - indentation level, task status and task text:

>> `ha___` record `ho` this @ Indent `ho` indent
>>>> `hop_` itself `ho'ut` "TODO " `has` itself `ho'ut` "DONE "
>>>> `ha_` record `ho` this @ Status
>>> `ho__` derive @ List `ha` Merge @ List @ List `ha` Clasp
>>>> `hop_` record `ho` this @ String `ho` Adapt `ho` derive @ List
>>> `ho__` derive @ List `ha` Merge @ List @ List `ha` Clasp