Am 30.05.2010 23:53, schrieb Philippe Sigaud:
There are some simple containers I'd like to see in std.containers:
- a priority queue
- a heap
- a stack, a queue
- a set
Do people here also consider them as containers and useful ones in a standard
library?
Philippe
and a range based tree (
Hello Walter,
BCS wrote:
For that matter, how many expert language designers are there in the
world? To make that have an answer, I've heard it said that to be an
expert you need to have done something consistently (like as a part
time job or more) for about 10 years. So Walter's and expert co
BCS wrote:
For that matter, how many expert language designers are there in the
world? To make that have an answer, I've heard it said that to be an
expert you need to have done something consistently (like as a part time
job or more) for about 10 years. So Walter's and expert compiler writer
Hello Walter,
Jérôme M. Berger wrote:
Of course, using a decent editor will prevent it: if the editor is
able to handle indentation correctly, it will indent the writeln in
the same column as the for which makes the problem appear
immediately.
I think it is a serious mistake to design a lang
Hello bearophile,
Because (as you can see in my
example) you can use/read/write an out argument before calling the
function (if you write it before function call, such value gets
overwritten), or just after the function entry, and such usages while
"safe" are not nice.
I've used C# and I can r
Walter Bright, el 1 de junio a las 17:18 me escribiste:
> Leandro Lucarella wrote:
> >LTO is not only targeted at C++. I don't have numbers to talk seriously
> >about how a big gain is for C though, which might be closer to D in
> >terms of parse time compared with the whole compilation process. E
Hello Walter,
bearophile wrote:
Walter Bright:
C got it right and it doesn't need fixing.
I have never programmed in Go, but keep in mind that Go designers are
expert language designers and programmers. They aren't stupid people.
Even experts make mistakes.
For that matter, how many e
On Tue, 01 Jun 2010 21:15:45 -0400, Adam Ruppe wrote:
> On 6/1/10, Nick Sabalausky wrote:
>> What I do like is what Programmer's Notepad 2 does: when I hit "Enter",
>> it auto-indents the new line exactly the same as the line above it.
>
> Vim does the same. When I'm using some other editor, I a
I think I figured how to define BinaryHeap properly.
Currently BinaryHeap is parameterized by its storage support, which must
be a random-access range.
It is easy to make BinaryHeap figure out whether its support is a
random-access _container_ versus a random-access range. In the former
case
On 06/01/2010 08:53 PM, bearophile wrote:
Andrei Alexandrescu Wrote:
Walter and I agreed to let it go, but somehow forgot to
announce it.
Are stack-allocated (scoped) classes too gone?
De facto no, de jure yes.
Andrei
On 06/01/2010 08:29 PM, Ellery Newcomer wrote:
On 06/01/2010 08:17 PM, Andrei Alexandrescu wrote:
On 06/01/2010 07:35 PM, bearophile wrote:
Andrei Alexandrescu:
Sorry, class allocators are gone.
I must have missed the memo :o) Can you explain a bit?
It was an ill-defined misfeature that di
Andrei Alexandrescu Wrote:
> Walter and I agreed to let it go, but somehow forgot to
> announce it.
Are stack-allocated (scoped) classes too gone?
Bye,
bearophile
On 06/01/2010 08:17 PM, Andrei Alexandrescu wrote:
On 06/01/2010 07:35 PM, bearophile wrote:
Andrei Alexandrescu:
Sorry, class allocators are gone.
I must have missed the memo :o) Can you explain a bit?
It was an ill-defined misfeature that didn't deserve to stay in the
language. Walter and
On 06/01/2010 07:35 PM, bearophile wrote:
Andrei Alexandrescu:
Sorry, class allocators are gone.
I must have missed the memo :o) Can you explain a bit?
It was an ill-defined misfeature that didn't deserve to stay in the
language. Walter and I agreed to let it go, but somehow forgot to
anno
On 6/1/10, Nick Sabalausky wrote:
> What I do like is what Programmer's Notepad 2 does: when I hit "Enter", it
> auto-indents the new line exactly the same as the line above it.
Vim does the same. When I'm using some other editor, I always end up
hitting tab or backspace too many times, expecting
"Alex Makhotin" wrote in message
news:hu438s$jc...@digitalmars.com...
> Nick Sabalausky wrote:
>> I've used editors that keep trying to re-arrange my code as I type (ex,
>> Visual Studio) and I find it to be annoying as hell. It just gets in my
>> way, even when it does correctly guess what I
Nick Sabalausky:
> Also, note that I haven't even tossed call-chaining or templates into the
> mix.
You can also add to the mix the C labels used by goto and break, the in{} out{}
body{} contract programming syntax, and the private:/public: attributes too,
they give me code formatting troubles
Robert Clipsham:
>This may be true, but the overhead of loading/setting up a JIT environment at
>compile time will have a horrific effect on compile time for most D apps, it
>will only show an advantage where there's a lot of CTFE used.<
A JIT that is not trash is able to start only when it is
Walter Bright wrote:
I gotta believe that if you're writing Fortran functions and expecting
them to be inlined into C code, or other such function-by-function
language mixing, things are getting desperate.
I have experienced a runtime disaster after executing exe which
successfully linked
"Steven Schveighoffer" wrote in message
news:op.vdm3e1fbeav...@localhost.localdomain...
> On Wed, 02 Jun 2010 16:50:05 -0400, Alex Makhotin
> wrote:
>>
>> I prefer ANSI(Allman) style(second example, wrong).
>> They want to force Java-like style which I dislike much.
>
> I do too. You will not
Andrei Alexandrescu:
> Sorry, class allocators are gone.
I must have missed the memo :o) Can you explain a bit?
Bye,
bearophile
Leandro Lucarella wrote:
LTO is not only targeted at C++. I don't have numbers to talk seriously
about how a big gain is for C though, which might be closer to D in
terms of parse time compared with the whole compilation process. Even
more, you can do LTO for object files generated from different
On 06/01/2010 06:09 PM, Walter Bright wrote:
For example, many years ago, Microsoft came out with "incremental
linking" as a cool new feature to speed up the link process. This got a
lot of buzz in the press. My manager at the time decided we need an
"incremental linking" feature in order to catc
On 06/01/2010 06:41 PM, Masahiro Nakagawa wrote:
On Wed, 02 Jun 2010 06:29:12 +0900, Robert M. Münch
wrote:
On 2010-05-31 17:01:16 +0200, Trass3r said:
Isn't http://digitalmars.com/d/2.0/class.html#ClassAllocator what you
want?
Ah, that's cool. Didn't saw it. This looks very good. Will tho
Don, el 1 de junio a las 20:15 me escribiste:
> Michiel Helvensteijn wrote:
> >Adam Ruppe wrote:
> >
> >>>You save time by recompiling only files that have changes.
> >>But, then the whole program goes through the process again anyway to
> >>perform the optimization. You save a little time in skip
On 06/01/2010 06:27 PM, Walter Bright wrote:
Bill Baxter wrote:
Computer languages exist to make life easier for their human users.
So I keep thinking that rather than limit the language's options in
terms of grammar, it would be better to just provide an easy-to-use
parsing library for the lang
it doesn't really need itself to compile itself anymore (there's only 1
or 2 files), but for posterity's sake:
http://personal.utulsa.edu/~ellery-newcomer/dmdz/dmdz.zip
Rewrote split or whatever it was to be a bidirectional range.
Also wrote a nifty join implementation (of which I am very prou
On 02/06/10 00:45, bearophile wrote:
With some work LLVM can be used to JIT-compile the D compile-time
functions, so they can probably run quite faster.
This may be true, but the overhead of loading/setting up a JIT
environment at compile time will have a horrific effect on compile time
for mo
Walter Bright:
> I've thought many times about adding a D lexer & parser to the standard
> library.
> It's a good idea.
So a D (front-end) written in D can use it while it compiles itself :-)
Bye,
bearophile
Walter Bright:
>dmd inlines delegates to templates when they are passed as alias parameters.<
A functional language (Scala is partially a functional language) uses functions
everywhere, so inlining of closures is a desired optimization feature.
>I know you're a fan of LLVM,<
With some work LL
On Wed, 02 Jun 2010 06:29:12 +0900, Robert M. Münch
wrote:
On 2010-05-31 17:01:16 +0200, Trass3r said:
Isn't http://digitalmars.com/d/2.0/class.html#ClassAllocator what you
want?
Ah, that's cool. Didn't saw it. This looks very good. Will those clases
be GCed?
Default no. Documentatio
I'm considering to add the D code semantic awareness to the
IDE which I develop.
Before I start working on it I want to clarify some questions to remove
potential confusion in the future.
I would like to use the DMD front end for this purpose.
As I understand from the DMD front end readme.txt fi
Bill Baxter wrote:
Computer languages exist to make life easier for their human users.
So I keep thinking that rather than limit the language's options in
terms of grammar, it would be better to just provide an easy-to-use
parsing library for the language that makes adding editor support
simple.
bearophile wrote:
Walter Bright:
Firstly, this is not a back end vs front end issue. A compiler can do it in
either place, neither is inherently better than the other.<
You are right. This thread has gone in wrong directions. What I meant was:
Scala language is designed to use delegates ofte
Nick Sabalausky wrote:
I've used editors that keep trying to re-arrange my code as I type (ex,
Visual Studio) and I find it to be annoying as hell. It just gets in my way,
even when it does correctly guess what I want. And often it doesn't, because
I tend to type code in a very non-linear way
"Jérôme M. Berger"" wrote in message
news:hu3r8t$1t...@digitalmars.com...
>
I've used editors that keep trying to re-arrange my code as I type (ex,
Visual Studio) and I find it to be annoying as hell. It just gets in my way,
even when it does correctly guess what I want. And often it doesn't,
Tue, 01 Jun 2010 17:44:57 -0500, Andrei Alexandrescu wrote:
> On 06/01/2010 05:34 PM, retard wrote:
>> When a Haskell developer invents something like SafeD, he/she
>> immediately opens safed-spec.tex in vim or emacs. The paper is precise
>> and published on the standard web site. It might even ge
On 06/01/2010 05:34 PM, retard wrote:
When a Haskell developer invents something like SafeD, he/she immediately
opens safed-spec.tex in vim or emacs. The paper is precise and published
on the standard web site. It might even get a presentation in some FPL
conference. When D gets a new feature, th
Jonathan M Davis:
> However, there are cases where you really want the function to be returning
> a single value - particularly when you're feeding the result into an
> expression - and it's nice to be able to still get other values out of the
> function with out or ref parameters.
I have not a
Walter Bright wrote:
Code should pass, or it should
not. Not sort of, kind of, maybe, depending on switch settings.
I agree. That is what option /WX (treat warning as errors) is about.
Excuse me for the broken clock(messages seems to appear incorrectly
again :(, I should fix this soon). Why
Walter Bright:
>Firstly, this is not a back end vs front end issue. A compiler can do it in
either place, neither is inherently better than the other.<
You are right. This thread has gone in wrong directions.
What I meant was: Scala language is designed to use delegates often. For
example the ma
Tue, 01 Jun 2010 05:02:45 +, BCS wrote:
> Hello Don,
>
>> BCS wrote:
>>
>>> Hello retard,
>>>
Mon, 31 May 2010 18:23:18 +0200, Pelle wrote:
> On 05/31/2010 05:43 PM, retard wrote:
>
>> For example the lambda syntax is terribly verbose in D compared to
>> Scala or
"bearophile" wrote in message
news:hu3pu5$310...@digitalmars.com...
> Jacob Carlborg:
>> Making parenthesis optional in function calls and semicolons make quite
>> a nice delegate literal syntax:
>>
>> loop {
>> // do something
>> }
>
> It looks also like the Ruby blocks. But D seems designed to
On Tue, Jun 1, 2010 at 2:24 PM, Walter Bright
wrote:
> Jérôme M. Berger wrote:
>>
>> Of course, using a decent editor will prevent it: if the editor is
>> able to handle indentation correctly, it will indent the writeln in
>> the same column as the for which makes the problem appear immedia
bearophile wrote:
> Walter Bright:
>> > Out parameters are initialized at function entry, so in theory all is
>> > good and there are no bugs, but this is a *workaround*, a language
>> > kludge, a hack, something dirty that is done because of language
>> > limitation, or to keep the language compa
Tue, 01 Jun 2010 05:19:55 -0400, #ponce wrote:
>> For example the lambda syntax is terribly verbose in D compared to
>> Scala or Haskell.
>>
>>
> It may seem surprising to you, but there is a lot of project who can't
> afford using Scala or Haskell.
>
> If you're constrained to use D at your da
Walter Bright:
> > Out parameters are initialized at function entry, so in theory all is good
> > and there are no bugs, but this is a *workaround*, a language kludge, a
> > hack,
> > something dirty that is done because of language limitation, or to keep the
> > language compatible with an ancien
Walter Bright:
> Before you joined us, there were huge flamefests about this.
I don't know about turning them all into errors, but the missing "override"
warning is better as an error, as in C#:
http://d.puremagic.com/issues/show_bug.cgi?id=383
The warnings generated by the examples here can bec
> http://d.puremagic.com/issues/show_bug.cgi?id=383
Sorry, I meant:
http://d.puremagic.com/issues/show_bug.cgi?id=3836
bearophile wrote:
Walter Bright:
bearophile wrote:
I meant that D seems designed to not assume that the back-end is able to
inline delegates, and indeed at the moment usually not even LLVM is able
to do it (while Scala compiler is able to often perform this
optimization, and gives the JavaVM
On 06/01/2010 05:06 PM, Walter Bright wrote:
Andrei Alexandrescu wrote:
On 06/01/2010 04:36 PM, Walter Bright wrote:
Alex Makhotin wrote:
In contrast, Microsoft C/C++ does(with opt. /Wall):
warning C4390: ';' : empty controlled statement found; is this the
intent?
I think it's correct way i
bearophile wrote:
Walter Bright:
bearophile wrote:
D language isn't even able to tell if an "out" argument has being used
before it is assigned inside the function (as C# compiler is able to,
because in C# using uninitialized variables is an error) This is awful
and surely worse than multiple
Andrei Alexandrescu wrote:
On 06/01/2010 04:36 PM, Walter Bright wrote:
Alex Makhotin wrote:
In contrast, Microsoft C/C++ does(with opt. /Wall):
warning C4390: ';' : empty controlled statement found; is this the
intent?
I think it's correct way it should be done.
Warnings are wishy-washy l
Walter Bright:
> bearophile wrote:
> > I meant that D seems designed to not assume that the back-end is able to
> > inline delegates, and indeed at the moment usually not even LLVM is able to
> > do it (while Scala compiler is able to often perform this optimization, and
> > gives the JavaVM code
Jérôme M. Berger wrote:
for (int i = 0; i < 10; i++);
writeln(i);
I have seen students waste minutes locating that bug.
I've seen a whole afternoon lost on that one.
Of course, using a decent editor will prevent it: if the editor is
able to handle indentation correctly, it will i
Walter Bright:
> bearophile wrote:
> > D language
> > isn't even able to tell if an "out" argument has being used before it is
> > assigned inside the function (as C# compiler is able to, because in C# using
> > uninitialized variables is an error) This is awful and surely worse than
> > multiple
I'm not sure what this has to do with D, but it's funny:
http://www.youtube.com/watch?v=RowwNXKEt4k
Andrei Alexandrescu:
> And by the way, I added the feature that will ease bearophile's coding
> by one order of magnitude: iota with one argument.
Thank you. There's a long way to go still :o)
Bye,
bearophile
Alex Makhotin wrote:
In contrast, Microsoft C/C++ does(with opt. /Wall):
warning C4390: ';' : empty controlled statement found; is this the
intent?
I think it's correct way it should be done.
Warnings are wishy-washy language design. Code should pass, or it should not.
Not sort of, kind of,
On 06/01/2010 04:36 PM, Walter Bright wrote:
Alex Makhotin wrote:
In contrast, Microsoft C/C++ does(with opt. /Wall):
warning C4390: ';' : empty controlled statement found; is this the
intent?
I think it's correct way it should be done.
Warnings are wishy-washy language design. Code should
bearophile wrote:
I meant that D seems designed to not assume that the back-end is able to
inline delegates, and indeed at the moment usually not even LLVM is able to
do it (while Scala compiler is able to often perform this optimization, and
gives the JavaVM code already optimized in this regard
bearophile wrote:
D language
isn't even able to tell if an "out" argument has being used before it is
assigned inside the function (as C# compiler is able to, because in C# using
uninitialized variables is an error) This is awful and surely worse than
multiple return values.
That's a misunder
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 json encoder which can handle most D
structures. If I recall, it only has trouble
Andrei Alexandrescu wrote:
On 06/01/2010 03:37 PM, Walter Bright wrote:
bearophile wrote:
Walter Bright:
C got it right and it doesn't need fixing.
I have never programmed in Go, but keep in mind that Go designers are
expert
language designers and programmers. They aren't stupid people.
E
On 2010-05-31 17:01:16 +0200, Trass3r said:
Isn't http://digitalmars.com/d/2.0/class.html#ClassAllocator what you want?
Ah, that's cool. Didn't saw it. This looks very good. Will those clases
be GCed?
--
Robert M. Münch
www.robertmuench.de
On 06/01/2010 04:20 PM, Philippe Sigaud wrote:
On Tue, Jun 1, 2010 at 23:12, Andrei Alexandrescu
mailto:seewebsiteforem...@erdani.org>>
wrote:
On 06/01/2010 04:06 PM, Steven Schveighoffer wrote:
It looks like you're missing some iterations there.
-Steve
There should b
On 06/01/2010 04:20 PM, Steven Schveighoffer wrote:
On Tue, 01 Jun 2010 17:12:29 -0400, Andrei Alexandrescu
wrote:
On 06/01/2010 04:06 PM, Steven Schveighoffer wrote:
On Tue, 01 Jun 2010 13:54:01 -0400, Andrei Alexandrescu
wrote:
The output of the program is:
0 Tuple!(uint,uint)(0, 0)
1 T
I would argue that there will be more people coming to D from languages such as
C and C++, versus Python or similar languages that don't use semicolons as
statement terminators.
And many of them will still use C/C++ because they still have to maintain some
projects written in those languages. I
On Tue, 01 Jun 2010 17:12:29 -0400, Andrei Alexandrescu
wrote:
On 06/01/2010 04:06 PM, Steven Schveighoffer wrote:
On Tue, 01 Jun 2010 13:54:01 -0400, Andrei Alexandrescu
wrote:
The output of the program is:
0 Tuple!(uint,uint)(0, 0)
1 Tuple!(uint,uint)(0, 1)
2 Tuple!(uint,uint)(1, 1)
3
Jérôme M. Berger wrote:
Of course, using a decent editor will prevent it: if the editor is
able to handle indentation correctly, it will indent the writeln in
the same column as the for which makes the problem appear immediately.
I think it is a serious mistake to design a language that
On Tue, Jun 1, 2010 at 23:12, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:
> On 06/01/2010 04:06 PM, Steven Schveighoffer wrote:
>
>> It looks like you're missing some iterations there.
>>
>> -Steve
>>
>
> There should be 5 * 3 = 15 iterations.
>
> Andrei
>
The example is:
auto c
On Tue, Jun 1, 2010 at 22:54, Philippe Sigaud wrote:
> I also found the (simple?) problem to enumerate a range of ranges to be
> more interesting than I thought.
> Given a range of ranges ... of ranges, of whatever rank, recursively
> enumerate it:
>
> [[a,b,c],[d,e,f],[g,h,i]]
>
> produce:
>
> (a
On 06/01/2010 04:06 PM, Steven Schveighoffer wrote:
On Tue, 01 Jun 2010 13:54:01 -0400, Andrei Alexandrescu
wrote:
The output of the program is:
0 Tuple!(uint,uint)(0, 0)
1 Tuple!(uint,uint)(0, 1)
2 Tuple!(uint,uint)(1, 1)
3 Tuple!(uint,uint)(1, 0)
4 Tuple!(uint,uint)(0, 2)
5 Tuple!(uint,uint
On Tue, 01 Jun 2010 13:54:01 -0400, Andrei Alexandrescu
wrote:
The output of the program is:
0 Tuple!(uint,uint)(0, 0)
1 Tuple!(uint,uint)(0, 1)
2 Tuple!(uint,uint)(1, 1)
3 Tuple!(uint,uint)(1, 0)
4 Tuple!(uint,uint)(0, 2)
5 Tuple!(uint,uint)(1, 2)
6
On 06/01/2010 03:37 PM, Walter Bright wrote:
bearophile wrote:
Walter Bright:
C got it right and it doesn't need fixing.
I have never programmed in Go, but keep in mind that Go designers are
expert
language designers and programmers. They aren't stupid people.
Even experts make mistakes.
Adam Ruppe:
> The back end can obviously handle delegates.
I meant that D seems designed to not assume that the back-end is able to inline
delegates, and indeed at the moment usually not even LLVM is able to do it
(while Scala compiler is able to often perform this optimization, and gives the
J
== Quote from bearophile (bearophileh...@lycos.com)'s article
> Lurker:
> Combine the 2 things into one struct and return by value. Multi-value
return makes for hard to comprehend code. So, IMO, it's hardly syntactic
sugar: it's syntactic grafitti.
"You are very wrong, multiple return values are g
On Wed, 02 Jun 2010 16:50:05 -0400, Alex Makhotin wrote:
Steven Schveighoffer wrote:
where we don't want to (I've done it many times). This is one of those
rare cases where people can easily type valid code that does not do
what they want.
The reason I ask is because I sometimes do empty
Steven Schveighoffer wrote:
where we don't want to (I've done it many times). This is one of those
rare cases where people can easily type valid code that does not do what
they want.
The reason I ask is because I sometimes do empty statements
intentionally by placing a semicolon (surprised?)
On Tue, Jun 1, 2010 at 19:54, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:
> I thought about this some more, and it's more difficult and more
interesting than I thought.
Yeah, that's why I proposed it as a challenge. You guys sure seem to like
this :)
What's interesting, is that i
On 06/01/2010 10:48 PM, Philippe Sigaud wrote:
On Mon, May 31, 2010 at 22:27, Mihail Strashun mailto:m.stras...@gmail.com>> wrote:
May be my question will be a bit naive, but what is about
boost::multi_index approach? I find it brilliant for dividing
container implementation from va
Walter Bright wrote:
> bearophile wrote:
>> Alex Makhotin:
>>> Current DMD compiler version outputs on attempt to make empty statement:
use '{ }' for an empty statement, not a ';'
>>> Is there a reason?
>>
>> Yes, it avoids a common type of bug:
>>
>> for (int i = 0; i < 10; i++);
>> writeln
Hello, guys!
Still fighting with my server example and cannot catch what's wrong. Just
simple example:
==
import std.stdio;
import std.socket;
import core.thread;
int main(){
auto srv = new TcpSocket;
srv.bind(new InternetAddress(1000));
srv.lis
bearophile wrote:
Walter Bright:
C got it right and it doesn't need fixing.
I have never programmed in Go, but keep in mind that Go designers are expert
language designers and programmers. They aren't stupid people.
Even experts make mistakes.
bearophile wrote:
Alex Makhotin:
Current DMD compiler version outputs on attempt to make empty statement:
use '{ }' for an empty statement, not a ';'
Is there a reason?
Yes, it avoids a common type of bug:
for (int i = 0; i < 10; i++);
writeln(i);
I have seen students waste minutes locat
On 6/1/10, Lurker wrote:
> And I do like what the the
> unnecessary "missing" semis do for code readability.
To me, missing semicolons look like sentence fragments. I tend to toss
them in even on languages that don't require it, since it just looks
wrong otherwise :S
On 6/1/10, bearophile wrote:
> It looks also like the Ruby blocks. But D seems designed to work with a
> simpler back-end in mind, unable to "digest" delegates.
But, D can do the given example, only with parens and an semi thrown
in. The back end can obviously handle delegates.
Jacob Carlborg:
> Making parenthesis optional in function calls and semicolons make quite
> a nice delegate literal syntax:
>
> loop {
> // do something
> }
It looks also like the Ruby blocks. But D seems designed to work with a simpler
back-end in mind, unable to "digest" delegates.
Bye
On Mon, May 31, 2010 at 22:27, Mihail Strashun wrote:
> May be my question will be a bit naive, but what is about
> boost::multi_index approach? I find it brilliant for dividing container
> implementation from various container interfaces - things you guys are
> arguing here about a bit.
>
>
My e
On 2010-06-01 21:15, Walter Bright wrote:
Lurker wrote:
== Quote from bearophile (bearophileh...@lycos.com)'s article
In Go you can omit semicolons at the end of lines, so I presume it's
not a
terrible thing for C-like languages:
package main
import " fmt " // formatted I/O.
func main() {
fm
Ali Ãehreli:
> > Go designers are trying to invent/adopt something simpler than
> > C++-style templates
>
> I will not be surprised when they "invent" the same syntax of a language
> Dat Dey've never hearD of... ;)
It's not just a matter of syntax, it's something quite different from C++/D
Lurker:
>Combine the 2 things into one struct and return by value. Multi-value return
>makes for hard to comprehend code. So, IMO, it's hardly syntactic sugar: it's
>syntactic grafitti.<
You are very wrong, multiple return values are good, if they have a good enough
syntax. Regarding this C/C+
On Wed, 02 Jun 2010 15:39:16 -0400, Alex Makhotin wrote:
Walter Bright wrote:
You inevitably forget to go back and append the ; to the previous line.
Current DMD compiler version outputs on attempt to make empty statement:
use '{ }' for an empty statement, not a ';'
Is there a reason?
== Quote from Walter Bright (newshou...@digitalmars.com)'s article
> Lurker wrote:
> > When will D support that? Removing unnecessary semis really pretties up
the
> > code.
> This idea reappears every few years, and even gets folded into a language
now
> and then. It started with Pascal, and most
> for (int i = 0; i < 10; i++);
> writeln(i);
That's a bad example, sorry :-(
Bye,
bearophile
Alex Makhotin:
> Current DMD compiler version outputs on attempt to make empty statement:
> > use '{ }' for an empty statement, not a ';'
> Is there a reason?
Yes, it avoids a common type of bug:
for (int i = 0; i < 10; i++);
writeln(i);
I have seen students waste minutes locating that bug.
B
On 01/06/10 19:47, Andrei Alexandrescu wrote:
I forwarded your note to my editor.
Andrei
Excellent! :D I look forward to their response :)
Walter Bright wrote:
You inevitably forget to go back and append the ; to the
previous line.
Current DMD compiler version outputs on attempt to make empty statement:
use '{ }' for an empty statement, not a ';'
Is there a reason?
--
Alex Makhotin,
the founder of BITPROX,
http://bitprox.co
On Mon, 31 May 2010 22:36:13 +0900, Robert
wrote:
On 2010-05-31 11:09:54 +0200, "Masahiro Nakagawa"
said:
I may not be right about your question, but I am writing msgpack4d.
http://www.bitbucket.org/repeatedly/msgpack4d
This library will be available in Phobos(see d.announce).
Now, I f
Lurker wrote:
== Quote from bearophile (bearophileh...@lycos.com)'s article
In Go you can omit semicolons at the end of lines, so I presume it's not a
terrible thing for C-like languages:
package main
import " fmt " // formatted I/O.
func main() {
fmt.Printf ("Hello Hello\n")
}
When wil
1 - 100 of 158 matches
Mail list logo