Reputation: 3629
How can multiple conditions be specified under single if? For example, consider the following java code snippet:
if(a==1 && a>b){
//statements ;
}
How can above code be written in sml? I know that I can achieve the goal by using two if's but still if there is a method to specify in the way I want, then it will be smooth.
Upvotes: 1
Views: 466
Reputation: 179209
SML's equivalent of &&
is andalso
. For ||
there is orelse
:
if a = 1 andalso a > b
then (* ... *)
else (* ... *)
Upvotes: 5