Boo
  1. Boo
  2. BOO-206

Overload assignment operator, and implicit conversion

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.5, 0.9
    • Fix Version/s: 0.9.5
    • Component/s: Compiler
    • Labels:
      None
    • Number of attachments :
      0

      Description

      It would be nice to be able to overload the assignment operator, and convert implicitly:

      class myNum:
      public i as int

      def constructor(j as int):
      i = j

      static def op_Assignment(j as int):
      i = j

      static def op_Addition(x as myNum, y as myNum) as myNum:
      return x.i + y.i // becomes return myNum(x.i + y.i)

      x as myNum = 0 // becomes x as myNum = myNum(0)
      x = 4 // becomes x.op_Assignment(4)

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Bill Wood
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: