all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.