For Programmers: Free Programming Magazines  


Home > Archive > Scheme > September 2006 > optimising









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author optimising
wooks

2006-09-01, 8:01 am

I have

(define match
(lambda (pattern sent)
(letrec ((match* (lambda (pattern matched unmatched)
(cond
[(match pattern unmatched)]
[(empty? matched) #f]
[else (match* yada yada yada.....)))) etc

Should I be bothered by the fact that (match pattern unmatched)
entails an unnecessary reevaluation of the letrec on the recursive
call. Would this be a stylistic concern or a performance issue or both.

William D Clinger

2006-09-01, 8:01 am

wooks wrote:
> I have
>
> (define match
> (lambda (pattern sent)
> (letrec ((match* (lambda (pattern matched unmatched)

...(match ...)...
>
> Should I be bothered by the fact that (match pattern unmatched)
> entails an unnecessary reevaluation of the letrec on the recursive
> call. Would this be a stylistic concern or a performance issue or both.


You should not be bothered by that. The main purpose
of a compiler is to worry about that sort of thing so you
won't have to. (If you aren't using a compiler, then you
must not be terribly concerned about performance anyway.)

So it's a stylistic issue. If you think it's the clearest
way to express the meaning of the program, then go with it.

Will

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com