all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21510: output
@ 2015-09-18  5:58 igor denisov
  2015-09-18 14:41 ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: igor denisov @ 2015-09-18  5:58 UTC (permalink / raw)
  To: 21510

; 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?





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-19 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-18  5:58 bug#21510: output igor denisov
2015-09-18 14:41 ` Drew Adams
2015-09-19  8:19   ` igor denisov
2015-09-19 14:18     ` Drew Adams

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.