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

Law of Style



There are two senses of the word ``law'' of interest here. One
is in the sense of a natural law that exists and we observe it,
the other is in the sense of a law obeyed by people using free will.
From the statement of the Law and the responses, I'm not sure to
which Karl is referring. Are we supposed to be searching for
counterexamples to the law, the same way scientists a hundred years
ago tried to find something that went faster than the speed of light?
Or are we engaged in a macho display, such as ``well if you spit on
my mother I'll kill your dog, law or no law.''

I assume that it's a law that we have to obey, and I will engage in the
game of trying to guess a violation of the law, since I don't know what
a violation would look like.

(defmethod hack-positions  ((p1 position) (p2 position))
  (let ((p1-x (x-coord p1))
	(p1-y (y-coord p1))
	(p2-x (x-coord p2))
	(p2-y (y-coord p2)))
    (let ((rho1 (sqrt (+ (* p1-x p1-x) (* p1-y p1-y))))
	  (theta1 (atan p1-y p1-x))
	  (rho2 (sqrt (+ (* p2-x p2-x) (* p2-y p2-y))))
	  (theta2 (atan p2-y p2-x)))
      (let* ((q (f rho2 theta2 rho1 theta1))
	     (r (g q))
	     (s (h r))
	     (tt (i s))
	     (u (j tt)))
        (k u)))))

Is the call (x-coord p1) a violation?  [It is not known whether it is a
slot access or a function call.]  Is the call (x-coord p2) a violation?
[It is invoked on something besides the first argument to the method.]  Is
the call to SQRT a violation?  [Its first argument is a number, but is
related to the first argument to the method.]  How about the call to ATAN?
[Its first argument is related to the second argument to the method
via a LET variable.]  How about the call to f?  [Its first argument is
derived from something related to the second argument to the method.]  The
call to g?  [Its first argument is indirectly related to the arguments to
the method.  The call to h? The call to i? The call to j? The call to k?
[These last 4 are even more remotely related to the arguments to the
method.]

Karl, if you could answer whether anything in HACK-POSITIONS violates the law
and why, we could begin to think about the issue you're raising. If nothing
here violates the law, could *you* provide a method that violates the law?

			-rpg-