Closed fdodino closed 8 years ago
I was wondering this is a similar issue yo what happens on strings.
Se could implement it using nixins to avoid logic repetition .
I reported an issue about adding an enunerable protocol some months ago.
However, un both cases a asList method could solve most of the usescases, right?
Implemented a toList() method in Range, I sent a mail a few hours ago...
Hi @fdodino
I was noticing that we don't have a good convention for conversion methods. Some of them are toXYZ
(like toString
) and others are asXYZ
like asSet
.
We should define a convention and stick to it.
See #735
Strings are a bit more complicated, because the will force us to introduce characters as a data type.
I think that Strings have inherently different operations than collections, I don't see why we would do a map or filter... it seems weird and it complicates a very common object that I would prefer to keep simple.
+1 to the mixin idea.
On Sat, Jun 11, 2016 at 5:24 PM, Franco Leonardo Bulgarelli < notifications@github.com> wrote:
I was wondering this is a similar issue yo what happens on strings.
Se could implement it using nixins to avoid logic repetition .
I reported an issue about adding an enunerable protocol some months ago.
However, un both cases a asList method could solve most of the usescases, right?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/uqbar-project/wollok/issues/730#issuecomment-225369694, or mute the thread https://github.com/notifications/unsubscribe/AEa1OTjbgWVLpEkPvYVYz6Bvz30_GenUks5qKtM0gaJpZM4IzkHp .
I'm closing this issue. Please @flbulgarelli add a new issue to complete the task by defining a mixin between collections and ranges.
It would be very useful to use them, like in prime() definition of Wollok Integers. Otherwise I have to code