Alex Sandro Queiroz e Silva wrote:
Hallo,
Bob McIsaac escreveu:
The puzzling comment to my humble form said : "This code assumes that arguments to functions are evaluated left-to-right." But what of it? There is a stream of text to be evaluated. Choices are 1. left-right evaluation in one pass; 2. parsing the stream into tokens and sorting the tokens into a tree according to the rules of the grammar ... not Lispy. Choice 1 means typing parentheses so that the evaluator can be simple and recursive. ( I assume that evaluation results in a linked list)
You are confused here. You may believe that evaluating arguments
to functions "in one pass" is the most efficient way, but it may not be. Scheme compilers are free to change the order of evaluation of the arguments to functions at will, so they can find better arrangements. Not all compilers do that, though.
Cheers, -alex
Hi: I am not too worried about efficiency but I must read some more the meaning of evaluation. I thought it was a method of converting expressions into executable code. Perhaps it is more subtle than I realized.
Cheers, -Bob-
Afficher les réponses par date