On 2011-08-07 21:28, dsimcha wrote:
Yeah, I was trying to wrap my head around the whole "key" concept. I
wasn't very successful. I also tried out Orange and filed a few bug
reports. It may be that Orange isn't the right tool for the job for MPI,
though modulo some bug fixing and polishing it coul
"Mehrdad" wrote in message
news:j1lh84$2n2j$1...@digitalmars.com...
>A readText() function that would read a text file (**and** autodetect its
>encoding from its BOM) would be of great help.
>
http://www.dsource.org/projects/semitwist/browser/trunk/src/semitwist/util/io.d#L24
I agree a functio
On 8/7/11 1:16 PM, Andrej Mitrovic wrote:
Just throwing an idea..
structs are great since you don't have to make a special constructor
just to initialize its fields. E.g.:
struct Foo
{
int a;
int b;
int c;
int d;
}
void main()
{
auto foo = Foo(1, 2, 3, 4);
}
But what
I just made something I thought I'd share.
It's great for those times when the compiler decides to randomly put a
closure on the heap.
The usage is pretty simple:
int x = 5;
auto adder5 = mixin(closure!x(q{(int a) { return a + x; }}));
assert(adder5(10) == 15);
It returns a calla
On 8/6/2011 8:34 PM, bearophile wrote:
Walter:
On 8/6/2011 4:46 PM, bearophile wrote:
Walter is not a lover of that -ffast-math switch.
No, I am not. Few understand the subtleties of IEEE arithmetic, and breaking
IEEE conformance is something very, very few should even consider.
I have rea
Trass3r:
> I ported smallpt to D some time ago and now that I've working versions of
> LDC2 and GDC2 I did a quick comparison:
I have converted to D many of the commonly found benchmarks, this is my version:
http://codepad.org/ZbmSfseY
If I compile it with with LDC1 with Link Time Optimization
OK so apparently the GC was working fine, my bad.
I'm not sure about the compiler, though.
When I have this code:
void foo(int a, scope void delegate(int) sink)
{
sink(a);
}
void main()
{
int tmp;
foo(5, delegate(int c) { tmp = c; });
}
I get a he
On Sunday 07 August 2011 23:29:26 Robert Clipsham wrote:
> On 07/08/2011 22:18, Jonathan M Davis wrote:
> > Personally, I don't see much point in using the package specifier when
> > you're not actually using a package hierarchy (you're just making it so
> > that everything but stuff which actually
On Monday 08 August 2011 00:19:56 Stijn Herreman wrote:
> On 7/08/2011 23:18, Jonathan M Davis wrote:
> > On Sunday 07 August 2011 18:58:53 Stijn Herreman wrote:
> >> module main;
> >>
> >> import std.stdio;
> >> import my_module;
> >>
> >> int main()
> >> {
> >>
> >>my_method();
> >>ret
I ported smallpt to D some time ago and now that I've working versions of
LDC2 and GDC2 I did a quick comparison:
Original code:
http://kevinbeason.com/smallpt/explicit.cpp
D version:
https://bitbucket.org/trass3r/smallptd/src
C++ -- g++ -O3 explicit.cpp:
Rendering (4 spp) 100.00%
real0
On Sat, 06 Aug 2011 14:25:40 -0700, Jonathan M Davis wrote:
> On Thursday 04 August 2011 10:55:31 Lars T. Kyllingstad wrote:
>> Since the voting is supposed to start today (not in this thread;
>> dsimcha will annouce it), here is the (hopefully) final version of
>> std.path:
>>
>> https://githu
On 07/08/2011 23:59, Andrej Mitrovic wrote:
So I wanted to make myself a template called "macro", but it turns out
it's a keyword:
template macro()
{
}
test.d(7): TemplateIdentifier expected following template
test.d(7): Declaration expected, not 'macro'
Is there something planned with this ke
So I wanted to make myself a template called "macro", but it turns out
it's a keyword:
template macro()
{
}
test.d(7): TemplateIdentifier expected following template
test.d(7): Declaration expected, not 'macro'
Is there something planned with this keyword?
KennyTM~:
> __ctfeWrite is not complex, but I don't see the need for it.
I don't understand your point. Given __ctfeWrite you are able to create a
__ctfeWriteln but you can't do the opposite.
If I have to print something complex, like something tree-shaped, and I have
just __ctfeWriteln, to cr
On 08.08.2011 1:38, KennyTM~ wrote:
Pull request: https://github.com/D-Programming-Language/dmd/pull/296
Previous discussion:
http://www.digitalmars.com/d/archives/digitalmars/D/CTFE_writeln_140241.html
This is the 2nd try to add a compile-time printing facility to D. The
previous pull reque
On Aug 8, 11 05:56, bearophile wrote:
KennyTM~:
So I go for my 2nd alternative, which is to add a magic function __ctfeWriteln
that does the same.
In my implementation, __ctfeWriteln will print the interpreted arguments
to stdmsg when CTFE-ed, and is a no-op in runtime (it can be configured
to
On 07/08/2011 22:18, Jonathan M Davis wrote:
Personally, I don't see much point in using the package specifier when you're
not actually using a package hierarchy (you're just making it so that
everything but stuff which actually uses a hierarchy can use the function - it
would be a really weird d
On 7/08/2011 23:18, Jonathan M Davis wrote:
On Sunday 07 August 2011 18:58:53 Stijn Herreman wrote:
module main;
import std.stdio;
import my_module;
int main()
{
my_method();
return 0;
}
module my_module;
import std.stdio;
package void my_method()
{
writeln("Hello
Max Klyga:
> So this feature has to be either mandatory or not. Making it optional
> leads to confusion as Jonathan mentioned.
On this, what I have suggested it not the same thing that the original proposal
says. In the original proposal the "ref" and "out" are optional. In my
alternative pro
KennyTM~:
> So I go for my 2nd alternative, which is to add a magic function
> __ctfeWriteln
> that does the same.
>
> In my implementation, __ctfeWriteln will print the interpreted arguments
> to stdmsg when CTFE-ed, and is a no-op in runtime (it can be configured
> to throw an exception or
Pull request: https://github.com/D-Programming-Language/dmd/pull/296
Previous discussion:
http://www.digitalmars.com/d/archives/digitalmars/D/CTFE_writeln_140241.html
This is the 2nd try to add a compile-time printing facility to D. The
previous pull request uses std.stdio.writeln which cause
This would probably work with the protobuf format.
Sent from my iPhone
On Aug 7, 2011, at 12:28 PM, dsimcha wrote:
> On 8/7/2011 2:27 PM, Jacob Carlborg wrote:
>> On 2011-08-07 17:45, dsimcha wrote:
>>> On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
Currently, the only available format is XM
On Sunday 07 August 2011 18:58:53 Stijn Herreman wrote:
> module main;
>
> import std.stdio;
> import my_module;
>
> int main()
> {
> my_method();
> return 0;
> }
>
>
> module my_module;
>
> import std.stdio;
>
> package void my_method()
> {
>writeln("Hello D-World!");
> }
One the main reasons c# has mandatory out and ref at call site is code
versioning. If some function took an argument by value but was changed
to take if by reference, without annotations compiler would treat this
as an error, preventing a potential bug.
So this feature has to be either mandato
This is a recently opened (not by me) enhancement request thread:
http://d.puremagic.com/issues/show_bug.cgi?id=6442
It proposes something that I remember was discussed and refused two times in
past: to require (but only optionally!) "ref" and "out" at the calling point,
as C#4 instead always re
Vladimir Panteleev:
> Done:
> http://dump.thecybershadow.net/b1e4cb6ef0a8d3c5f54d5cb09ddd1a9e/DMD.log
There are only 10 NULL deference warnings left:
s2ir.c(1043): warning C6011: Dereferencing NULL pointer 'pu++'
s2ir.c(980): warning C6011: Dereferencing NULL pointer 'cases'
statement.c(3666):
On Sun, 07 Aug 2011 22:11:35 +0300, Vladimir Panteleev
wrote:
On Sun, 07 Aug 2011 21:45:45 +0300, bearophile
wrote:
Vladimir Panteleev:
http://thecybershadow.net/d/vcanalysis/
As with (first report of) Clang I see that assert(p); p->foo... are
marked as "Dereferencing NULL pointer"
On 8/7/2011 2:27 PM, Jacob Carlborg wrote:
On 2011-08-07 17:45, dsimcha wrote:
On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
Currently, the only available format is XML.
Ok, I'll look into writing a binary archiver that assumes that the CPU
architecture on the deserializing end is the same as t
Trass3r:
> > this(int this.a, int this.b, int this.c, int this.d) {
> > sum = a + b + c + d;
> > average = (a + b + c + d) / 4;
> > }
>
> Can't express how awkward this is.
Why don't you try to express how awkward it is?
Well, code like this is shorter than what the OP h
On Aug 8, 11 03:08, KennyTM~ wrote:
On Aug 8, 11 02:45, bearophile wrote:
Vladimir Panteleev:
http://thecybershadow.net/d/vcanalysis/
As with (first report of) Clang I see that assert(p); p->foo... are
marked as "Dereferencing NULL pointer".
Do you know the purpose of this?
os->name = strd
On Sun, 07 Aug 2011 21:45:45 +0300, bearophile
wrote:
Vladimir Panteleev:
http://thecybershadow.net/d/vcanalysis/
As with (first report of) Clang I see that assert(p); p->foo... are
marked as "Dereferencing NULL pointer".
Ah, that would probably be in files that #include instead of
On Aug 8, 11 02:45, bearophile wrote:
Vladimir Panteleev:
http://thecybershadow.net/d/vcanalysis/
As with (first report of) Clang I see that assert(p); p->foo... are marked as
"Dereferencing NULL pointer".
Do you know the purpose of this?
os->name = strdup(name);
warning C4996: 'str
this(int this.a, int this.b, int this.c, int this.d) {
sum = a + b + c + d;
average = (a + b + c + d) / 4;
}
Can't express how awkward this is.
On Aug 7, 11 22:23, Vladimir Panteleev wrote:
On Sun, 07 Aug 2011 13:29:20 +0300, Walter Bright
wrote:
It's less complex (!) if you are not trying to make a working dmd. It
just needs to compile.
OK, that wasn't actually too bad.
https://github.com/CyberShadow/dmd/tree/compile-on-vs10
2979
On Sun, 07 Aug 2011 21:47:07 +0300, bearophile
wrote:
Vladimir Panteleev:
Could you please elaborate? The list of links is sorted alphabetically,
so
files under "root" are lower down the list.
What do you see if you click on a link like "root\root.c"?
Ah! I didn't reproduce the proble
Vladimir Panteleev:
> http://thecybershadow.net/d/vcanalysis/
As with (first report of) Clang I see that assert(p); p->foo... are marked as
"Dereferencing NULL pointer".
Do you know the purpose of this?
os->name = strdup(name);
warning C4996: 'strdup': The POSIX name for this item is dep
Vladimir Panteleev:
> Could you please elaborate? The list of links is sorted alphabetically, so
> files under "root" are lower down the list.
What do you see if you click on a link like "root\root.c"?
Bye,
bearophile
> With that idea your struct becomes:
Or just:
struct Foo {
int a, b, c, d, sum, average;
this(this.a, this.b, this.c, this.d) {
sum = a + b + c + d;
average = (a + b + c + d) / 4;
}
}
Bye,
bearophile
On 2011-08-07 18:01, Lutger Blijdestijn wrote:
dsimcha wrote:
On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
Currently, the only available format is XML.
Ok, I'll look into writing a binary archiver that assumes that the CPU
architecture on the deserializing end is the same as that on the
seria
On 2011-08-07 17:58, dsimcha wrote:
On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
Good to know, but what flavor? As I see it there is a three-way tradeoff
in serialization. In order of importance for distributed parallelism,
the qualities are:
I can answer these tradeoff for the Orange serializa
Andrej Mitrovic:
> Good idea / bad idea?
I prefer a solution that to me looks simpler, discussed a bit here:
http://d.puremagic.com/issues/show_bug.cgi?id=3878
With that idea your struct becomes:
struct Foo {
int a, b, c, d, sum, average;
this(int this.a, int this.b, int this.c, int th
On 8/7/2011 3:21 AM, Jonathan M Davis wrote:
On Sunday 07 August 2011 14:08:06 Dmitry Olshansky wrote:
On 07.08.2011 12:09, Mehrdad wrote:
A readText() function that would read a text file (**and** autodetect
its encoding from its BOM) would be of great help.
Well the name is here, dunno if it
On Sun, 07 Aug 2011 21:28:18 +0300, bearophile
wrote:
Vladimir Panteleev:
http://thecybershadow.net/d/vcanalysis/
I don't see the pages in inner directories like "root\root.c".
Could you please elaborate? The list of links is sorted alphabetically, so
files under "root" are lower down
On Sun, 07 Aug 2011 21:17:30 +0300, Walter Bright
wrote:
Try the All Rules.
Ah, my mistake. The rulesets only apply to managed (.NET) code. It looks
like C/C++ code analysis is just an on/off switch.
http://msdn.microsoft.com/en-us/library/d3bbz7tz(v=vs.80).aspx
--
Best regards,
Vladi
Vladimir Panteleev:
> http://thecybershadow.net/d/vcanalysis/
I don't see the pages in inner directories like "root\root.c".
Bye,
bearophile
On 8/7/2011 1:15 AM, KennyTM~ wrote:
On Aug 7, 11 14:47, Mehrdad wrote:
Everyone, apologies for this in hindsight, it's quite ridiculous.
x_x
In trying to reproduce a similar bug I saw in my code, I made a
completely stupid example which made no sense.
I'll proofread better next time, hop
On 2011-08-07 17:45, dsimcha wrote:
On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
Currently, the only available format is XML.
Ok, I'll look into writing a binary archiver that assumes that the CPU
architecture on the deserializing end is the same as that on the
serializing end. If it works, may
On 2011-08-07 18:15, Sean Kelly wrote:
I was mostly wondering if the serialized was all template code or if the
archived portion used some form of polymorphism. Sounds like its the latter.
The serializer uses template methods, the archive uses interfaces and
virtual methods.
Sent from my i
On 8/7/2011 10:43 AM, bearophile wrote:
and there's that cast to float he overlooked, sabotaging his upgrade. Even
worse, suppose the type of f or d or both is changed to some user defined type,
like BigFloat? That cast is just going to *cause* a bug, not fix it.
Requiring the programmer to load
On 8/7/2011 11:06 AM, Vladimir Panteleev wrote:
I'll see if I can get it in a more readable format (something like the HTML
files clang's scan-build outputs).
http://thecybershadow.net/d/vcanalysis/
Very nice!
On 8/7/2011 11:13 AM, Vladimir Panteleev wrote:
On Sun, 07 Aug 2011 20:11:49 +0300, bearophile wrote:
Later a higher level will show other warnings.
I have the following levels to choose from:
Microsoft All Rules
Microsoft Basic Correctness Rules
Microsoft Basic Design Guideline Rules
Micro
Just throwing an idea..
structs are great since you don't have to make a special constructor
just to initialize its fields. E.g.:
struct Foo
{
int a;
int b;
int c;
int d;
}
void main()
{
auto foo = Foo(1, 2, 3, 4);
}
But what if I add an extra couple of fields that have to b
On Sun, 07 Aug 2011 20:11:49 +0300, bearophile
wrote:
Later a higher level will show other warnings.
I have the following levels to choose from:
Microsoft All Rules
Microsoft Basic Correctness Rules
Microsoft Basic Design Guideline Rules
Microsoft Extended Correctness Rules
Microsoft Exten
On Sun, 07 Aug 2011 17:23:48 +0300, Vladimir Panteleev
wrote:
I'll see if I can get it in a more readable format (something like the
HTML files clang's scan-build outputs).
http://thecybershadow.net/d/vcanalysis/
Created with:
https://github.com/CyberShadow/ColorerVCLog
--
Best regards,
Anyways, I've tweaked the GDC codegen, and program speed meets that of
C++ now (on my system).
Implementation: http://ideone.com/0j0L1
Command-line:
gdc -O3 -mfpmath=sse -ffast-math -march=native -frelease
g++ bench.cc -O3 -mfpmath=sse -ffast-math -march=native
Best times:
G++-32bit: 114
On 07/08/2011 18:34, Walter Bright wrote:
On 8/7/2011 7:23 AM, Vladimir Panteleev wrote:
2979 warnings with code analysis with the "Microsoft Minimum
Recommended Rules"
ruleset.
http://dump.thecybershadow.net/2e0571641194d945869a1b12b29aacdc/DMD.log
Thanks, this is what I was looking for!
I
Walter:
> and there's that cast to float he overlooked, sabotaging his upgrade. Even
> worse, suppose the type of f or d or both is changed to some user defined
> type,
> like BigFloat? That cast is just going to *cause* a bug, not fix it.
>
> Requiring the programmer to load up on casts is no
On 8/7/2011 7:23 AM, Vladimir Panteleev wrote:
2979 warnings with code analysis with the "Microsoft Minimum Recommended Rules"
ruleset.
http://dump.thecybershadow.net/2e0571641194d945869a1b12b29aacdc/DMD.log
Thanks, this is what I was looking for!
I'll see if I can get it in a more readable
On 8/7/2011 10:11 AM, bearophile wrote:
It contains FP warnings like the one I have asked for D too. DMD doesn't
perform certain unsafe FP operations because they and break IEEE conformance,
but casting a double to float is accepted and regarded "safe" (I am not sure
of this): lexer.c(2500): warn
Vladimir Panteleev:
> 2979 warnings with code analysis with the "Microsoft Minimum Recommended
> Rules" ruleset.
Thank you. Info about this minimum level:
http://msdn.microsoft.com/en-us/library/dd264893.aspx
Later a higher level will show other warnings.
> http://dump.thecybershadow.net/2e05
module main;
import std.stdio;
import my_module;
int main()
{
my_method();
return 0;
}
module my_module;
import std.stdio;
package void my_method()
{
writeln("Hello D-World!");
}
Error: function my_module.my_method is not accessible from main
On 8/6/2011 12:32 PM, Sean Kelly wrote:
I'd love to be able to send classes between processes, but first we need a good
serialization/deserialization mechanism.
The more I think about it, the more I think that std.concurrency isn't
quite the right interface for cluster parallelism. I'm think
I was mostly wondering if the serialized was all template code or if the
archived portion used some form of polymorphism. Sounds like its the latter.
Sent from my iPhone
On Aug 7, 2011, at 8:19 AM, Jacob Carlborg wrote:
> On 2011-08-07 02:24, Sean Kelly wrote:
>> Is the archive formatter dyna
Nope. It would represent an external destination and defines the protocol.
Sent from my iPhone
On Aug 6, 2011, at 6:57 PM, dsimcha wrote:
> On 8/6/2011 8:26 PM, Sean Kelly wrote:
>> I'm hoping to simply extend the existing API. The crucial portion will be
>> the addition of a Node (base) type
On 8/7/2011 12:01 PM, Lutger Blijdestijn wrote:
dsimcha wrote:
On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
Currently, the only available format is XML.
Ok, I'll look into writing a binary archiver that assumes that the CPU
architecture on the deserializing end is the same as that on the
seri
dsimcha wrote:
> On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
>> Currently, the only available format is XML.
>
> Ok, I'll look into writing a binary archiver that assumes that the CPU
> architecture on the deserializing end is the same as that on the
> serializing end. If it works, maybe Orange
link for the D implementation: https://bitbucket.org/repeatedly/msgpack4d/
On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
Good to know, but what flavor? As I see it there is a three-way tradeoff
in serialization. In order of importance for distributed parallelism,
the qualities are:
I can answer these tradeoff for the Orange serialization library,
http://dsource.org/proj
On 8/7/2011 11:36 AM, Jacob Carlborg wrote:
Currently, the only available format is XML.
Ok, I'll look into writing a binary archiver that assumes that the CPU
architecture on the deserializing end is the same as that on the
serializing end. If it works, maybe Orange is a good choice.
On 2011-08-07 00:09, dsimcha wrote:
On 8/6/2011 5:38 PM, jdrewsen wrote:
AFAIK David Nadlinger is handling serialization in his GSOC Thrift
project that he is working on currently.
/Jonas
Good to know, but what flavor? As I see it there is a three-way tradeoff
in serialization. In order of im
On 2011-08-07 03:19, bearophile wrote:
I have discussed about this topic once in past, but in the meantime I have seen
this is a quite common problem, so I think it doesn't harm to touch this topic
again.
This is a direct D translation of the original C or C++ code:
// version #1
double foo;
On 2011-08-07 02:24, Sean Kelly wrote:
Is the archive formatter dynamically pluggable?
I'm not exactly sure what you mean but you can create new archive types
and use them with the existing serializer. When creating a new
serializer it takes an archive (as an interface) as a parameter.
Sen
On Sat, 06 Aug 2011 20:19:06 +, Sean Eskapp wrote:
> If I have something like
>
> struct S(T)
> {
> T data;
> }
>
>
> I can't make a struct literal with
>
> int mystuff;
> someFunc(S(mystuff));
It has been the same in C++. The reason is that the syntax above wo
Am 07.08.2011, 16:23 Uhr, schrieb Vladimir Panteleev
:
On Sun, 07 Aug 2011 13:29:20 +0300, Walter Bright
wrote:
It's less complex (!) if you are not trying to make a working dmd. It
just needs to compile.
OK, that wasn't actually too bad.
https://github.com/CyberShadow/dmd/tree/compi
On Sun, 07 Aug 2011 13:29:20 +0300, Walter Bright
wrote:
It's less complex (!) if you are not trying to make a working dmd. It
just needs to compile.
OK, that wasn't actually too bad.
https://github.com/CyberShadow/dmd/tree/compile-on-vs10
2979 warnings with code analysis with the "Mic
bearophile:
> Is this the same thing you are saying?
Yeah, though in D you'd have to use objects and interfaces
rather than primitives.
Casting to the interface would return null if it doesn't match,
so it compiles but then errors at runtime.
On 8/7/11 5:08 AM, Dmitry Olshansky wrote:
On 07.08.2011 12:09, Mehrdad wrote:
A readText() function that would read a text file (**and** autodetect
its encoding from its BOM) would be of great help.
Well the name is here, dunno if it meets your expectations:
http://d-programming-language.org/
Timon Gehr wrote:
> Lutger Blijdestin wrote:
>> I like the ternary operator the best for this, as it is the simplest. I
>> always write them like this though, liberally include parenthesis and
>> never nest:
>> (condition)
>> ? (truth value)
>> : (false value)
>
> What is the benefit of
Adam D. Ruppe Wrote:
> This seems to be to be nothing more than applying the same
> idea behind objects and interfaces to other types... if all
> variables were typed Object and you had:
>
> interface Int {}
> interface String {}
>
> void whatever(Int lineno, String rawdata) {}
>
> it'd be the
Lutger Blijdestin wrote:
> I like the ternary operator the best for this, as it is the simplest. I
> always write them like this though, liberally include parenthesis and never
> nest:
> (condition)
> ? (truth value)
> : (false value)
What is the benefit of this, compared to leaving paren
bearophile wrote:
...
> In my precedent post about this topic I have discussed "nested constness"
> and another partially silly idea. Recently I have seen a language that
> suggests me this:
>
> // version #6
> const foo;
> if (abs(e.x - v.x) > double.min)
> foo = (v.y - e.y) / (v.x - e.x);
>
On 8/7/2011 3:24 AM, Vladimir Panteleev wrote:
Before that, someone first needs to get dmd to even compile with Visual C++.
It's not a trivial task - there is no complex number support, lots of
compiler-dependent defines are outdated, and there seem to be tons of regular
compiler warnings (mostly
On Sat, 06 Aug 2011 22:38:15 +0300, Walter Bright
wrote:
http://www.reddit.com/r/programming/comments/jar93/john_carmack_gives_his_thoughts_on_static/c2akmf8
If someone has this on their system, I think it'd be great if you could
run the dmd source code through it and see if it finds any b
On Sunday 07 August 2011 14:08:06 Dmitry Olshansky wrote:
> On 07.08.2011 12:09, Mehrdad wrote:
> > A readText() function that would read a text file (**and** autodetect
> > its encoding from its BOM) would be of great help.
>
> Well the name is here, dunno if it meets your expectations:
> http://
On Sunday 07 August 2011 06:02:36 Kagamin wrote:
> Jonathan M Davis Wrote:
> > Being able to use const can be very valuable. For instance, what if you
> > were using std.algorithm.copy and got the arguments backwards? If the
> > source is const, then the compiler will complain, and you'll quickly
>
On 07.08.2011 12:09, Mehrdad wrote:
A readText() function that would read a text file (**and** autodetect
its encoding from its BOM) would be of great help.
Well the name is here, dunno if it meets your expectations:
http://d-programming-language.org/phobos/std_file.html#readText
--
Dmitry Ol
Jonathan M Davis Wrote:
> Being able to use const can be very valuable. For instance, what if you were
> using std.algorithm.copy and got the arguments backwards? If the source is
> const, then the compiler will complain, and you'll quickly find the bug. If
> the
> source isn't const, then you
bearophile Wrote:
> - You can't use "auto" there, so if the type of e.x changes, you have to
> change the foo type manually (double.min is replaceable with typeof(e.x).min).
This is a bad idea too. The code assumes the values are double. If this
assumption is not true, the code is broken.
On Sunday 07 August 2011 04:40:52 Kagamin wrote:
> bearophile Wrote:
> > - And foo can't be const or immutable, I don't like this.
>
> I suppose accidental overwrite bugs are overrated. I have never seen them
> even from evil programmers. If you write random code, overwrite is not your
> only prob
Walter Bright Wrote:
> On 8/6/2011 7:24 PM, bearophile wrote:
> > C#4 has "dynamic" type, it allows to perform dynamic typing style code in
> > C#:
> > http://en.wikipedia.org/wiki/C_sharp_4#Dynamic_member_lookup
>
> D has opDispatch which fills that role nicely.
opDispatch doesn't work with in
bearophile Wrote:
> - And foo can't be const or immutable, I don't like this.
I suppose accidental overwrite bugs are overrated. I have never seen them even
from evil programmers. If you write random code, overwrite is not your only
problem, you can as well read wrong variable or call wrong fun
P.S. you would make a better point if it were a const instance of a class.
On Aug 7, 11 14:47, Mehrdad wrote:
Everyone, apologies for this in hindsight, it's quite ridiculous. x_x
In trying to reproduce a similar bug I saw in my code, I made a
completely stupid example which made no sense.
I'll proofread better next time, hopefully I can isolate it then.
Next ti
A readText() function that would read a text file (**and** autodetect
its encoding from its BOM) would be of great help.
On Sat, Aug 6, 2011 at 22:19, Sean Eskapp wrote:
> If I have something like
>
> struct S(T)
> {
> T data;
> }
>
> I can't make a struct literal with
>
> int mystuff;
> someFunc(S(mystuff));
>
> I have to use
>
> int mystuff;
> someFunc(S!(int)(mystuff));
>
> Why is th
Am 07.08.2011, 06:31 Uhr, schrieb Adam D. Ruppe
:
bearophile:
I agree, that's why I have added two more points
The precedence of the ternary is pretty easy to handle - if there's
more than one thing in there, just use parenthesis. That's the
only thing I can think of that would make it any
96 matches
Mail list logo