From: Markus Date: 2004-10-25T12:00:25+09:00 Subject: Re: documentation as source On Tue, 2004-10-19 at 18:23, trans. (T. Onoma) wrote: > On Tuesday 19 October 2004 04:44 pm, Florian Gross wrote: > | trans. (T. Onoma) wrote: > | > But perhaps Mauricio was intending to get rid of the indentation too? In > | > fact I was wondering about that. How does it know code from comment? What > | > about something like this: > | > > | > # Presents a challenge > | > # ex-- > | > # > | > # challenge option > | > # > | > # There are three options: > | > # > | > # jump > | > # sit > | > # stand > | > # > | > def challenge( option ) > | > # ... > | > end > | > | Currently it doesn't. Everything that is indented is assumed to be code. > | If you can think of an algorithm that works better than I would be > | pleased to know about it. > > Well I'm not sure what your doing presently. You could require an indented > remark. > > But I suppose a better option would be more intelligent. What about first > syntax parsing the indented material. If no syntax errors, then good chance > it's Ruby code. I still don't like the whole idea of executing comments. What if someone ignorant of your convention writes something like: # The sudo_shell is a wrapper for running shell commands as root for # people who have the rights. It is powerful and dangerous. For # example, never write anything like: # # sudo_shell "cd \;rm -r -f *" # # or you'll probably regret it. -- Markus (back from Costa Rica, which was wonderful!)