Documentation suggestions

Trent Mick trentm at ActiveState.com
Fri Dec 9 12:55:26 EST 2005


[skip at pobox.com wrote]
> 
>     Trent> Nah, the Try Ruby thing is mostly faking it (I believe) rather
>     Trent> than running an actually Ruby interactive session ("bastion'ed"
>     Trent> or not).
> 
> I don't think so.  I tried typing some stuff at the prompt that it wasn't
> asking for, like "x = [1,2,3]" followed by "x * 5" when it was asking me to
> type "2 + 6".  It evaluated both properly as far as I could tell.  

Yah. My guess at what he is doing (and the way I'd probably do this for
Python) is to compile each statement, only allow certain constructs
(like assigning to a variable, defining literals, basic operator usage,
maybe some control flow statements -- although I didn't get that far)
and then execute those.

> OTOH, it
> hung when I entered "def fib(n)".  Never got to the next prompt.  

Punted on continued/multi-line statements maybe?

> Looking at
> the Javascript, it appears to be some sort of Ajaxian thing...

Yup.


Trent

-- 
Trent Mick
TrentM at ActiveState.com



More information about the Python-list mailing list