0

I'm trying to call two separate functions within a function. One function generates and presents a random List to a user and the other function uses the random list and sorts it.

fun getNumber() = (
print "Please enter the number of integers: ";
let
    val str = valOf (TextIO.inputLine TextIO.stdIn)
    val i : int = valOf (Int.fromString str)
    in(
    randomList(i);  
    mergeSortDriver(randomList(i)))
end
);

The above code only executes the mergeSortDriver. I've tried multiple ways such as removing the parentheses, trying nested in statements, and other methods but they do not work or they either give me an error. So how can I call both of these functions and have both present their data?

XXIV
  • 348
  • 1
  • 5
  • 24

1 Answers1

0
fun getNumber() = (
print "Please enter the number of integers: ";
let
    val str = valOf (TextIO.inputLine TextIO.stdIn)
    val i : int = valOf (Int.fromString str)
    in(
    randomList(i), 
    mergeSortDriver(randomList(i)))
end
);

I needed to change the ; to a , within the in statement

XXIV
  • 348
  • 1
  • 5
  • 24