Article View: comp.lang.lisp.x
Article #92n! for xlisp
From: Strong datatypes for weak minds.
Date: Wed, 02 Sep 1992 13:57
Date: Wed, 02 Sep 1992 13:57
23 lines
1204 bytes
1204 bytes
kan@dg-rtp.dg.com was nice enough to mail me this, which works in XLISP V1.1..2.1 and also traps the negative number case: (defun factorial (x) (cond ((> x 1) (* x (factorial (- x 1)))) ((> x -1) 1) (t nil))) I think the error in my ways is that I was using my CP/M laptop where XLISP 1.1 only has integers in the range of -32768 to +37767 and it was too late for me to notice why (factorial 9) didn't work. (Please don't tell me the error in my ways was using CP/M in 1992. I've had my NEC 8400 laptop for ~7 years and can't afford anything that small and more powerful on my income... otherwise I'd be using Scheme or a Forth-variant like UNTIL. Besides, the NEC does words and plays ANSI terminal just fine.) Regards, rcs
Technical Details
Message-ID:
<1674@sousa.ltn.dec.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!decwrl!pa.dec.com!engage.pko.dec.com!nntpd.lkg.dec.com!sousa.ltn.dec.com!kxovax.enet.dec.com!secristShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!decwrl!pa.dec.com!engage.pko.dec.com!nntpd.lkg.dec.com!sousa.ltn.dec.com!kxovax.enet.dec.com!secrist From: secrist@kxovax.enet.dec.com (Strong datatypes for weak minds.) Newsgroups: comp.lang.lisp.x Subject: n! for xlisp Keywords: n! Message-ID: <1674@sousa.ltn.dec.com> Date: 2 Sep 92 13:57:23 GMT Sender: newsa@sousa.ltn.dec.com Organization: Digital Equipment Corporation Lines: 23