bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Command::process_line breakup


From: Elias Mårtenson
Subject: [Bug-apl] Command::process_line breakup
Date: Thu, 5 Jun 2014 22:49:27 +0800

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

[Prev in Thread] Current Thread [Next in Thread]