idea: multiple return values
Posted: Thu Nov 22, 2012 5:25 am
1) what do you think of multiple return values, like in the feature of "Multiple Target assignment"?
it might be easier than wrapping in pairs and tuples or a specific struct.
(I'm learning the hard way keeping to the minimal types)
an example signature would be
def next2(ints as List<of int>) as int, int
the calling side:
a, b = .next2(numbers)
I am not sure if it's a good idea or not. what do you think?
2) another question is with regard to delegates.
to define a method that takes another method, in C# I usually use the Func<,...> or Action<> as a parameter, and later call it with a lambda or a method.
It's unclear to me how to define such a signature in Cobra.
can you clear that up please? (some examples in the doc would do nicely)
thanks alot, kobi
it might be easier than wrapping in pairs and tuples or a specific struct.
(I'm learning the hard way keeping to the minimal types)
an example signature would be
def next2(ints as List<of int>) as int, int
the calling side:
a, b = .next2(numbers)
I am not sure if it's a good idea or not. what do you think?
2) another question is with regard to delegates.
to define a method that takes another method, in C# I usually use the Func<,...> or Action<> as a parameter, and later call it with a lambda or a method.
It's unclear to me how to define such a signature in Cobra.
can you clear that up please? (some examples in the doc would do nicely)
thanks alot, kobi