Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Scheme vs Common Lisp: war stories
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
D Herring  
View profile  
 More options Jul 1 2012, 9:14 pm
Newsgroups: comp.lang.lisp
From: D Herring <dherr...@at.tentpost.dot.com>
Date: Sun, 01 Jul 2012 21:14:53 -0400
Local: Sun, Jul 1 2012 9:14 pm
Subject: Re: Scheme vs Common Lisp: war stories
On 06/27/2012 02:51 PM, Eli Barzilay wrote:

> Kaz Kylheku <k...@kylheku.com> writes:

>> How do you test for it? Say I have some big program which depends on
>> tail recursion in hundreds of places. What if tail recursion isn't
>> happening in some of them?

> Testing tail calls is pretty easy, since it's a syntactically
> verifiable property.  (And in fact there are things that do exactly
> what you want here.)

Having looked at the trace functionality in Racket (do-traced in
collects/racket/tracke.rkt), I'm not seeing the simplicity of
detecting tail calls.  ;)

At least some respectable lispers say to think about tail calls
semantically, not syntactically.  In their eyes, the tail call isn't
an optimization; to create the extra stack frame is a wasteful
pessimization.

I somewhat agree with Kaz; IMO the tail position is a subtlety and it
does not explicitly show intent.  I would like an explicit (tailcall
#'f ...) that acts like funcall, but the compiler signals if the
function is not in a tail call position.  This tailcall form is more
to document intent to other humans (and to catch poorly-written
macros, like a naive TRACE) than it is to help the compiler.  A
corresponding notailcall would force the extra stack frame (presumably
for debugging).

A different name would help too.  Something that better evokes the
elision of a stack frame.  Declarations might work; but CL does not
support them in arbitrary locations...

Maybe I just haven't written enough Scheme code to get a feel for the
culture.  C++ has its share of gotchas that I've learned to live with.

- Daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.