ooc-dev team mailing list archive
-
ooc-dev team
-
Mailing list archive
-
Message #00134
Re: Fwd: New ORC - Keyword arguments
Well if we typed (e.g. gave a type to) the arguments it wouldn't need to be
a bag anymore, it could just be just an ArrayList or even a pure ooc array
(upcoming)
Also, I think in ooc 'bag' only means that it can contain anything, but the
order is still retained.
On Mon, May 10, 2010 at 1:34 PM, Bart van der Werf <bluelive@xxxxxxxxx>wrote:
> A bag is not ordered so backing it by a List is ok, but should not really
> be exposed.
> A bag is also not unique on entries so a hashbag should be able to handle
> multiple entries of the same value :)
>
> Why not type the argument btw?
>
> print(fmt: String, args... : [Printable])
>
>
> On Mon, May 10, 2010 at 1:27 PM, Amos Wenger <amoswenger@xxxxxxxxx> wrote:
>
>> I would think '...' is for a Bag, not a HashBag
>>
>> E.g.:
>>
>> print(fmt: String, args...)
>>
>> And then we can iterate with for(arg in args) ?
>>
>> (For the unitiniated: Bag = ArrayList<Cell>, HashBag = HashMap<Cell>.
>> Cell<T> can contain anything.)
>>
>>
>> On Mon, May 10, 2010 at 1:20 PM, Bart van der Werf <bluelive@xxxxxxxxx>wrote:
>>
>>> c# uses the 'params' keyword, personally i like '...' for this
>>> What is the type of arguments ? array of T ?
>>>
>>>
>>> On Mon, May 10, 2010 at 1:00 PM, Friedrich Weber <
>>> fred.reichbier@xxxxxxxxxxxxxx> wrote:
>>>
>>>> Sounds good!
>>>> What about "variable" keyword arguments, as in Python's **kwargs syntax?
>>>> For example:
>>>>
>>>> print: func (hello: String, :keywords) {
>>>> // `keywords` is now a HashBag containing all additional
>>>> arguments.
>>>> }
>>>>
>>>> print("hello world", something="huhu", bla=123,
>>>> gnurk=ArrayList<String>
>>>> new())
>>>>
>>>> Also, default values for arguments would be helpful.
>>>>
>>>> Cheers,
>>>>
>>>> Friedrich
>>>>
>>>> _______________________________________________
>>>> 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
>>
>>
>
Follow ups
References