https://github.com/CyberShadow/DustMite/wiki
On Thursday, 21 May 2015 at 08:28:30 UTC, Saurabh Das wrote:
Hello,
We have been working on a genetic programming project, and
occasionally the compiler fails and gives an internal error.
I've captured and reduced one of these down to a single
Hello,
We have been working on a genetic programming project, and
occasionally the compiler fails and gives an internal error. I've
captured and reduced one of these down to a single expression.
See http://dpaste.dzfl.pl/e7a66aa067ab (reduced_expr.d)
When I compile this file using: dmd -c
On Wed, 20 May 2015 17:23:05 -0700
Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On 05/20/2015 04:10 PM, Mike Parker wrote:
On Wednesday, 20 May 2015 at 13:46:22 UTC, Daniel Kozák wrote:
DOC say `may not have` not `must not have` ;-)
OK, if that's the
Can I create an instance of A without calling a constructor? (see below)
Use case: for generic deserialiaztion, when the deserialization library
encounters a class without default constructor for example (it knows what
the fields should be set to, but doesn't know how to construct the object).
Thanks!
Wow, dustmite is really useful. It reduces the expression down to:
double someFunction(double AvgPriceChangeNormalized, double
TicksTenMinutesNormalized)
{
return
(TicksTenMinutesNormalized?1:AvgPriceChangeNormalized)?1:TicksTenMinutesNormalized/(TicksTenMinutesNormalized==0)==0;
On Thursday, 21 May 2015 at 09:06:59 UTC, Timothee Cour wrote:
Can I create an instance of A without calling a constructor?
(see below)
Use case: for generic deserialiaztion, when the deserialization
library
encounters a class without default constructor for example (it
knows what
the fields
On Thursday, May 21, 2015 08:28:29 Saurabh Das via Digitalmars-d-learn wrote:
Am I correct in assuming that an internal error in the compiler
should be filed as a bug report?
Yes. You should never see an ICE, and the compiler should never segfault.
So, whenever you see either of those happen,
On Thursday, May 21, 2015 16:57:14 Dennis Ritchie via Digitalmars-d-learn wrote:
Hi,
In Python I can write this:
if (4 = 5 = 6):
print (OK)
-
http://rextester.com/NNAM70713
In D, I can only write this:
import std.stdio;
void main() {
if (4 = 5 5 = 6)
Dennis Ritchie wrote:
if (4 = 5 = 6):
print (OK)
-
I would rather write:
if( isSorted![4,5,6])
-manfred
On Thursday, 21 May 2015 at 18:26:28 UTC, Dennis Ritchie wrote:
elif instead of else if:
http://rextester.com/WOSH30608
The parallel exchange values:
http://rextester.com/TPUD51604
wow!
On Thursday, 21 May 2015 at 18:26:28 UTC, Dennis Ritchie wrote:
On Thursday, 21 May 2015 at 17:43:25 UTC, Jonathan M Davis
wrote:
No C-based language allows what python does, and based on
operators work in
C-based languages, what python is doing simply doesn't fit or
make sense.
What happens
On Thursday, 21 May 2015 at 17:43:25 UTC, Jonathan M Davis wrote:
No C-based language allows what python does, and based on
operators work in
C-based languages, what python is doing simply doesn't fit or
make sense.
What happens in C/C++/D/Java/C#/etc. land is that 4 = 5
results in a bool,
at
On 5/21/15 2:35 AM, Daniel Kozák via Digitalmars-d-learn wrote:
On Wed, 20 May 2015 17:23:05 -0700
Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On 05/20/2015 04:10 PM, Mike Parker wrote:
On Wednesday, 20 May 2015 at 13:46:22 UTC, Daniel Kozák wrote:
DOC say
On Thursday, 21 May 2015 at 13:12:36 UTC, Daniel Kozák wrote:
On Thu, 21 May 2015 08:54:54 -0400
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 5/21/15 2:35 AM, Daniel Kozák via Digitalmars-d-learn wrote:
On Wed, 20 May 2015 17:23:05 -0700
Ali
double foo(double b)
{
return b / (b == 0) == 0;
}
Looks like this fails too.
PS: The original expression:
http://dpaste.dzfl.pl/raw/e7a66aa067ab
double someFunction(double AvgPriceChangeNormalized, double
DayFactor, double TicksTenMinutesNormalized)
{
return
On 5/20/15 11:09 AM, Kagamin wrote:
On Wednesday, 20 May 2015 at 13:54:29 UTC, bitwise wrote:
Yes, but D claims to support manual memory management. It seems to get
second class treatment though.
It's WIP. There were thoughts to run finalizers on the thread where the
object was allocated (I
On 5/21/15 8:40 AM, Kagamin wrote:
On Thursday, 21 May 2015 at 12:33:33 UTC, Steven Schveighoffer wrote:
At this moment, a thread-local-only heap pointer must deal with
multi-threading issues simply because destructors can run on another
thread, even though the reference is thread-local. The
and please submit to https://issues.dlang.org
Submitted: https://issues.dlang.org/show_bug.cgi?id=14613
That expression is, not to put too fine a point on it, mad.
The operator precedence itself is giving me a headache, let
alone the division of a double by a boolean... I'm pretty sure
On Wednesday, 20 May 2015 at 09:41:09 UTC, Per Nordlöw wrote:
On Wednesday, 20 May 2015 at 09:27:06 UTC, Per Nordlöw wrote:
Ping!?
On 5/19/15 7:03 PM, bitwise wrote:
On Tue, 19 May 2015 18:47:26 -0400, Steven Schveighoffer
schvei...@yahoo.com wrote:
On 5/19/15 5:07 PM, bitwise wrote:
On Tue, 19 May 2015 15:36:21 -0400, rsw0x anonym...@anonymous.com
wrote:
On Tuesday, 19 May 2015 at 18:37:31 UTC, bitwise wrote:
On Tue,
On Thu, 21 May 2015 08:54:54 -0400
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 5/21/15 2:35 AM, Daniel Kozák via Digitalmars-d-learn wrote:
On Wed, 20 May 2015 17:23:05 -0700
Ali Çehreli via Digitalmars-d-learn
On Thursday, 21 May 2015 at 12:33:33 UTC, Steven Schveighoffer
wrote:
At this moment, a thread-local-only heap pointer must deal with
multi-threading issues simply because destructors can run on
another thread, even though the reference is thread-local. The
biggest example right now is
On Thursday, 21 May 2015 at 12:33:33 UTC, Steven Schveighoffer
wrote:
At this moment, a thread-local-only heap pointer must deal with
multi-threading issues simply because destructors can run on
another thread, even though the reference is thread-local. The
biggest example right now is
On Thursday, 21 May 2015 at 11:52:34 UTC, Per Nordlöw wrote:
On Wednesday, 20 May 2015 at 09:41:09 UTC, Per Nordlöw wrote:
On Wednesday, 20 May 2015 at 09:27:06 UTC, Per Nordlöw wrote:
Ping!?
I think you'd be more likely to get responses to this sort of
question in the main group, not
On Thursday, 21 May 2015 at 21:02:42 UTC, Ali Çehreli wrote:
On 05/21/2015 01:56 PM, wobbles wrote:
What I ended up doing was creating an OutputRange that
contains the
files I want to write to.
On OutputRange.put I simply print to print to all the files.
Just like MultiFile example here: :)
On Thursday, 21 May 2015 at 21:16:59 UTC, wobbles wrote:
On Thursday, 21 May 2015 at 21:00:15 UTC, Cassio Butrico wrote:
If I understand right you want to redirect the output to a
file by a flag , another file type , video printer is it?
I think by video printer you mean the console?
If so,
On Thursday, 21 May 2015 at 20:15:29 UTC, wobbles wrote:
On Thursday, 21 May 2015 at 20:06:08 UTC, wobbles wrote:
I would like to write to two files at once.
If user specifies verbose flag, output should write to both
stdout and the programs standard output file.
Any ideas?
I should add,
On Thursday, 21 May 2015 at 20:15:29 UTC, wobbles wrote:
On Thursday, 21 May 2015 at 20:06:08 UTC, wobbles wrote:
I would like to write to two files at once.
If user specifies verbose flag, output should write to both
stdout and the programs standard output file.
Any ideas?
I should add,
If I understand right you want to redirect the output to a file
by a flag , another file type , video printer is it?
On 05/21/2015 01:56 PM, wobbles wrote:
What I ended up doing was creating an OutputRange that contains the
files I want to write to.
On OutputRange.put I simply print to print to all the files.
Just like MultiFile example here: :)
std.traits has ImplicitConversionTargets.
Is there any template that returns the types that can implicty
convert to T?
On Thursday, 21 May 2015 at 21:00:15 UTC, Cassio Butrico wrote:
If I understand right you want to redirect the output to a file
by a flag , another file type , video printer is it?
I think by video printer you mean the console?
If so, yes.
I believe I've solved it anyway, see Ali and my
On 05/21/2015 12:44 PM, Meta wrote:
All we need is user-defined opIs and then we're really cooking with gas.
if (5 is between(4, 6))
{
//...
}
We're almost there. :)
bool is_between(T0, T1, T2)(T0 what, T1 min, T2 max)
{
return (what = min) (what = max);
}
void main()
{
if
I would like to write to two files at once.
If user specifies verbose flag, output should write to both
stdout and the programs standard output file.
Any ideas?
On Thursday, 21 May 2015 at 20:06:08 UTC, wobbles wrote:
I would like to write to two files at once.
If user specifies verbose flag, output should write to both
stdout and the programs standard output file.
Any ideas?
I should add, I'm using a library that already writes it's output
to a
On Thursday, 21 May 2015 at 08:55:45 UTC, Saurabh Das wrote:
Thanks!
Wow, dustmite is really useful. It reduces the expression down
to:
double someFunction(double AvgPriceChangeNormalized, double
TicksTenMinutesNormalized)
{
return
On Thursday, 21 May 2015 at 10:24:59 UTC, John Colvin wrote:
On Thursday, 21 May 2015 at 08:55:45 UTC, Saurabh Das wrote:
Thanks!
Wow, dustmite is really useful. It reduces the expression down
to:
double someFunction(double AvgPriceChangeNormalized, double
TicksTenMinutesNormalized)
{
On Thursday, 21 May 2015 at 09:06:59 UTC, Timothee Cour wrote:
Can I create an instance of A without calling a constructor?
(see below)
Use case: for generic deserialiaztion, when the deserialization
library
encounters a class without default constructor for example (it
knows what
the fields
On 5/21/15 10:15 AM, Daniel Kozák via Digitalmars-d-learn wrote:
import std.stdio;
void f(T:T*)(T* t)
{
writeln(before change this is not called);
}
void f(T)(T t)
{
writeln(before change this is called);
}
void main() {
int val;
f(val);
f!(int*)(val);
}
now it
On 5/21/15 9:14 AM, Daniel Kozak wrote:
On Thursday, 21 May 2015 at 13:12:36 UTC, Daniel Kozák wrote:
On Thu, 21 May 2015 08:54:54 -0400
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 5/21/15 2:35 AM, Daniel Kozák via Digitalmars-d-learn wrote:
On
On Thu, 21 May 2015 11:36:14 +, Saurabh Das wrote:
PS: The original expression:
http://dpaste.dzfl.pl/raw/e7a66aa067ab
double someFunction(double AvgPriceChangeNormalized, double DayFactor,
double TicksTenMinutesNormalized)
{
return
fair enough. I thought normally you'd want to have some sort of
expression simplification in genetic programming, to avoid
adding too many superfluous degrees of freedom? Aside from the
obvious problems, those extra degrees of freedom can put you at
risk of overfitting.
Yes - our
On Thursday, 21 May 2015 at 11:36:15 UTC, Saurabh Das wrote:
PS: The original expression:
http://dpaste.dzfl.pl/raw/e7a66aa067ab
double someFunction(double AvgPriceChangeNormalized, double
DayFactor, double TicksTenMinutesNormalized)
{
return
If you're looking for speed, how about ldc?
On Thu, 21 May 2015 09:58:16 -0400
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 5/21/15 9:14 AM, Daniel Kozak wrote:
On Thursday, 21 May 2015 at 13:12:36 UTC, Daniel Kozák wrote:
On Thu, 21 May 2015 08:54:54 -0400
Steven Schveighoffer via
On Thursday, 21 May 2015 at 23:28:32 UTC, weaselcat wrote:
On Thursday, 21 May 2015 at 17:36:00 UTC, Laeeth Isharc wrote:
https://www.quora.com/What-does-Bjarne-Stroustrup-think-about-different-programming-languages
The C++ standard committee already reviewed static_if
IIRC Andrei and Walter
On Thursday, 21 May 2015 at 23:14:47 UTC, Dennis Ritchie wrote:
On Thursday, 21 May 2015 at 21:35:22 UTC, Ali Çehreli wrote:
We're almost there. :)
bool is_between(T0, T1, T2)(T0 what, T1 min, T2 max)
{
return (what = min) (what = max);
}
void main()
{
if (5.is_between(4, 6)) {
On Thursday, 21 May 2015 at 21:35:22 UTC, Ali Çehreli wrote:
We're almost there. :)
bool is_between(T0, T1, T2)(T0 what, T1 min, T2 max)
{
return (what = min) (what = max);
}
void main()
{
if (5.is_between(4, 6)) {
// ...
}
}
Ali
A condition is that if, for example,
On Thursday, 21 May 2015 at 17:36:00 UTC, Laeeth Isharc wrote:
https://www.quora.com/What-does-Bjarne-Stroustrup-think-about-different-programming-languages
The C++ standard committee already reviewed static_if
IIRC Andrei and Walter said they were being incredibly unfair.
On Friday, 22 May 2015 at 00:23:30 UTC, Dennis Ritchie wrote:
Hi,
I've collected some of Python's features. It seems to me that
they are not in the D!
Surely all this is in the D? :)
http://rextester.com/CNQQR
D doesn't have list comprehensions, so it's difficult to directly
port
On Friday, 22 May 2015 at 01:17:17 UTC, weaselcat wrote:
D doesn't have list comprehensions, so it's difficult to
directly port these.
I can not imagine how difficult it is to implement it in D, but
I'm pretty sure that nested for loops to fill arrays (in D, you
can call them differently,
On Friday, 22 May 2015 at 01:52:30 UTC, Dennis Ritchie wrote:
On Friday, 22 May 2015 at 01:17:17 UTC, weaselcat wrote:
D doesn't have list comprehensions, so it's difficult to
directly port these.
I can not imagine how difficult it is to implement it in D, but
I'm pretty sure that nested for
On Friday, 22 May 2015 at 02:18:23 UTC, weaselcat wrote:
On Friday, 22 May 2015 at 01:52:30 UTC, Dennis Ritchie wrote:
off the top of my head, the last one can easily be done with
std.range.stride
import std.stdio, std.range;
void main()
{
int[] a = [ 1, 2, 3, 4, 5, 6 ];
Hi,
I've collected some of Python's features. It seems to me that
they are not in the D!
Surely all this is in the D? :)
http://rextester.com/CNQQR
On 05/21/2015 05:23 PM, Dennis Ritchie wrote:
Hi,
I've collected some of Python's features. It seems to me that they are
not in the D!
Surely all this is in the D? :)
http://rextester.com/CNQQR
Here is my attempt:
import std.stdio;
import std.algorithm;
import std.conv;
import std.range;
On Friday, 22 May 2015 at 05:47:28 UTC, Mike Parker wrote:
I've always used opSlice to produce empty slices, but having
recently read the documentation at [1], I see this:
To overload a[], simply define opIndex with no parameters:
And no mention that opSlice can fill the same role. Am I right
I've always used opSlice to produce empty slices, but having
recently read the documentation at [1], I see this:
To overload a[], simply define opIndex with no parameters:
And no mention that opSlice can fill the same role. Am I right to
infer that we should prefer opIndex over opSlice for
On 5/21/15 12:57 PM, Dennis Ritchie wrote:
Hi,
In Python I can write this:
if (4 = 5 = 6):
print (OK)
-
http://rextester.com/NNAM70713
In D, I can only write this:
import std.stdio;
void main() {
if (4 = 5 5 = 6)
puts(OK);
}
-
http://rextester.com/FICP83173
I
On 2015-05-21 11:06, Timothee Cour via Digitalmars-d-learn wrote:
Can I create an instance of A without calling a constructor? (see below)
Use case: for generic deserialiaztion, when the deserialization library
encounters a class without default constructor for example (it knows
what the fields
Something I sometimes do for strictly personal projects:
import std.typecons : ω = tuple;
import std.typetuple : Ω = TypeTuple;
void main()
{
auto a = 1, b = 2;
Ω!(a, b) = ω(b, a);
assert(a==2 b==1);
}
On Thursday, 21 May 2015 at 19:05:16 UTC, Steven Schveighoffer
wrote:
On
On Thursday, 21 May 2015 at 19:05:16 UTC, Steven Schveighoffer
wrote:
On 5/21/15 12:57 PM, Dennis Ritchie wrote:
Hi,
In Python I can write this:
if (4 = 5 = 6):
print (OK)
-
http://rextester.com/NNAM70713
In D, I can only write this:
import std.stdio;
void main() {
if (4 = 5 5
Hi,
In Python I can write this:
if (4 = 5 = 6):
print (OK)
-
http://rextester.com/NNAM70713
In D, I can only write this:
import std.stdio;
void main() {
if (4 = 5 5 = 6)
puts(OK);
}
-
http://rextester.com/FICP83173
I wanted to ask what is the reason? Maybe the
Start with a function type declaration:
void function() func_ptr;
Then make an array out of it:
void function()[] func_ptr_array;
It works like other arrays, just the [] might be a little harder
to see since it is a much longer type signature. But it is still
in there, right after it,
On Thursday, 21 May 2015 at 14:12:25 UTC, Kagamin wrote:
If you're looking for speed, how about ldc?
Absolutely - we are working on getting it to compile on ldc
and/or gdc.
I've been rewriting one of my emulators in D and am fairly new to
the language. I'm having trouble finding documentation on
creating/initializing/use of arrays of function pointers in D. If
anyone has a code example I'd appreciate it!
On Thursday, 21 May 2015 at 16:25:24 UTC, Adam D. Ruppe wrote:
Start with a function type declaration:
void function() func_ptr;
Then make an array out of it:
void function()[] func_ptr_array;
It works like other arrays, just the [] might be a little
harder to see since it is a much longer
On Thursday, 21 May 2015 at 16:23:15 UTC, John wrote:
I've been rewriting one of my emulators in D and am fairly new
to the language. I'm having trouble finding documentation on
creating/initializing/use of arrays of function pointers in D.
If anyone has a code example I'd appreciate it!
On Thursday, 21 May 2015 at 16:57:16 UTC, Dennis Ritchie wrote:
Hi,
In Python I can write this:
if (4 = 5 = 6):
print (OK)
-
http://rextester.com/NNAM70713
In D, I can only write this:
import std.stdio;
void main() {
if (4 = 5 5 = 6)
puts(OK);
}
-
https://www.quora.com/What-does-Bjarne-Stroustrup-think-about-different-programming-languages
On Thursday, 21 May 2015 at 17:17:29 UTC, Alex Parrill wrote:
http://wiki.dlang.org/Language_Designs_Explained#Why_does_D_not_support_chaining_comparison_operators.3F
Backward compatibility with C is nice but on the other hand it is
a road to nowhere!
Because of this compatibility, I'm
71 matches
Mail list logo