>
> Maybe "lousy" is too strong a word, but aside from
> compatibility with other
> libs/software that use it (which I'll address separately),
> UTF-16 is not
> particularly useful compared to UTF-8 and UTF-32:
...
>
I tried to avoid commenting this because I am afraid we'll stray away from th
Walter Bright Wrote:
> The problem with wchar's is that everyone forgets about surrogate pairs. Most
> UTF-16 programs in the wild, including nearly all Java programs, are broken
> with
> regard to surrogate pairs.
I'm affraid, it will pretty hard to show the bug. I don't know whether java is
"BCS" wrote in message
news:a6268ff14bdc8ccd4a53d496...@news.digitalmars.com...
> IIRC there are a few D users who work for Google (I know there is now at
> least one :D ) but I don't remember who.
Presumably, they'd be the people getting beaten up and shoved into lockers
by the Go developers,
"Ruslan Nikolaev" wrote in message
news:mailman.127.1275974825.24349.digitalmar...@puremagic.com...
>
> True. But even simple string handling is faster for UTF-16. The time
> required to read 2 bytes from UTF-16 string is the same 1 byte from UTF-8.
> Generally, we have to read one code point a
"Ruslan Nikolaev" wrote in message
news:mailman.124.1275963971.24349.digitalmar...@puremagic.com...
Nick wrote:
> It only generates code for the types that are actually
> needed. If, for
> instance, your progam never uses anything except UTF-8,
> then only one
> version of the function will be m
On 08/06/10 17:19, Ellery Newcomer wrote:
On 06/07/2010 11:06 PM, Bernard Helyer wrote:
On 08/06/10 16:00, Ellery Newcomer wrote:
Yeah, it's wrong. (close reads of parse.c are much more useful than
reading the spec. heh.) A peek in my grammar and...
Parameter:
...
BasicType Declarator
BasicT
> You only need to do that where you are shipping closed
> source and for that, it should be trivial to get the
> compiler to generate all three versions.
You will also need to do it in open source projects if you want to include
generated template code into dynamic library as opposed to user's
On 06/07/2010 11:06 PM, Bernard Helyer wrote:
On 08/06/10 16:00, Ellery Newcomer wrote:
Yeah, it's wrong. (close reads of parse.c are much more useful than
reading the spec. heh.) A peek in my grammar and...
Parameter:
...
BasicType Declarator
BasicType Declarator = AssignExpression
BasicType
IIRC there are a few D users who work for Google (I know there is now at
least one :D ) but I don't remember who. For that matter, are there other
D users in the Mountain View/San Jose area?
--
... <
Hello Ruslan,
--- On Tue, 6/8/10, Jesse Phillips wrote:
I think you really need to look more into what templates are and do.
As I said, for libraries you need to compile
every commonly used instance, so that user will not be burdened with
this overhead.
You only need to do that where you
Yes, to clarify what I suggest, I can put it as follows (2 possibilities):
1. Have a special standardized type "tchar" and "tstring". Then, system
libraries as well as users can use this type unless they want to do something
special. There can be a compiler switch to change tchar width (essentia
On 08/06/10 16:00, Ellery Newcomer wrote:
Yeah, it's wrong. (close reads of parse.c are much more useful than
reading the spec. heh.) A peek in my grammar and...
Parameter:
...
BasicType Declarator
BasicType Declarator = AssignExpression
BasicType Declarator ...
Type
Type ...
I probably shoul
Yeah, it's wrong. (close reads of parse.c are much more useful than
reading the spec. heh.) A peek in my grammar and...
Parameter:
...
BasicType Declarator
BasicType Declarator = AssignExpression
BasicType Declarator ...
Type
Type ...
I probably should have filed bug report
Thanks, the important thing to note is that D can do what Go was doing in
the example, Sorry bearophile.
On Mon, 07 Jun 2010 19:55:06 -0500, Andrei Alexandrescu wrote:
> On 06/07/2010 07:44 PM, Jesse Phillips wrote:
>> On Sun, 06 Jun 2010 18:13:36 -0400, bearophile wrote:
>>
>>> At 9.30 you can
--- On Tue, 6/8/10, Jesse Phillips wrote:
> I think you really need to look more into what templates
> are and do.
>
Excuse me? Unless templates are something different in D (I can't be 100% sure
since I am new D), it should be the case. At least in C++, that would be the
case. As I said, fo
On Mon, 07 Jun 2010 19:26:02 -0700, Ruslan Nikolaev wrote:
>> It only generates code for the types that are actually needed. If, for
>> instance, your progam never uses anything except UTF-8, then only one
>> version of the function will be made - the UTF-8 version. If you don't
>> use
>> every c
http://www.digitalmars.com/d/2.0/declaration.html
So, cut down:
Decl
BasicType Declarators ;
BasicType
int
...
BasicType2
*
[] and co
function Parameters
Parameter
Declarator
...
Declarator
BasicType2 Identifier DeclaratorSuffixes (the suffixes are []
[as
Steven Schveighoffer wrote:
a function that takes
a char[] can also take a dchar[] if it is sent through a converter (i.e.
toUtf8 on Tango I think).
In Phobos, there are text, wtext, and dtext in std.conv:
/**
Convenience functions for converting any number and types of
arguments into _
> It only generates code for the types that are actually
> needed. If, for
> instance, your progam never uses anything except UTF-8,
> then only one
> version of the function will be made - the UTF-8
> version. If you don't use
> every char type, then it doesn't generate it for every char
> ty
Ruslan Nikolaev wrote:
Just one more addition: it is possible to have built-in function that
converts multibyte (or multiword) char sequence (even though in my proposal
it can be of different size) to dchar (UTF-32) character. Again, my only
point is that it would be nice to have something simila
Ali Çehreli, el 7 de junio a las 14:41 me escribiste:
> Leandro Lucarella wrote:
>
> >Go doesn't have exceptions, so scope(failure/success) makes no sense.
> >You can argue about if not having exceptions is good or bad (I don't
> >have a strong opinion about it, sometimes I feel exceptions are ni
Walter Bright, el 7 de junio a las 14:42 me escribiste:
> Leandro Lucarella wrote:
> >Please, document this!
> >
> >http://d.puremagic.com/issues/show_bug.cgi?id=4230
>
> Done.
Thanks =)
--
Leandro Lucarella (AKA luca) http://llucax.com.ar/
-
Hello Nick,
"Nick Sabalausky" wrote in message
news:hujd9m$11o...@digitalmars.com...
"Nick Sabalausky" wrote in message
news:hujd6a$11e...@digitalmars.com...
Assuming, of course, a 'max' that works on a range, which would be
easy enough to do. Probably something like:
ElementType!T max(T
"Ruslan Nikolaev" wrote in message
news:mailman.122.1275952601.24349.digitalmar...@puremagic.com...
> Ok, ok... that was just a suggestion... Thanks, for reply about "Hello
> world" representation. Was postfix "w" and "d" added initially or just
> recently? I did not know about it. I thought D
On Mon, 07 Jun 2010 17:48:09 -0400, Ruslan Nikolaev
wrote:
Note: I posted this already on runtime D list, but I think that list was
a wrong one for this question. Sorry for duplication :-)
Hi. I am new to D. It looks like D supports 3 types of characters: char,
wchar, dchar. This is cool
On 08.06.2010 01:16, Ruslan Nikolaev wrote:
Ok, ok... that was just a suggestion... Thanks, for reply about "Hello world" representation. Was
postfix "w" and "d" added initially or just recently? I did not know about it. I thought
D does automatic conversion for string literals.
There is aut
On 06/07/2010 07:44 PM, Jesse Phillips wrote:
On Sun, 06 Jun 2010 18:13:36 -0400, bearophile wrote:
At 9.30 you can see the switch used on a type type :-) You can see a
similar example here:
http://golang.org/src/pkg/exp/datafmt/datafmt.go Look for the line
switch t := fexpr.(type) {
...
Bye,
On Sun, 06 Jun 2010 08:05:32 -0400, Guillaume B. wrote:
> Andrei Alexandrescu wrote:
>
>> http://erdani.com
>>
>> Don't worry, it's SFW :o).
>>
>>
>> Andrei
>
> I've already preordered via amazon in Canada but it doesn't seem that
> it
> will be shipped before June 14... I'll have to wait
On Sun, 06 Jun 2010 18:13:36 -0400, bearophile wrote:
> At 9.30 you can see the switch used on a type type :-) You can see a
> similar example here:
> http://golang.org/src/pkg/exp/datafmt/datafmt.go Look for the line
> switch t := fexpr.(type) {
>
> ...
>
> Bye,
> bearophile
That isn't a type t
Just one more addition: it is possible to have built-in function that converts
multibyte (or multiword) char sequence (even though in my proposal it can be of
different size) to dchar (UTF-32) character. Again, my only point is that it
would be nice to have something similar to TCHAR so that all
Ruslan Nikolaev wrote:
Note: I posted this already on runtime D list,
Although D is designed to be fairly agnostic about character types, in practice
I recommend the following:
1. Use the string type for strings, it's char[] on D1 and immutable(char)[] on
D2.
2. Use dchar's to hold individ
Ok, ok... that was just a suggestion... Thanks, for reply about "Hello world"
representation. Was postfix "w" and "d" added initially or just recently? I did
not know about it. I thought D does automatic conversion for string literals.
Yes, templates may help. However, that unnecessary make code
This doesn't answer all your questions and suggestions, but here goes.
In answer to #1, "Hello world" is a literal of type char[] (or string). If you
want
to use UTF-16 or 32, use "Hello world"w and "Hello world"d respectively.
In partial answer to #2 and #3, it's generally pretty easy to adapt a
On 07/06/10 22:48, Ruslan Nikolaev wrote:
Note: I posted this already on runtime D list, but I think that list
was a wrong one for this question. Sorry for duplication :-)
Hi. I am new to D. It looks like D supports 3 types of characters:
char, wchar, dchar. This is cool, however, I have some qu
Ruslan Nikolaev wrote:
> 1. When we have 2 methods (one with wchar[] and another with char[]),
how D will determine which one to use if I pass a string "hello world"?
I asked the same question on the D.learn group recently. Literals like
that don't have a particular encoding. The programmer m
Ruslan Nikolaev wrote:
1. When we have 2 methods (one with wchar[] and another with char[]),
how D will determine which one to use if I pass a string "hello world"?
String literals in D(2) are of type immutable(char)[] (char[] in D1) by
default, and thus will be handled by the char[]-version
"Nick Sabalausky" wrote in message
news:hujd9m$11o...@digitalmars.com...
> "Nick Sabalausky" wrote in message
> news:hujd6a$11e...@digitalmars.com...
>>
>> Assuming, of course, a 'max' that works on a range, which would be easy
>> enough to do. Probably something like:
>>
>
> ElementType!T max
Note: I posted this already on runtime D list, but I think that list was a
wrong one for this question. Sorry for duplication :-)
Hi. I am new to D. It looks like D supports 3 types of characters: char, wchar,
dchar. This is cool, however, I have some questions about it:
1. When we have 2 metho
On 06/07/2010 04:35 PM, "Jérôme M. Berger" wrote:
Andrei Alexandrescu wrote:
On 06/07/2010 12:57 PM, "Jérôme M. Berger" wrote:
Do this in any dynamic language -> FAIL because looping is so slow that you
might
die of old age before it executes. Besides, who wants to do computationally
intens
On 06/07/2010 04:35 PM, "Jérôme M. Berger" wrote:
Andrei Alexandrescu wrote:
On 06/07/2010 12:57 PM, "Jérôme M. Berger" wrote:
Do this in any dynamic language -> FAIL because looping is so slow that you
might
die of old age before it executes. Besides, who wants to do computationally
intens
Leandro Lucarella wrote:
Please, document this!
http://d.puremagic.com/issues/show_bug.cgi?id=4230
Done.
Leandro Lucarella wrote:
Go doesn't have exceptions, so scope(failure/success) makes no sense.
You can argue about if not having exceptions is good or bad (I don't
have a strong opinion about it, sometimes I feel exceptions are nice,
sometimes I think they are evil), though.
Just to compare th
Andrei Alexandrescu wrote:
> On 06/07/2010 12:57 PM, "Jérôme M. Berger" wrote:
>>> Do this in any dynamic language -> FAIL because looping is so slow that
>>> you might
>>> die of old age before it executes. Besides, who wants to do computationally
>>> intensive, multithreaded work in a dynamic
Mon, 07 Jun 2010 14:06:24 -0400, Nick Sabalausky wrote:
> ""Jérôme M. Berger"" wrote in message
> news:hujboe$tp...@digitalmars.com...
>>Nick Sabalausky wrote:
>>> I actually find that funny. Something in Java that isn't an Object? I
>>> remember "Everything's an object!" being paraded around as
Adam Ruppe, el 7 de junio a las 11:30 me escribiste:
> On 6/7/10, Leandro Lucarella wrote:
> > Yes, they are not implemented exactly the same, but the concept is very
> > similar. And I agree that scope is really a life saver, it makes life
> > much easier and code much more readable.
>
> There
Walter Bright, el 7 de junio a las 11:24 me escribiste:
> Nick Sabalausky wrote:
> >Yea, that's a good example of why I've grown a distaste towards
> >hard-and-fast religious design strategies. The designer inevitably
> >comes across cases where it just doesn't work particularly well,
> >and then
Bill Baxter wrote:
Probably so. What's cenforce do anyway?
private T cenforce(T, string file = __FILE__, uint line = __LINE__)
(T condition, lazy const(char)[] name)
{
if (!condition)
{
throw new FileException(
text("In ", file, "(", line, "), data file ", name), .
Adam Ruppe wrote:
On 6/7/10, Bill Baxter wrote:
Hmm, but I can actually understand your code. :-(
The confusing part is probably cenforce, which is a little helper
function in the std.file module.
cenforce(condition, filename) is the same as
The tldr version of what cenforce does is conv
On 6/7/10, Bill Baxter wrote:
> Hmm, but I can actually understand your code. :-(
The confusing part is probably cenforce, which is a little helper
function in the std.file module.
cenforce(condition, filename) is the same as
if( ! condition)
throw new FileException(filename, __FILE__, __LI
On Mon, Jun 7, 2010 at 12:25 PM, Walter Bright
wrote:
>
> Bill Baxter wrote:
>>
>> Hmm, but I can actually understand your code. :-(
>
> Yeah, but how long would it take you to be sure that it is handling all
> errors correctly and cleaning up properly in case of those errors? It'd
> probably t
Bill Baxter wrote:
Hmm, but I can actually understand your code. :-(
Yeah, but how long would it take you to be sure that it is handling all errors
correctly and cleaning up properly in case of those errors? It'd probably take
me at least 5 intensive minutes. But in the scope version, once y
On Mon, Jun 7, 2010 at 11:19 AM, Walter Bright
wrote:
> Adam Ruppe wrote:
>
>> That sucks hard. I prefer it to finally{} though, since finally
>> doesn't scale as well in code complexity (it'd do fine in this case,
>> but not if there were nested transactions), but both suck compared to
>> the sca
Andrei Alexandrescu:
> Which part of the talk conveyed to you that information?
After thinking well about this question, my conclusion is that I was not just
(as usual) wrong, I was trolling: I didn't know what I was talking about. I am
sorry. I have not even programmed in Go.
Bye,
bearophile
"Walter Bright" wrote in message
news:hujdg6$125...@digitalmars.com...
> Nick Sabalausky wrote:
>> Yea, that's a good example of why I've grown a distaste towards
>> hard-and-fast religious design strategies. The designer inevitably comes
>> across cases where it just doesn't work particularly
"Walter Bright" wrote in message
news:hujd7m$11g...@digitalmars.com...
> Adam Ruppe wrote:
>> That sucks hard. I prefer it to finally{} though, since finally
>> doesn't scale as well in code complexity (it'd do fine in this case,
>> but not if there were nested transactions), but both suck compar
Nick Sabalausky wrote:
Yea, that's a good example of why I've grown a distaste towards
hard-and-fast religious design strategies. The designer inevitably comes
across cases where it just doesn't work particularly well, and then they're
forced to either stay true to their misguided principles by
"Nick Sabalausky" wrote in message
news:hujd6a$11e...@digitalmars.com...
>
> Assuming, of course, a 'max' that works on a range, which would be easy
> enough to do. Probably something like:
>
ElementType!T max(T range) // Corrected
> {
>return reduce!ordinaryMax(range);
>// Or
>re
"Andrei Alexandrescu" wrote in message
news:hujc46$v4...@digitalmars.com...
> On 06/07/2010 12:57 PM, "Jérôme M. Berger" wrote:
>> dsimcha wrote:
>>> == Quote from Walter Bright (newshou...@digitalmars.com)'s article
D is an extremely powerful language, but when I read complaints and
s
Adam Ruppe wrote:
That sucks hard. I prefer it to finally{} though, since finally
doesn't scale as well in code complexity (it'd do fine in this case,
but not if there were nested transactions), but both suck compared to
the scalable, beautiful, and *correct* elegance of D's scope guards.
I agr
""Jérôme M. Berger"" wrote in message
news:hujboe$tp...@digitalmars.com...
>Nick Sabalausky wrote:
>> I actually find that funny. Something in Java that isn't an Object? I
>> remember "Everything's an object!" being paraded around as a selling
>> point.
>>
> Yes, in Java, everything is an object
On 06/07/2010 12:57 PM, "Jérôme M. Berger" wrote:
dsimcha wrote:
== Quote from Walter Bright (newshou...@digitalmars.com)'s article
D is an extremely powerful language, but when I read complaints and sighs about
other languages, few seem to know that these problems are solved with D.
Essentiall
dsimcha wrote:
> == Quote from Walter Bright (newshou...@digitalmars.com)'s article
>> D is an extremely powerful language, but when I read complaints and sighs
>> about
>> other languages, few seem to know that these problems are solved with D.
>> Essentially, we have a marketing problem.
>> One
Nick Sabalausky wrote:
> I actually find that funny. Something in Java that isn't an Object? I
> remember "Everything's an object!" being paraded around as a selling point.
>
Yes, in Java, everything is an object except where that bothered
the language "designers". There are several such
Steven Schveighoffer wrote:
> On Sun, 06 Jun 2010 14:48:27 -0400, Johan Granberg
> wrote:
>
>
>> I also think a set would be highly usefull, and when defining it pleas
>> don't
>> let the set operations (union,intersection,maybe complement) be defined.
>> I
>> recently was writing some c++ code
On 6/7/2010 7:37 AM, Jacob Carlborg wrote:
On 2010-06-06 21:32, Eric Poggel wrote:
On 6/1/2010 5:31 PM, Robert M. Münch wrote:
On 2010-06-01 02:13:18 +0200, Eric Poggel said:
After having difficulty getting ddbg to work, I decided to write a
dump function so I could easily see my data structu
On 6/7/10, Leandro Lucarella wrote:
> Yes, they are not implemented exactly the same, but the concept is very
> similar. And I agree that scope is really a life saver, it makes life
> much easier and code much more readable.
There is one important difference though: Go doesn't seem to have
scope(
Adam Ruppe, el 6 de junio a las 21:24 me escribiste:
> On 6/6/10, Leandro Lucarella wrote:
> > It looks like Go now have scope (exit) =)
>
> Not quite the same (defer is apparently only on function level), but
> definitely good to have. The scope statements are awesome beyond
> belief.
Yes, the
On 06/07/2010 09:02 AM, Kagamin wrote:
Andrei Alexandrescu Wrote:
You get to choose at design time whether you use~OOP for a
particular type, in which case you use \kidx{class}; otherwise,
you go with @struct@ and forgo the particular~OOP amenities that go
hand in hand with reference se
Andrei Alexandrescu Wrote:
> You get to choose at design time whether you
> use~OOP for a particular type, in which case you use \kidx{class};
> otherwise, you go with @struct@ and forgo the particular~OOP amenities
> that go hand in hand with reference semantics.
>
Good, but this is about
On 06/07/2010 06:36 AM, Kagamin wrote:
Andrei Alexandrescu Wrote:
I think an honest discussion - as I hope is the tone in TDPL -
serves the language and its users better than giving half of the
story.
An honest advertisement is an unusual thing. I saw none. You think,
TDPL is the first one. T
On 2010-06-06 21:32, Eric Poggel wrote:
On 6/1/2010 5:31 PM, Robert M. Münch wrote:
On 2010-06-01 02:13:18 +0200, Eric Poggel said:
After having difficulty getting ddbg to work, I decided to write a
dump function so I could easily see my data structures at runtime. The
biggest part of it is a
Andrei Alexandrescu Wrote:
> I think
> an honest discussion - as I hope is the tone in TDPL - serves the
> language and its users better than giving half of the story.
>
An honest advertisement is an unusual thing. I saw none. You think, TDPL is the
first one. There're many features in other la
On Sun, 06 Jun 2010 14:48:27 -0400, Johan Granberg
wrote:
I also think a set would be highly usefull, and when defining it pleas
don't
let the set operations (union,intersection,maybe complement) be defined.
I
recently was writing some c++ code and got a nasty preformance hit from
not
On 06/06/2010 05:13 PM, bearophile wrote:
A recent talk about Go, Google I/O 2010 - Go Programming, the real
talk stops at about 33 minutes:
http://www.youtube.com/user/GoogleDevelopers#p/u/9/jgVhBThJdXc
At 9.30 you can see the switch used on a type type :-) You can see a
similar example here:
h
74 matches
Mail list logo