What is the order of evaluations of parameters inside the function? -


having foo(bar1(), bar2()) can sure in sml evaluate bar1() first , after bar2()?

yes. strictly speaking have function applied tuple. fields of tuple evaluated left right bar1() evaluated before bar2(). see "the definition of standard ml (revised)" milner, tofte, harper , macqueen page 41.

note if foo expression have side-effects or raise exception evaluated before argument , therefore before either bar1() or bar2(). particularly has implications curried applications.

foo (bar1()) (bar2()) 

will evaluate first bar1() foo(bar1value) before evaluating bar2().


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -