[Tutor] [Fwd: Re: poll question]
denis.spir at free.fr
Wed Nov 26 23:56:07 CET 2008
Alan Gauld a écrit :
> "spir" <denis.spir at free.fr> wrote
>> How would you call this function? e.g.
>> digits = char_range(...)
>> In other words: which is, for you personly, the most practicle or
>> natural way of calling this func? Would you give me one or more
>> calling example(s)?
> I'm not sure what you are asking for.
Actually, my question is so trivial that it is difficult to let you understand
what I want. Imagine you know there is a "char_range" function that returns a
char string -- provided you properly inform it about the range you want. But,
as you do not know exactly its interface, you have to guess. How would imagine
this function should be called? Or, how would you call it spontaneously?
I only ask for the calling format. I can't give an example, unfortunately, as
it will influence your response.
But I can illustrate with an artificial example. If I need a function that
rounds decimal numbers, but have not yet written it, or if this func exists but
I don't or remember its calling format, then I would write e.g.
rounded_decimal = round(decimal, precision)
and e.g. writing
x = round(4.0/3, 2)
*should* let x = 1.33
That's what I expect -- but I may be wrong if I'm not the author. If I write it
personly, then I will let it work so.
That's all I ask for: the calling format.
You can write the func if you like -- but it's really not very challenging ;-)
And I would prefere you to do that *after* answering, because it may change
your answer. You can also try and guess the issue behind my asking -- same
More information about the Tutor