bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#21510: output


From: igor denisov
Subject: bug#21510: output
Date: Fri, 18 Sep 2015 12:58:56 +0700

; Contract: Number, Number->Number
(defun sub (a b)
        (- a b))

;; Contract: Number, Number->Number
(defun sum (a b)
        (+ a b))

(defvar height-list
        (let ((Hmc 4)
        (step 0.8))
        (setq Hcw (sum Hmc step))
        (setq Hcs (sub Hmc step))
        (setq Htr (sum Hmc step))
        (list Hmc Hcw Hcs Htr)))

(defvar tooth-height-list
  (let ((hmc 0.8)
        (step 0.2))
    (setq hcw (sum hmc step))
    (setq hcs (sub hcw step))
    (setq htr (sum hmc step))
    (list hmc hcw hcs htr)))

(defvar angle-list
  (let ((Amc 70)
        (step 5))
    (setq Acw (sub Amc step))
    (setq Acs (sub Amc step))
    (setq Atr (sub Amc step))
    (list Amc Acw Acs Atr)))

(defvar base-list
  (let ((Bmc 4)
        (step 0.8))
    (setq Bcw (sub Bmc step))
    (setq Bcs Bmc)
    (setq Bcw Bcs)
    (setq Btr Bmc)
    (list Bmc Bcw Bcs Btr)))

(defvar pitch-list
  (let ((Pmc 2)
        (step 1))
    (setq Pcw (sum Pmc step))
    (setq Pcs (sum Pcw step))
    (setq Ptr Pmc)
  (list Pmc Pcw Pcs Ptr)))


;; Number of tooth in a row per 1cm
(defun Nz (pitch-number)
  (100/pitch-number))

;; Number of rows per 1cm
(defun Nr (base-number)
  (100/base-number))

;; parts per square cm
(defun ppsc-calc (a b)
  (* a b))

;; List of numbers of tooth in a row per 1cm
(defun list-of-Nz (pitch-list)
  (if (not pitch-list) ; do again test
      nil
    (cons
     (Nz (car pitch-list))
     (list-of-Nz (cdr pitch-list))))) ;next step expression

;; List of number of rows per 1cm
(defun list-of-Nr (base-list)
  (if (not base-list) ; do again test
      nil
    (cons
     (Nr (car base-list))
     (list-of-Nr (cdr base-list))))) ;next step expression


(defvar list-of-ppsc)

;; List of part per square cm
(defun list-of-ppsc-calc (pitch-list base-list)
  (if (and (not pitch-list)
      (not base-list))
      nil
    (setq list-of-ppsc (cons
     (ppsc-calc (car pitch-list) (car base-list))
     (list-of-ppsc-calc (cdr pitch-list) (cdr base-list))))))

(list-of-ppsc-calc pitch-list base-list)

list-of-ppsc

(defvar PPSCmc)
(defvar PPSCcw)
(defvar PPSCcs)
(defvar PPSCtr)

On issuing the following
(defvar PPSCmc (car list-of-ppsc))
PPSCmc
output is quite strange
8 (#o10, #x8, ?\C-h)
why?





reply via email to

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