Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you look at the linked issue, you will see that it is a type intersection issue (a real language issue) mischaracterized as a control-flow bug. Many readers here seem to see that and believe that if statements in Julia are broken - no that is not the case.


As an end user it may be hard for me to accept that there are no control-flow bugs involved when this code

    println(flag)
    if flag
        println("flow for true.")
    else
        println("flow for false.")
    end
prints

  false
  flow for true.


I pasted that code into a REPL (including setting flag=false, which seems to be implied) and got:

  false
  flow for false.
How did you get your output? Your post implies that if statements are broken in Julia. Untrue.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: