Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[RFC] Indexing/iteration aspects on unbounded strings #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raph-amiard
Copy link
Member

No description provided.

@raph-amiard raph-amiard changed the title RFC for indexing/iteration aspects on unbounded strings [RFC]: indexing/iteration aspects on unbounded strings May 28, 2019
@raph-amiard raph-amiard changed the title [RFC]: indexing/iteration aspects on unbounded strings [RFC] Indexing/iteration aspects on unbounded strings May 28, 2019
@AdaDoom3
Copy link
Contributor

I agree with this proposal and additionally I believe that Unbounded Strings are already tagged since they are controlled, no?

@raph-amiard raph-amiard added enhancement New feature or request RFC labels Jun 12, 2019
@briot
Copy link

briot commented Jun 14, 2019

When I developed GNATCOLL.Strings, I was really trying to work around some issues with the design of Unbounded_String, so this proposal would fix some of them. The fact that it is visibly tagged would let users use the more natural dot-notation to call methods.

In terms of implementation, GNATCOLL.Strings has some nice tricks to improve performance (generic accessors to get the String value instead of function returning string, optional copy-on-write, small-buffer optimization,...). All of these combine to make a package more flexible than unbounded_string, though the latter is nicer for new comers to the language. Perhaps the standard should think of building those simpler packages based on more general and configurable ones. As mentioned, this would apply to unbounded_string, but could also apply to the standard containers (to control size growth algorithm for vectors, for instance) to give more advanced more control.


versus

.. code-block:: ada
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, this block of code is not displayed when the .rst is rendered.

@yakobowski
Copy link
Contributor

I ilke this proposal a lot. We should try to understand the impact of what is mentioned in the 'drawbacks' section, by using modifying Strings.Unbounded and see whether we can successfully recompile the available codebases that use it.

@sttaft
Copy link
Contributor

sttaft commented Jul 23, 2019

Unbounded string need not be visibly tagged in the current standard, but it does need to be (internally) controlled in so far as automatically recovering storage. So it would not be a major burden to make it visibly tagged.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request RFC stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants