It's from Girl Genius, which considers itself "PG." I can never remember if that's older or younger than PG-13, which is what we aim for, so I don't know if I should post the URL of the page it comes from...
Oh yeah, of course; Lisp notation is "actual lists," not parentheses. That's just the text form that gets converted by the reader (which is the name for the program you want someone to write: a Lisp reader).
So... PG is milder than PG-13? Okay for ten-year-olds? Okay for eight-year-olds?
My usual practice for problems of this sort is to turn the text input into a sort of text object that remembers a pointer into itself, so you say (MAKE TEXT OBJECT %string) -> something you can put in a variable. Then you can say (TEXT OBJ %obj NEXT CHAR) -> a character. Also it should be able to UNREAD %char to undo a read, and PEEK CHAR to report the next character without moving the pointer.
Then, you know, it's
SET CH TO (TEXT ... NEXT CHAR)
IF CH=λ ...
ELSE IF CH=( ... // This one has two recursive calls to the parser
Does that help? Or do I have to give you a starter project?
About your project: My idea is that, for example, if you see a λ, then you call PARSE LAMBDA EXPRESSION, which reads a variable name, then makes sure the next thing is a dot, then recursively calls PARSE to parse the body, which is an expression. It seems on a quick read that you want to do everything within a character loop, by maintaining state in random variables.
So you should have PARSE EXPRESSION, PARSE LAMBDA EXPRESSION, and PARSE CALL that call each other as needed.
The tricky part is to handle optional parentheses, if you want to allow them. Otherwise "(" -> PARSE CALL.
PS UNREAD doesn't quite mean PREV CHAR, because it can unread a different character from what used to be in the text.
I've done too much already. (not just with this, but also another few. I have like four more lambda project today. (Edit: technically yesterday, but...)
y key, qwertz and Deutsch
The "y" key on my new phone's keyboard is in a weird spot, but that's because I'm using QWERTZ, which is because I'm using a German keyboard layout. "Zähler", something that counts.
Hmm, how can I explain this? Sometimes you want to send a message to your future self (or your program's future self) by faking the user having typed something.
In principle you might need a message that's several characters long, but it just turns out in practice that often one character is enough.
I dunno, does that help? It's hard to read your mind about this...