Gregor Lingl wrote: > 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.
While it is true that this would be like Python slicing syntax, I think it is potentially too confusing for beginers > > 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?) > neither. See below. > 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) > I *much* prefer this. For beginners, I also prefer to separate words by "_", so I would write the above clear_first(n) clear_last(n) [...] > I don't know how this sounds for native english > speaking people. Perhaps you have better proposals > for naming these functions. > Well, as you know, I am not a native English speaker either. But your function names should be easily understood by non-native English speaker as well, those with a limited grasp of the languge. > > So *any* comment would be highly appreciated. > You'll get more from others, I'm sure. André > 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 -~----------~----~----~----~------~----~------~--~---
