3 ms·
Well Julia sort-of does have interfaces, it’s just that those interfaces are protocols and only conventions (ie there’s no way to say “my type will implement Fo
by dan-robertson 8y ago
Well Julia sort-of does have interfaces, it’s just that those interfaces are protocols and only conventions (ie there’s no way to say “my type will implement Foo interface”). There is an interface for iteration. If you want to implement it then you just have to implement the iterate function for your type and zero and 1 parameters. Similarly the way to say that your type has a length isn’t to implement the HasLength interface but to just implement the length function.