← Back to team overview

ooc-dev team mailing list archive

Re: New ORC draft - Properties

 

Yeah, you're probably right about that. Even if it's actually a property with multiple values, that pretty much implies the property should be a collection of some kind.

On Wed, 31 Mar 2010, Amos Wenger wrote:

I think that 'setter with multiple values' qualifies as 'you should use a method instead'. Maybe as a revision in a later ORC, but even if we limit ourselves to the suggested features here, it'll still not be trivial to implement.

On Wed, Mar 31, 2010 at 11:30 PM, Scott Olson <scott@xxxxxxxxxxxxxxx> wrote:
      There is a problem with the current implementation and doing that, Josh. As my ORC describes, the argument of the setter's type is checked against the type of the property. It would only be able to accept a tuple if the properties type was a tuple, and that just
      fits in with all the other collections I mentioned. Now, there was some discussion about having multiple setters with different types for a single property, but for now, I think nddrylliog wants to keep it simple, which seems like a good idea.


On Wed, 31 Mar 2010, Josh Roesslein wrote:

      Also once we have tuples, multiple setter values would also be possible.


      On Wed, Mar 31, 2010 at 8:31 AM, Scott Olson <scott@xxxxxxxxxxxxxxx> wrote:
           If you want to set multiple values in one property, I think you should be using an array or a vector class or any other collection class.

              numbers: ArrayList<Int> {
                  set(list) {
                      // ...
                  }
                  get
              }

              someclass numbers = [1, 2]

           And then there are no extra changes needed.


      On Tue, 30 Mar 2010, Tres Walsh wrote:

           Looks pretty good.

           I noticed that in all of your examples you use set(value)

           would it be make any sense to allow setters to take multiple arguments?

           for instance

             set(value1, value2) { this number = value1 ^ value2 }
             someclass number = 1, 2

           Please note the above example is poor at best. And I can't think of
           any cases where this would happen. I'm just trying to generate
           discussion =)

           On Tue, Mar 30, 2010 at 9:50 PM, Scott Olson <scott@xxxxxxxxxxxxxxx> wrote:
                 I have created a draft ORC for the new Property syntax that was much
                 discussed in the IRC channel. I hope it is informative and exlempatory of
                 what an ORC should look like. ^.^

                 Link: http://github.com/tsion/middleearth/blob/master/drafts/Properties.md

                 - Scott Olson

                 _______________________________________________
                 Mailing list: https://launchpad.net/~ooc-dev
                 Post to     : ooc-dev@xxxxxxxxxxxxxxxxxxx
                 Unsubscribe : https://launchpad.net/~ooc-dev
                 More help   : https://help.launchpad.net/ListHelp


      _______________________________________________
      Mailing list: https://launchpad.net/~ooc-dev
      Post to     : ooc-dev@xxxxxxxxxxxxxxxxxxx
      Unsubscribe : https://launchpad.net/~ooc-dev
      More help   : https://help.launchpad.net/ListHelp





_______________________________________________
Mailing list: https://launchpad.net/~ooc-dev
Post to     : ooc-dev@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ooc-dev
More help   : https://help.launchpad.net/ListHelp




References