4 Replies
      Latest reply on Nov 29, 2019 12:57 PM by The Mentat Assassin
      The Mentat Assassin Level 1 Level 1 (0 points)

        I took a look at Swift when it first came out, and was turned off by the inability to do multi-line mathematical expressions.  With the world moving to Swift, I have started looking at Swift 5, and find it still doesn't seem to offer a solution.


        In effect, instead of writing an expression like:


        a = (b+(c+d)*e + f*g)


        I'd prefer to do something like:


             a = (b

                  + (c+d)*e



        and even better still (easy in C):


             a = (b               // some comment

                  + (c+d)*e        // some other comment

                  +f*g)          // yet another comment


        This sort of thing can be important in comprehensible scientific computation.  Is there a way to do it in Swift?