pseudoPython
Manuel Garcia
news at manuelmgarcia.com
Wed Mar 26 17:58:02 EST 2003
On Wed, 26 Mar 2003 18:18:14 -0000, "Duncan Smith"
<buzzard at urubu.freeserve.co.uk> wrote:
> I'm in the process of writing a paper and I need to include some
>pseudocode. I'd really appreciate it if any pseudocode interpreters could
>give me some feedback on the following. eg. does it rely too heavily on the
>interpreter knowing Python? Obviously, fully understanding this would
>require the text of the paper, but does it clear enough generally (given
>that I'd add a bit about comments / line continuation / indenting code
>blocks)? Cheers.
I agree with Michael Chermside's comments.
It is a shame you just can't submit working Python code, and never
tell them it isn't pseudocode!
you would need some helper functions like
def is_null(x): return x is None
def Set(*a): return a # usually can use lists in place of sets
and then edit out the code that creates the helper functions!
You could also borrow the 'sets' module from the Python 2.3 alpha.
Actually, this would be a pretty painless way to go.
http://www.python.org/dev/doc/devel/lib/set-objects.html
http://www.python.org/dev/doc/devel/lib/set-example.html
to see all the methods and an example, it is pretty complete. The
example is pretty darn readable.
Manuel
More information about the Python-list
mailing list