In the Android version that I have started working on, am I not going for a
plain text-based I/O model like the normal GNU APL session. This is because
terminal-oriented sessions are quite cumbersome to work with on a small
mobile device.

Instead, I intend to be a bit more clever when rendering results, being
able to do things like collapsing parts of the array, doing searches,
panning them around with the touchscreen. I haven't actually implemented
any of this yet, but those are my rough ideas.

Anyhow, this means that the mainloop looks significantly different compared
to the normal version. And what I realise is happening is that I am
reimplementing most of Command::process_line. I can't really re-use
anything in it because it's such a big single method.

My question is: Would it be possible to break it up into smaller functions
that I can call from the Android interaction loop? Ideally, I would like to
be able to pass a string into a function for evaluation (taking account all
the stuff like the SI stack etc) and simply return a Token that represents
the result of the evaluation. I'm perfectly fine with having the Error
being thrown in case of error.

Commands can be handled separately of course (I intend to present those in
a menu most likely).

Would this be doable?

Regards,
Elias

Reply via email to