the code goes like:
- fun foo(a : int, b :int) =
= if a > b
= then []
= else [a] @ foo(a+1, b)
= ;
val foo = fn : int * int -> int list
- foo(1, 100);
val it = [1,2,3,4,5,6,7,8,9,10,11,12,...] : int list
the function intend to construct a list from a to b, if a is greater or equal than b, otherwise a empty list will be created. when I run the function foo with parameter bound to
1 and 100 for a and b respectively, I got the interesting result:
[1,2,3,4,5,6,7,8,9,10,11,12,...]
what does the … here mean?
It just means that your SML system (SML-NJ, I assume) has omitted part of the output in order to keep the display from becoming overly long. Here it is in a different SML system, Moscow ML: