[plt-scheme] Tail recursion and the Visitor Pattern
Thought I'd try and make this tail recursive and got into a tangle.
class ButLastV extends EmptyException implements IList{
public AList forCons(Object first, AList rest) {
return rest.isEmpty() ?
Empty.ONLY :
new Cons(first, ((AList)rest.accept(this)));
}
}
Then I realised there is no recursive call .... well there is but its of
indirect. Does this make tail recursion in the Visitor Pattern a no no.
_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters!
http://www.msn.co.uk/newsletters