[Sugar-devel] Please review code (was Re: Speak answering maths questions)

Tim McNamara paperless at timmcnamara.co.nz
Tue Jun 1 06:52:11 EDT 2010


Hi Chris, et al.

ref http://pastebin.com/2XNCHGiy

I am most of the way there, as you can see from lines 91 - 143. The function
is attempting to return something that can be read out loud back to a child
if they ask the Speak robot a mathematical question.

My biggest question is the best way to import the functionality from the
Calculate activity. As per silbe's comments on IRC, I'm leaning towards
duplicating the two modules inside of the Speak activity.

I guess I could implement my own parser, I thought about using the ast
module. Then I realised that I would just make a poor replication of the
parser & evaluator that's already been created.

Thoughts/comments welcome.

Tim



On 30 May 2010 05:34, Chris Ball <cjb at laptop.org> wrote:

> Hi Tim,
>
> I'd suggest looking at the parsing logic in the Calculate activity --
> it deals with the same problems.
>
> - Chris.
> --
> Chris Ball   <cjb at laptop.org>
> One Laptop Per Child
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100601/6802f7e9/attachment.htm 


More information about the Sugar-devel mailing list