[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tutorial question re conventions or usage ??

From: William Case
Subject: Tutorial question re conventions or usage ??
Date: Tue, 01 May 2007 13:44:18 -0400


I am working my way through the Lisp tutorial.

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

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

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]