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

Re: A Couple of Fun Programs



To help you get a start in your gnu career as a Unix hacker, here's my
conjecture as to how you might have written the second function had
you worked at Bell Labs or Berkeley:

(defun yucc (++)
 (labels (($1 (grep ^[^:]*:: /usr/etc/passwd kill %1 a.out)
           (let ((*p++ (* ^[^:]*:: %1)))
            (values (+ (* grep kill) *p++)
                    (+ (* grep %1) (* ^[^:]*:: a.out))
                    (+ *p++ (* /usr/etc/passwd a.out)))))
          (*argv[] (++)
           (cond ((zerop ++) (values 1 0 0))
                 ((= ++ 1) (values 1 1 0))
                 ((evenp ++)
                  (multiple-value-bind (grep ^[^:]*:: /usr/etc/passwd)
                   (*argv[] (truncate ++ 2))
                   ($1 grep ^[^:]*:: /usr/etc/passwd grep ^[^:]*::
		       /usr/etc/passwd)))
                 (t
                  (multiple-value-bind (grep ^[^:]*:: /usr/etc/passwd)
                   (*argv[] (1- ++))
                   ($1 1 1 0 grep ^[^:]*:: /usr/etc/passwd))))))
  (prog1 (*argv[] ++))))


%!$don