On Sunday, 14 October 2018 at 14:35:36 UTC, lngns wrote:
On Sunday, 14 October 2018 at 13:18:37 UTC, lngns wrote:
That would require introducing a new type
Or just use int with a negative number... That's how it's done
in some dynamic languages.
But my point is that it should be compatible
I had a bug in my code that was messing me up for a while, and it
boiled down to an identity check between two Object references
with unrelated static types, like below:
class A {}
class B {}
void main() {
A a = new A;
B b = new B;
if (a is b) {} // compiles
}
I was surprised that
On Friday, 1 September 2017 at 01:59:07 UTC, Brian wrote:
Hello, I am trying to get the most trivial example of
multithreading working, but can't seem to figure it out.
I want to split a task across threads, and wait for all those
tasks to finish before moving to the next line of code.
The
On Sunday, 9 April 2017 at 00:36:00 UTC, TheGag96 wrote:
I'm trying to use a binary heap initialized with one element.
However, this always seems to cause a range violation for some
reason. This small example will do it:
import std.stdio, std.container;
void main() {
auto pq =
I can't figure out how to set the alignment of a struct using
align(n) on the outside of the struct. Only align on the fields
(default or annotated) seems to work. I get the same results back
to at least DMD 2.065... Is this a bug or am I using it wrong?
align(32) struct A { ubyte padding; }
On Saturday, 18 February 2017 at 02:20:07 UTC, Arun
Chandrasekaran wrote:
On Saturday, 18 February 2017 at 00:08:28 UTC, Steven
Schveighoffer wrote:
On 1/30/17 4:48 PM, Steven Schveighoffer wrote:
Attention fellow Boston D enthusiasts: I have set up a meetup
for
February, and Michael Coulombe
On Saturday, 11 February 2017 at 15:02:11 UTC, error wrote:
On Saturday, 11 February 2017 at 14:43:18 UTC, rikki cattermole
wrote:
Try:
foreach(i, v; vars) {
vars[i] = ...;
}
Perfect! Thanks so much - I wish that hint was in the
documentation for variadic functions, although I guess
On Friday, 10 February 2017 at 23:57:18 UTC, bitwise wrote:
https://github.com/dlang/phobos/blob/cd7846eb96ea7d2fa65ccb04b4ca5d5b0d1d4a63/std/experimental/allocator/mallocator.d#L63-L65
Looking at Mallocator, the use of 'shared' doesn't seem correct
to me.
The logic stated in the comment
On Monday, 6 February 2017 at 11:58:40 UTC, Guillaume Piolat
wrote:
On Friday, 3 February 2017 at 21:25:48 UTC, bitwise wrote:
On Monday, 30 January 2017 at 21:48:57 UTC, Steven
Schveighoffer wrote:
https://www.meetup.com/Boston-area-D-Programming-Language-Meetup/events/237324049/
-Steve
A quine I came up with a while ago, using q{} string notation:
enum s = q{enum s = q{%s};
void main() {
import std.stdio;
writefln(s,s);
}};
void main() {
import std.stdio;
writefln(s,s);
}
On Friday, 21 October 2016 at 01:51:44 UTC, Stefan Koch wrote:
On Friday, 21 October 2016 at 01:34:44 UTC, Nick Sabalausky
wrote:
When using reflection to obtain the fields of a class/struct,
is there any guarantee that the order is the same as the order
the fields are defined?
Yes they
On Tuesday, 4 October 2016 at 00:40:08 UTC, Andrei Alexandrescu
wrote:
On 10/03/2016 06:32 PM, Stefan Koch wrote:
On Monday, 3 October 2016 at 22:28:46 UTC, Andrei Alexandrescu
wrote:
Consider:
template SomethingCool(alias X) { alias Y = X!int; }
struct MyStruct(T) {
alias A =
On Wednesday, 21 September 2016 at 17:14:34 UTC, Stefan Koch
wrote:
That can and is being fixed.
Templates can only be fixed partially and I am not even sure of
that.
I am not suggesting to remove templates.
I just want to raise awareness that they have a rather high
cost.
CTFE performance
Is there a way to implement "getSymbolOfCall" and
"getDelegateOfCall" such that doit is functionally equivalent to
calling the method directly?
auto doit(C, string methodName, Args...)(C c, Args args) {
alias methodSymbol = getSymbolOfCall!(c, methodName, Args);
pragma(msg,
On Monday, 8 August 2016 at 00:57:41 UTC, Michael Coulombe wrote:
...
And looking at the source, the reason it fails when using
TransverseOptions.assumeNotJagged is that it does not implement
length or $.
I made this into an enhancement request:
On Saturday, 6 August 2016 at 23:00:42 UTC, Alex wrote:
Hi all... a technical question from my side...
why the last line of the following gives the error?
import std.stdio;
import std.range;
import std.algorithm;
void main()
{
size_t[][] darr;
darr.length = 2;
darr[0] = [0, 1, 2,
On Monday, 25 July 2016 at 22:57:05 UTC, Gorge Jingale wrote:
On Monday, 25 July 2016 at 22:27:11 UTC, Cauterite wrote:
On Monday, 25 July 2016 at 02:15:12 UTC, Gorge Jingale wrote:
Is there a static ternary if?
(A == B) ? C : D;
for compile type that works like static if.
You can pretty
On Friday, 15 July 2016 at 17:00:09 UTC, jmh530 wrote:
I was working with the lightweight wrapper and it seemed to
work for simple stuff, but then I started getting a bunch of
errors when I tried to integrate it in to my project.
Below is the stripped down version of what I've been working
On Friday, 17 June 2016 at 19:59:09 UTC, kinke wrote:
// LDC issue #1433
void main()
{
auto r = getBase()[getLowerBound($) .. getUpperBound($)];
assert(r == [ 2, 3 ]);
}
Firstly, it fails with DMD 2.071 because $ in the upper bound
expression is 0, i.e., it doesn't reflect the updated
On Wednesday, 6 July 2016 at 19:50:11 UTC, pineapple wrote:
I'd like to do something like this but it doesn't seem to be
legal -
void test(int[] ints...) if(ints.length){
// stuff
}
Not being able to specify this interferes with how I'd like to
define my method overloads.
On Tuesday, 17 May 2016 at 13:17:35 UTC, Steven Schveighoffer
wrote:
Is anyone interested in having D meetups in Boston area? I'm
not familiar with really any other locals (well, there is one
person I know of :)
-Steve
I'd be interested in Boston D meetups, ideally
public-transportation
On Friday, 29 April 2016 at 12:01:19 UTC, Joel wrote:
On Friday, 29 April 2016 at 11:31:51 UTC, rikki cattermole
wrote:
Not entirely the goal I'm guessing output wise, but this works.
import std.range : repeat;
foreach(line; 1 .. 11) {
writeln('#'.repeat(line));
}
That is shorter
On Thursday, 10 March 2016 at 05:17:03 UTC, Michael Coulombe
wrote:
[...]
Whoops, forgot this:
private immutable struct KeyWordDollar {
@property
auto opDispatch(string param, T)(T t) {
return Named!(param,T)(t);
}
}
On Wednesday, 9 March 2016 at 12:55:16 UTC, Idan Arye wrote:
Allowing something like `auto params = [:y : 50, :x : 100]`
won't really solve anything. It works nicely in Ruby, because
Ruby has dynamic typing and with some syntactic sugar you get
elegant syntax for dynamic structs. But in a
On Wednesday, 10 June 2015 at 20:22:18 UTC, Adel Mamin wrote:
ubyte[5] a = 0xAA; // Fine. Five 0xAA bytes.
auto a2 = new ubyte[5]; // Fine. Five 0 bytes.
Now, let's say, I want to allocate an array of a size, derived
at run time, and initialize it to some non-zero value at the
same time. What
I know some people don't like abusing opDollar, but here's my
implementation:
import std.traits, std.algorithm, std.conv;
private struct Named(string n, T) {
enum name = n;
T value;
}
private auto makeNameIndex(NamedList...)(string[] names) {
auto indices = new
26 matches
Mail list logo