Article View: fj.lang.lisp
Article #451tail recursion
From: Hisao Kuroda
Date: Tue, 30 Mar 1993 05:03
Date: Tue, 30 Mar 1993 05:03
76 lines
3521 bytes
3521 bytes
$@?tM}%7%9%F%`$N9uED<wCK$H$$$$$^$9!#(J
$@$$$^!"#L#u#c(J$@#i#d$H#C#M#U$N#C#o#m#m#o#n!]#L#i#s#p$rJ?9T$7$F;H$C$F$$$^$9!#(J
$@<+J,$N=q$$$?$"$k%"%W%j%1!<%7%g%s$r!"#L#u(J$@#c#i#d$GF0$+$9$H!"$I$&$bNI$/Mn(J
$@$A$k$N$G860x$rD4$Y$F$_$k$H!"#L#u#c#i#d$G#C#L#O#S%Q%C%1!<%8$r;H$C$?$H$-(J
$@$K(Jdefmethod$@$N$J$+$G$OKvHx:F5"$r8+$F$/$l$J$$$3$H$K5$$,$D$-$^$7$?!#(J
$@<!$N$h$&$J%U%!%$%k(Jfoo.lisp$@$r:n$C$F(J$@!"(J
$@!]!]!]!]!]!]!]!]!]!]!](Jfoo.lisp$@!]!]!]!]!]!]!]!]!]!]!]!]!]!](J
(defun foo (x) (foo x))
(defmethod bar (x) (bar x))
(defmethod baz ((x list)) (baz x))
$@!]!]!]!]!]!]!]!]!]!]!](Jfoo.lisp$@!]!]!]!]!]!]!]!]!]!](J$@!]!]!]!](J
% lisp-4-0-base
;;; Lucid Common Lisp/SPARC
;;; Development Environment Version 4.0.0, 6 July 1990
;;; Copyright (C) 1985, 1986, 1987, 1988, 1989, 1990, 1991 by Lucid, Inc.
;;; All Rights Reserved
;;;
> (proclaim '(optimize (compilation-speed 0) (safety 1) (speed 3)))
T
> (load "/usr/lucid/clos")
;;; Loading binary file "/usr/lucid/clos.sbin"
#P"/prj1/lucid/clos.sbin"
;;;
;;;$@$^$:!"(Jfoo.lisp$@$r(Jproduction mode$@$G%3%s%Q%$%k!u%m!<%I$7$^$9!#(J
;;;
> (compile-file "foo")
;;; Production mode: (optimize (compilation-speed 0) (safety 1) (speed 3))
;;; Reading source file "foo.lisp"
;;; Warning: File does not begin with IN-PACKAGE. Compiling in package "USER"
;;; While compiling FOO
;;; Warning: A side effect free infinite loop exists.
;;; Writing binary file "foo.sbin"
#P"/prj2/pub/lang/pcl/foo.sbin"
> (load "foo")
;;; Loading binary file "foo.sbin"
#P"/prj2/pub/lang/pcl/foo.sbin"
;;;
;;;$@4X?t(Jfoo$@$K$D(J$@$$$F$O$O$b$A$m$sKvHx:F5"$r8+$F$/$l$F$*$j!"(J
;;;$@%a%=%C%I(Jbar$@$K$D$$$F$b!"KvHx:F5"$r8+$F$/$l$F$$$k$N$G$9$,(J$@!"(J
;;;
> (baz '(1))
Not enough lisp stack to handle interrupt: Handling overflow first.
Expanding main stack due to overflow...
Expanded. Please be patient--it will take a
few minutes to build debugger data structures.
>>Trap: Stack grown due to overflow
;;;
;;;$@%a%=%C%I(Jbaz$@$K$J$k$H!"%9%?%C%/%*!<%P!<%U%m(J$@!<$H$J$C$F$7$^$$$^$9!#(J
;;;
$@;n$7$K#P#C#L$N(J(defvar *pcl-system-date* "August 28 92 PCL (a)")$@$r;H$C(J
$@$F$d(J$@$C$F$_$k$H!"(Jbar,baz$@$H$b$K%9%?%C%/%*!<%P!<%U%m!<$H$J$C$F$7$^$$$^$7(J
$@$?!#(J
$@$A$J$_$K!"#C#M#U!]#C#L(J
CMU Common Lisp 16e, running on dwarf
Loaded subsystems:
Python 1.0, target SPARCstation/Sun 4
CLOS based on PCL version: March 92 PCL (2a)
*
$@$@$H!"(Jdefmethod$@$N$J$+$G$b$A$c$s$HKvHx:F5"$r8+$F$/$l$F$$$^(J$@$9!#(J
$@0lHL$K#C#o#m#m#o#n!]#L#i#s#p$J$j!"$=$N#C#L#O#S$J$j$r;H$C$F%W%m%0%i%_%s(J
$@%0$r$9$k>l9g$KKvHx:F5"=h(J$@M}$r4|BT$7$F%W%m%0%i%`$9$k$3$H$O!"$"$^$j?J$a$i(J
$@$l$?$3$H$G$O$J$$$N$G$7$g$&$+!)(J
--
(define ($@$/$m$@(J $@$R$5(J$@$*(J)
"who'd never ever learned to read or write so well,
but he could type a keyboard just like a-ringin' a bell."
(email kuroda@msi.co.jp))
Technical Details
Message-ID:
<KURODA.93Mar30140358@dwarf.msi.co.jp>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!sh.wide!kogwy!msisun!kurodaShow Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS X-Google-Thread: 1421c0,64b08e38018671e6,start X-Google-Attributes: gid1421c0,public X-Google-ArrivalTime: 1993-03-30 03:54:46 PST Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!sh.wide!kogwy!msisun!kuroda From: kuroda@msi.co.jp (Hisao Kuroda) Newsgroups: fj.lang.lisp Subject: tail recursion Message-ID: <KURODA.93Mar30140358@dwarf.msi.co.jp> Date: 30 Mar 93 05:03:58 GMT Sender: news@msisun.msi.co.jp Distribution: fj Organization: Mathematical System institute Inc, Japan Lines: 76