I have the following (for me) unexpected behavior for an if statement in 
the code below:
It is not the same If I comment out  the line 
data = readdlm("somefile.dat")
or not. even if the "if-statement" is evaluated as false.

The function takes much longer to execute when the line is not commented 
out, with the if-statement 
evaluated as false. Is it that the function readdlm still imported from 
DataFrames, even though
that part of the code is never executed?
(I do get the expected print message of "dont do additional stuff" of 
course...)

thanks
andre

using DataFrames

function foo()
  doAdditionalStuff = 0
  if (doAdditionalStuff) == 1
    println("do additional stuff")
    data = readdlm("somefile.dat")
  else
    println("dont do additional stuff")
  end

  # do regular stuff

end

Reply via email to