Hi all,

I'm planning on merging a new implementation of strings today (Tues. Dec 8). In 
support of this, it would be great if everyone could hold off on merging new 
code until tomorrow (Wed, Dec 9) so we can get a night of testing with the new 
strings by themselves.

Some things to be aware of about the new string implementation:

* Strings are now implemented as records. They should no longer leak, except 
for a few specific cases that we are expecting to lock down in the (near) 
future.

* If you need to pass a string to an extern routine as a c_string, call 
`my_string.localize().c_str()`. `.localize()` creates a new `string` record on 
your current locale and `.c_str()` gives you a pointer into the string record 
that is suitable to pass out to an C routine as a `char *`.

* The new literal syntax `c"foo bar"` creates a C string literal. As an example:

    var foo = "string" // foo.type == string
    var bar = c"c_string" // bar.type == c_string

* Substring is now performed via indexing operators:

    var my_str = "Hello, world!";
    var my_hello = my_str[1..5]; // my_hello == "Hello"
    var my_w = my_str[8]; // my_w == "w"

* A variety of other string operations are available: find, replace, join, 
split, startsWith, endsWith, ...
    - Detailed documentation on all of the routines is forthcoming.

Thanks,

-Kyle
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to