unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Tutorial question re conventions or usage ??
@ 2007-05-01 17:44 William Case
  2007-05-01 19:31 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: William Case @ 2007-05-01 17:44 UTC (permalink / raw)
  To: EMACS List

Hi;

I am working my way through the Lisp tutorial.

I have come across the following example for the 'beginning-of-buffer'
function:

I can understand the Lisp in this code; the question is about normal
practises when writing similar code. 
...
(if (> (buffer-size) 10000)
           ;; Avoid overflow for large buffer sizes!
           (* (prefix-numeric-value arg)
              (/ (buffer-size) 10))
         (/ (+ 10 (* (buffer-size)
                     (prefix-numeric-value arg)))
...

In this code the writer has reduced the numbers by a factor of 10 in
order, it seems, to get the user to supply a one digit prefix that
none-the-less ends up being a percentage.  

Is this a convention in emacs or the writer's one time personal choice?

It seems intuitive to me (and easier to follow the code) if it had been
written as a percentage from the beginning and doing any factoring by
100.

Should I always be looking for ways to make prefix numbers a single
digit?

Does it matter?  Is there any gain or loss by using a longer or short
prefix digits?
-- 
Regards Bill

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-01 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-01 17:44 Tutorial question re conventions or usage ?? William Case
2007-05-01 19:31 ` Eli Zaretskii
2007-05-01 19:51   ` William Case

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).