Murat Kasimov

More about me

Я language (β)

/Я language (β)/Tutorials/Command line-task-manager-6/

Full source codePrevious chapter

This chapter is going to be the easiest one so far since here we are just gather composing things together.

To receive commands we need to access outer World, to shift a list without losing progress we need State - so let's joint them:

: World `JNT` State `T'I` Scrolling List Title

From now on we can use both World and State in the same expression!

We write this program for console, that's why we should clear previous inputs and turn off character buffering:

> `yuk_` Await `hv` prepare `lu'yp` Await `hv` clear

We store task titles in State, so we should get it contents:

> `yuk_` Lease `ha` State `ha` Event `hv` get

Challenge: how control flow is going to change if you use Apply behaviour instead?

So that we can print them:

> `yuk_` Await `ha` display

User would see a sequence of task titles with a cursor which they could move:

> `yuk_` Await `hv` input `yok` Retry `ha` match

Once we got a proper command, let's update the state:

> `yok_` Apply `ha` State `ha` Event `ha` shift

Challenge: how control flow is going to change if you use Lease behaviour instead?

If we stop at this step, our program would just finish, but we don't want that:

> `yuk_` Again `hv'he` Same