Scheme (programming language): Difference between revisions

Content deleted Content added
Undid revision 1115354884 by 95.159.85.143 (talk); unexplained removal of infobox
Order of evaluation of procedure arguments: {{mono}} <syntaxhighlight lang="output">
Line 346:
((ev +) (ev 1) (ev 2)))
===> 3
</syntaxhighlight>
<syntaxhighlight lang="output">
: Evaluating 1
: Evaluating 2
: Evaluating procedure
</syntaxhighlight>
ev is a procedure that describes the argument passed to it, then returns the value of the argument. In contrast with other Lisps, the appearance of an expression in the operator position (the first item) of a Scheme expression is quite legal, as long as the result of the expression in the operator position is a procedure.
 
In calling the procedure "{{mono|+}}" to add 1 and 2, the expressions {{mono|(ev +), (ev 1)}} and {{mono|(ev 2)}} may be evaluated in any order, as long as the effect is not as if they were evaluated in parallel. Thus the following three lines may be displayed in any order by standard Scheme when the above example code is executed, although the text of one line may not be interleaved with another because that would violate the sequential evaluation constraint.
 
: Evaluating 1
: Evaluating 2
: Evaluating procedure
 
===Hygienic macros===