GNU bug report logs - #21510
output

Previous Next

Package: emacs;

Reported by: igor denisov <saufesma <at> gmail.com>

Date: Fri, 18 Sep 2015 06:00:05 UTC

Severity: minor

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21510 in the body.
You can then email your comments to 21510 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21510; Package emacs. (Fri, 18 Sep 2015 06:00:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to igor denisov <saufesma <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 18 Sep 2015 06:00:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: igor denisov <saufesma <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21510; Package emacs. (Fri, 18 Sep 2015 14:42:02 GMT) Full text and rfc822 format available.

Message #8 received at 21510 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: igor denisov <saufesma <at> gmail.com>, 21510 <at> debbugs.gnu.org
Subject: RE: bug#21510: output
Date: Fri, 18 Sep 2015 07:41:04 -0700 (PDT)
> (defvar PPSCmc (car list-of-ppsc))
> PPSCmc
> output is quite strange
> 8 (#o10, #x8, ?\C-h)
> why?

Didn't bother to read the rest of your message, so apologies
if my guess is wrong.  My guess is that you are wondering
why a number (in this case 8) is shown that way.

If so, that's how Emacs shows a character interactively:
in decimal (8), octal (#o10), hexadecimal (#x8), and as a
character (?\C-h).  (In Emacs Lisp, a character is an
integer.)

So:

(setq foo ?\C-h) ; 8
M-: foo RET ; evaluate foo and print the value
8 (#o10, #x8, ?\C-h)

Same thing for (setq foo 8).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21510; Package emacs. (Sat, 19 Sep 2015 08:20:03 GMT) Full text and rfc822 format available.

Message #11 received at 21510 <at> debbugs.gnu.org (full text, mbox):

From: igor denisov <saufesma <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 21510 <at> debbugs.gnu.org
Subject: Re: bug#21510: output
Date: Sat, 19 Sep 2015 15:19:42 +0700
Do not blame me for persistent as there is something else I stuck upon.

(defvar list-of-ppsc-var
  (list 'PPSCmc 'PPSCcw 'PPSCcs 'PPSCtr))
(defvar list-of-ppsc
   (list 1 2 3 4))

(defun apply-list-to-list (list-of-ppsc-var list-of-ppsc)
  (if  (and (not list-of-ppsc-var)
       (not list-of-ppsc))
       nil
       (setq (car list-of-ppsc-var) (car list-of-ppsc)
       (apply-list-to-list (cdr list-of-ppsc-var) (cdr list-of-ppsc)))))
when I issue the following
(apply-list-to-list list-of-ppsc-var list-of-ppsc)

Debugger entered--Lisp error: (wrong-type-argument symbolp (car
list-of-ppsc-var))
  (setq (car list-of-ppsc-var) (car list-of-ppsc) (apply-list-to-list
(cdr list-of-ppsc-var) (cdr list-of-ppsc)))
  (if (and (not list-of-ppsc-var) (not list-of-ppsc)) nil (setq (car
list-of-ppsc-var) (car list-of-ppsc) (apply-list-to-list (cdr
list-of-ppsc-var) (cdr list-of-ppsc))))
  apply-list-to-list((PPSCmc PPSCcw PPSCcs PPSCtr) (1 2 3 4))
  eval((apply-list-to-list list-of-ppsc-var list-of-ppsc) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

but when I issue
(symbolp (car list-of-ppsc-var))
it is t.

and I do not find any explanation in the manual not even a clue.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21510; Package emacs. (Sat, 19 Sep 2015 14:20:02 GMT) Full text and rfc822 format available.

Message #14 received at 21510 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: igor denisov <saufesma <at> gmail.com>
Cc: 21510 <at> debbugs.gnu.org
Subject: RE: bug#21510: output
Date: Sat, 19 Sep 2015 07:18:58 -0700 (PDT)
> Debugger entered--Lisp error: (wrong-type-argument symbolp (car
> list-of-ppsc-var))
> 
> but when I issue
> (symbolp (car list-of-ppsc-var))
> it is t.

*Evaluating* (car list-of-ppsc-var) produces a symbol.

But the sexp (car list-of-ppsc-var) is itself not a symbol.
It is a list. 

You are trying to do (setq (car list-of-ppsc-var) SOMETHING)
- see the backtrace.  `setq' does not evaluate its first argument.




Added tag(s) notabug. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 19 Sep 2015 21:33:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 21510 <at> debbugs.gnu.org and igor denisov <saufesma <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 19 Sep 2015 21:33:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Oct 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 302 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.