logolib, functional programming 
Author Message
 logolib, functional programming

Do you have any good tail call test cases?
Ack, I tackled Goto/Tag/Apply/Throw/Catch today :-)
Quote:
-----Original Message-----

Sent: Wednesday, September 05, 2001 7:55 PM

Subject: Re: [LogoForum] logolib, functional programming

The message below is being cross-posted from comp.lang.logo.  Please reply


>When I was looking at the combination of all the different state
variables,
>I started pulling my hair out.

Yeah, me too!  :-)  If you can really preserve tail call elimination and
correct error messages with a simpler strategy, I'll be really really
happy.

To unsubscribe from this group, send an email to:

LogoForum messages are archived at:
http://www.*-*-*.com/

Your use of Yahoo! Groups is subject to http://www.*-*-*.com/



Fri, 27 Feb 2004 20:34:09 GMT  
 logolib, functional programming

Quote:

>Do you have any good tail call test cases?

Well, first of all, check that the following are in fact tail-called:

run [nontail output tailcall]
run [nontail tailcall stop]
output run [nontail tailcall]
run [nontail tailcall] stop

where NONTAIL is zero or more procedure calls (including primitive and
user-defined procedures) and TAILCALL is the one that shouldn't grow
the stack.  Also, try replacing RUN in these examples with IF "TRUE
and with CATCH "FOO.

Then comes the check for errors.  The basic situation is

        to a
        output b
        end

        to b
        end

Then PRINT A should give the message "B didn't output to A" rather
than either "B didn't output to PRINT" or "A didn't output to PRINT."
Try replacing the line OUTPUT B with all the tail-call trials above.

Situation 2 is

        to a
        b
        end

        to b
        end

Then PRINT A should say "A didn't output to PRINT."

Situation 3:

        to a
        b
        end

        to b
        output 3
        end

PRINT A should now say "You don't say what to do with 3  in A."

Try all of these calling A alone rather than PRINT A and see what
you get.  The general principle is that you should get the same
error message that you'd get if you weren't doing tail call
elimination.



Sat, 28 Feb 2004 04:53:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. logolib, functional programming

2. logolib, functional programming

3. functional.py 0.6 - Functional Programming in Python

4. functional.py 0.7 - Functional programming in Python

5. functional.py - functional programming in Python

6. functional.py 0.7 - Functional programming in Python

7. functional.py 0.6 - Functional Programming in Python

8. functional.py - functional programming in Python

9. US PhD programs strong on functional programming?

10. [TECHNICAL] use of dynamic scope (was Logolib)

11. [TECHNICAL] use of dynamic scope (was Logolib)

12. [TECHNICAL] [MSW LOGO] Logolib

 

 
Powered by phpBB® Forum Software