Hi, all of you,
currently im experimenting with a feature of my
xturtle module:
there is the function clear which deletes all
items drawn on a turtle-screen without changing
the state of the turtle (when called without
argument).
now im experimenting with clear(n), which
accepts as optional argument an integer n.
It will act differently for positive and
negative n.
example:
clear(5) will delete the first 5 graphic-items
(lines, areas etc) drawn (sort of FIFO-undo)
clear(-5) will delete the last 5 items
drawn. Sort of LIFO-undo. Particularly
clear(-1) will delete the last item drawn.
It's in some way modeled after the indexing-scheme
for lists in Python. If l were the list of items,
clear(n') would delete l[:n] (n>0) and l[n:] (n<0)
respectively.
Question nr. 1:
Is this inutitively ok or would you
prefer the converse. (e.g. clear(1) to
delete the last item, clear(-1) the first one?)
In a discussion with a friend about that topic
there occurred the idea to have (additionally?)
two names for those functions each with
positive arguments only. (A bit similar to
the solution for fill()). He proposed:
clearfirst(n)
clearlast(n)
Another idea was:
clearhead(n) for, ..., yeah, for what?
what's the head in a sequence of lines
the ones drawn at last?
cleartail(n)
Question nr2:
I don't know how this sounds for native english
speaking people. Perhaps you have better proposals
for naming these functions.
I would appreciate it very much to arrive at an intuitivley
clear and simple solution.
So *any* comment would be highly appreciated.
Gregor
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"edupython" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/edupython
-~----------~----~----~----~------~----~------~--~---