RE: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread David Anthoff
+1 to having a String type that I can just use and it works if I don’t care about any of the encoding subtleties. From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Stefan Karpinski Sent: Monday, September 28, 2015 8:28 AM To: Julia Users

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Daniel Carrera
Sounds interesting. I am very naive when it comes to strings. What re the advantages of the planned String type that can hold arbitrary data? What are the problems with UTF8? Cheers, Daniel. On 28 September 2015 at 17:27, Stefan Karpinski wrote: > There's another reason:

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Stefan Karpinski
Not super interested in getting into it right now. Will make a PR when it's more ready. On Mon, Sep 28, 2015 at 4:15 PM, Daniel Carrera wrote: > Sounds interesting. I am very naive when it comes to strings. What re the > advantages of the planned String type that can hold

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Stefan Karpinski
That's the idea. On Mon, Sep 28, 2015 at 1:06 PM, David Anthoff wrote: > +1 to having a String type that I can just use and it works if I don’t > care about any of the encoding subtleties. > > > > *From:* julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] >

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Stefan Karpinski
There's another reason: I am planning to use `String` as the name of a standard string type in a future version of Julia (hopefully 0.5). This string type will be UTF-8-like but can hold arbitrary data, which will distinguish if from the UTF8String type, which will enforce valid UTF-8 encoding.

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Steven G. Johnson
On Monday, September 28, 2015 at 9:55:27 AM UTC-4, Steven G. Johnson wrote: > > The indices passed to strings in Julia are byte offsets, > (Technically, they are codeunit offsets. In UTF-8, the codeunit is a byte; in UTF-16, the codeunit is a 16-bit word.)

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Steven G. Johnson
On Sunday, September 27, 2015 at 6:31:33 AM UTC-4, Tim Holy wrote: > > I think the only advantage of ASCIIString is that str[8:12] is performant, > because you know the byte offset directly from the index. That's not true > for > UTF8String. The indices passed to strings in Julia are byte

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-27 Thread Milan Bouchet-Valat
Le dimanche 27 septembre 2015 à 11:00 +0200, Daniel Carrera a écrit : > > On 27 September 2015 at 10:39, Milan Bouchet-Valat > wrote: > > Then the default concrete type can be called String or Str, and > > that's > > what people will use. Calling the abstract type String was

[julia-users] Why is String deprecated in favour of AbstractString?

2015-09-27 Thread Daniel Carrera
Why are we changing from String to AbstractString? Obviously, the former is easier to type. Even if there are some changes to the guts of the string implementation, I would have thought that you could just keep the shorter name "String". Cheers, Daniel.

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-27 Thread Milan Bouchet-Valat
Le dimanche 27 septembre 2015 à 00:40 -0700, Daniel Carrera a écrit : > Why are we changing from String to AbstractString? Obviously, the > former is easier to type. Even if there are some changes to the guts > of the string implementation, I would have thought that you could > just keep the

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-27 Thread Gabor
Of course, if you need Greek characters, then use UTF8String, I used ASCIIString just for filenames and atom types. On Sunday, September 27, 2015 at 11:00:17 AM UTC+2, Daniel Carrera wrote: > > > On 27 September 2015 at 10:39, Milan Bouchet-Valat > wrote: >> >> Then the

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-27 Thread Tim Holy
I think the only advantage of ASCIIString is that str[8:12] is performant, because you know the byte offset directly from the index. That's not true for UTF8String. --Tim On Sunday, September 27, 2015 11:00:14 AM Daniel Carrera wrote: > On 27 September 2015 at 10:39, Milan Bouchet-Valat

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-27 Thread Daniel Carrera
Thanks. On 27 September 2015 at 12:31, Tim Holy wrote: > I think the only advantage of ASCIIString is that str[8:12] is performant, > because you know the byte offset directly from the index. That's not true > for > UTF8String. > > --Tim > > On Sunday, September 27, 2015