Conversation
| because, despite of being safer, wouldn't solve the original problem outlined | ||
| of the summary of this RFC. | ||
|
|
||
| Another possible enhancement would be allowing private functions in the |
There was a problem hiding this comment.
Can you clarify what you mean by a "private function", perhaps with an example?
There was a problem hiding this comment.
@Nikokrock, do you have an example for this? You mentioned that this has been discussed earlier.
There was a problem hiding this comment.
type Bytes is private
with Iterable => (First => First,
Next => Next,
Has_Element => Has_Element,
Element => Unsafe_Get);If you want to have an efficient implementation, it's better to provide a Get_Element that does not checks bounds has this check is already done by Has_Element. Would be great to make in that case Unsafe_Get private (and so only usable through the iterator)
There was a problem hiding this comment.
I am not sure I understand what you mean by "bounds". Note that Get_Element might have a precondition (not executed in production) and not necessarily defensive coding.
#191