Re: Detecting Infinite Looping

Subject: Re: Detecting Infinite Looping
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Thu, 29 Jan 1998 09:32:18 -0600
At 09:40 AM 1/29/98 +0000, Henry Thompson wrote:
>PS.  You can see the tail recursion more clearly by using a named 'let'
>
>(define f1
> (lambda (arg)
>  (let loop ((x arg)
>             (result BASE))
>    (if P
>      result
>     (loop NEXT (append result (list F)))))))

This is the basic construction I'm using, but I thought I had a problem in
that I'm using a number of separate functions that individually don't have
access to the entire list, but maybe that's just because I didn't think to
pass the list as a parameter to my functions?

The basic logic stream is this:

refatt-to-nodelist
  calls either id-to-nodelist or node-to-nodelist
    id-to-nodelist calls node-to-nodelist
    node-to-nodelist
      calls form-specific xloc-to-nodelist, one for each type of locaddr
        calls either id-to-nodelist or node-to-nodelist as appropriate

I think all I have to do is pass the result list from the highest-level
function to each recursively called function in order to be able to check
membership, right?

Also, what is the significance of the lamba in the above? I've never been
able to grasp the significance of using lamba instead of a simple let
statement.  I know it has something to do with variable binding and scope,
but I'm dashed as to what it is.  I'm the sure the problem is with name
lambda--it means nothing to me (at least with respect to mathematics--it
does have a political connotation, at least in the United States).

Thanks,

E.
--
<Address HyTime=bibloc>
W. Eliot Kimber, Senior Consulting SGML Engineer
Highland Consulting, a division of ISOGEN International Corp.
2200 N. Lamar St., Suite 230, Dallas, TX 95202.  214.953.0004
www.isogen.com
</Address>


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Re: Detecting Infinite Looping, (continued)
    • Richard Light - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id EAA04376Thu, 29 Jan 1998 04:14:50 -0500 (EST)
    • Henry Thompson - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id EAA04681Thu, 29 Jan 1998 04:40:15 -0500 (EST)
    • Pawson, David - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id DAA29108Thu, 29 Jan 1998 03:02:52 -0500 (EST)
    • Gavin Nicol - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id FAA05174Thu, 29 Jan 1998 05:37:26 -0500 (EST)
    • W. Eliot Kimber - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id KAA06902Thu, 29 Jan 1998 10:35:42 -0500 (EST) <=
      • hanche+dsssl-l - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA07915Thu, 29 Jan 1998 13:13:21 -0500 (EST)