From: ken <ken@cleveland.lug.net>
Cc: <help-gnu-emacs@gnu.org>
Subject: Re: if/else execution in elisp
Date: Sun, 20 Oct 2002 15:36:03 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.33.0210201515540.5092-100000@heidegger.mousecar.net> (raw)
In-Reply-To: <2o_r9.29$Xn2.2736@paloalto-snr1.gtei.net>
Thanks for the vote of confidence. I was starting to doubt reality.
Here's the bigger fragment:
(defun testo-func ()
(setq
zlist '(2 65535 3)
firsto (car zlist)
segundo (car (cdr zlist))
thirdo (cdr (cdr zlist)))
(if (> segundo 44671)
(setq firsto (+ 2 firsto) segundo (- 44672 segundo))
(setq firsto (+ 1 firsto) segundo (+ 20864 segundo))
)
(list firsto segundo thirdo)
)
When I evaluate (test-func), I want to get (4 20863 3), but I'm getting
instead (4 -20863 (3)). The hilarious part is that testo-func works
just fine for a lot of setq'd values.
I'm about to die laughing. Please help it stop.
ken
--
AMD crashes? See http://cleveland.lug.net/~ken/amd-problem/.
Spake Barry Margolin at 20:43 (UTC-0000) on Fri, 18 Oct 2002:
= In article <mailman.1034973328.14861.help-gnu-emacs@gnu.org>,
= ken <ken@cleveland.lug.net> wrote:
= >This should be simple. It is in every other language I've ever used.
= >Here's an if/else:
= >
= > (if (> lb 5)
= > (setq hh (+ 2 hh) lb (+ 4 lb)) ; if true
= > (setq hh (+ 1 hh) lb (+ 3 lb)) ; if false
= > )
= >
= >What I'm trying to do should be obvious. If not:
= >
= >If lb is greater than 5, increment hh and lb by 2 and 4 respectively.
= >If not, increment hh and lb by 1 and 3 respectively.
=
= It looks correct to me. What's the problem you're having?
=
=
next prev parent reply other threads:[~2002-10-20 19:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1034973328.14861.help-gnu-emacs@gnu.org>
2002-10-18 20:43 ` if/else execution in elisp Barry Margolin
2002-10-20 19:36 ` ken [this message]
2002-10-20 21:35 ` Ehud Karni
[not found] ` <mailman.1035149738.4225.help-gnu-emacs@gnu.org>
2002-10-21 20:10 ` Barry Margolin
2002-10-22 4:51 ` Miles Bader
2002-10-17 13:08 ken
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.33.0210201515540.5092-100000@heidegger.mousecar.net \
--to=ken@cleveland.lug.net \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.