News for hackers. Stuff that matters.
Re:Comparison of Haskell and Julia List Comprehensions by BadInformatics on Wednesday July 07, 2021 @02:25PM (#27764251)
Note that because blocks in Julia are expressions, you can do multi-line expressions in comprehensions that you wouldn't be able to do in Python:

    [
       let y = x + 1
         z = 2y
         -z
       end 
       for x in 1:5
    ]
Re:Comparison of Haskell and Julia List Comprehensions by eesmith on Wednesday July 07, 2021 @03:40PM (#27764993)
This specific case could be approximated with something like:

  >>> [(y:=x+1, z:= 2*y, -z)[-1] for x in range(1, 6)]
  [-4, -6, -8, -10, -12]
Re:Comparison of Haskell and Julia List Comprehensions by tpoacher on Thursday July 08, 2021 @04:41AM (#27769575)
or, to state the obvious:

  def _(x): y = x+1; z = 2*y; return -z
  [ _(x) for x in range(1,6) ]