On Tuesday, 16 August 2016 at 17:51:13 UTC, Johan Engelen wrote:
On Tuesday, 16 August 2016 at 01:28:05 UTC, Ali Çehreli wrote:
With ldc2, the best option is to go with a dynamic array ONLY
IF you access the elements through the .ptr property. As seen
in the last result, using the [] operator
On Tuesday, 16 August 2016 at 19:50:14 UTC, Yuxuan Shui wrote:
On Tuesday, 16 August 2016 at 18:46:06 UTC, Ali Çehreli wrote:
On 08/16/2016 10:51 AM, Johan Engelen wrote:
> On Tuesday, 16 August 2016 at 01:28:05 UTC, Ali Çehreli
> wrote:
>>
>> With ldc2, the best option is to go with a dynamic
On Tuesday, 16 August 2016 at 18:46:06 UTC, Ali Çehreli wrote:
On 08/16/2016 10:51 AM, Johan Engelen wrote:
> On Tuesday, 16 August 2016 at 01:28:05 UTC, Ali Çehreli wrote:
>>
>> With ldc2, the best option is to go with a dynamic array
ONLY IF you
>> access the elements through the .ptr property.
On Tuesday, 16 August 2016 at 01:28:05 UTC, Ali Çehreli wrote:
On 08/15/2016 12:09 PM, Ali Çehreli wrote:
[...]
Could you please help me understand the following results,
possibly by analyzing the produced assembly?
[...]
There seem to be two things at work here: 1) when not accessed
via
On Thursday, 11 August 2016 at 21:28:57 UTC, sclytrack wrote:
On Wednesday, 10 August 2016 at 20:36:38 UTC, Dicebot wrote:
http://forum.dlang.org/post/pqsiqmkxenrwxoruz...@forum.dlang.org
The first DIP has just landed into the new queue. It is a
proposal from language authors and thus it bypas
On Thursday, 28 July 2016 at 11:48:40 UTC, Nick Treleaven wrote:
On Monday, 25 July 2016 at 07:33:25 UTC, Yuxuan Shui wrote:
Valgrind reports double free anyways. I think it's just the
inaccuracy of the glibc double free detection.
Please file a bug - thanks!
https://issues.dlang.org/
I found
On Sunday, 24 July 2016 at 20:48:55 UTC, Nick Treleaven wrote:
On Friday, 22 July 2016 at 01:54:28 UTC, Yuxuan Shui wrote:
auto b = alloc.makeArray!A(10, A(1));
auto c = alloc.makeArray!A(2, A(2));
I noticed (using dpaste) if you edit the 'b' line to only
alloc
Is it OK to use makeArray with ScopedAllocator to allocate
something with a destructor?
Because the destructor is not called when ScopedAllocator goes
out of scope. And if I manually call dispose, I get a double free
error:
struct A {
int a;
~this() n
On Tuesday, 14 June 2016 at 00:55:52 UTC, Walter Bright wrote:
On 6/13/2016 5:13 PM, H. S. Teoh via Digitalmars-d wrote:
My *real* dream is for D (or some suitable subset thereof) to
replace
Javascript in browsers. But that's a very distant, if at all
even
possible, dream. :-D
It's a great
On Friday, 6 May 2016 at 06:30:27 UTC, Yuxuan Shui wrote:
On Friday, 6 May 2016 at 06:26:14 UTC, Yuxuan Shui wrote:
On Friday, 6 May 2016 at 06:18:22 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:33:07 UTC, Yuxuan Shui wrote:
[...]
Wait, I just realized that this example works in
On Friday, 6 May 2016 at 06:26:14 UTC, Yuxuan Shui wrote:
On Friday, 6 May 2016 at 06:18:22 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:33:07 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:19:59 UTC, Yuxuan Shui wrote:
[...]
See this example:
int a(alias f)(){return f(3
On Friday, 6 May 2016 at 06:18:22 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:33:07 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:19:59 UTC, Yuxuan Shui wrote:
[...]
See this example:
int a(alias f)(){return f(3);}
int b(int z, T)(T c){return c;}
void main() {
On Thursday, 5 May 2016 at 23:33:07 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:19:59 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:12:40 UTC, Ed wrote:
On Thursday, 5 May 2016 at 22:53:01 UTC, Yuxuan Shui wrote:
[...]
alias aa(T) = a!(1,T);
aa!ubyte(2);
Your alias declara
On Thursday, 5 May 2016 at 23:46:59 UTC, Ed wrote:
On Thursday, 5 May 2016 at 23:33:07 UTC, Yuxuan Shui wrote:
It'd really nice if this just works,
That's clear that you've never been stuck in the fat mud of
imperative and OO programming styles. You don't realize
(anymore ?) how lucky we are
On Thursday, 5 May 2016 at 23:38:38 UTC, Ed wrote:
On Thursday, 5 May 2016 at 23:19:59 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:12:40 UTC, Ed wrote:
On Thursday, 5 May 2016 at 22:53:01 UTC, Yuxuan Shui wrote:
[...]
alias aa(T) = a!(1,T);
aa!ubyte(2);
Your alias declaration is n
On Thursday, 5 May 2016 at 23:19:59 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 23:12:40 UTC, Ed wrote:
On Thursday, 5 May 2016 at 22:53:01 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 21:54:29 UTC, Ed wrote:
On Thursday, 5 May 2016 at 20:17:08 UTC, Yuxuan Shui wrote:
[...]
It'
On Thursday, 5 May 2016 at 23:12:40 UTC, Ed wrote:
On Thursday, 5 May 2016 at 22:53:01 UTC, Yuxuan Shui wrote:
On Thursday, 5 May 2016 at 21:54:29 UTC, Ed wrote:
On Thursday, 5 May 2016 at 20:17:08 UTC, Yuxuan Shui wrote:
[...]
It's hard to help without a minimal working example (maybe
some
On Thursday, 5 May 2016 at 21:54:29 UTC, Ed wrote:
On Thursday, 5 May 2016 at 20:17:08 UTC, Yuxuan Shui wrote:
[...]
It's hard to help without a minimal working example (maybe
something with just the body).
If you mean that "alias new_parser = Comb!(a, b);" generates an
error maybe that's
So I was working on a parser combinator library, where the
combinators take parsers as template argument. It works well
until recently I decided to change the parsers so they would take
Ranges instead of just strings.
The combinator used to look like:
template Comb(alias parser1, alias pa
On Friday, 1 April 2016 at 23:26:14 UTC, Alex Parrill wrote:
On Friday, 1 April 2016 at 21:25:46 UTC, Yuxuan Shui wrote:
[...]
Not as-is, because the format string is a runtime argument and
not a compile-time constant.
Consider:
writefln(rand() >= 0.5 ? "%s" : "%d", 123);
It's certain
Clang has this nice feature that it will warn you when you passed
wrong arguments to printf:
#include
int main(){
long long u = 10;
printf("%c", u);
}
clang something.c:
something.c:4:15: warning: format specifies type 'int' but the
argument has type 'long long' [-Wformat]
W
On Monday, 7 March 2016 at 08:49:36 UTC, Johan Engelen wrote:
On Monday, 7 March 2016 at 01:47:53 UTC, Yuxuan Shui wrote:
On Sunday, 6 March 2016 at 23:27:45 UTC, Adam D. Ruppe wrote:
It is just a mistake that TypeInfo isn't immutable, in my
opinion.
...though changing it would be a breaking
On Sunday, 6 March 2016 at 23:27:45 UTC, Adam D. Ruppe wrote:
It is just a mistake that TypeInfo isn't immutable, in my
opinion.
...though changing it would be a breaking change, I think it
would make sense to do it.
Is there really anything relies on TypeInfo being mutable?
In D (tested with D 2.070), one is allowed to modify TypeInfo
returned by typeid().
Here is an example how this "feature" can be used maliciously.
class A{
}
class C : A{
int a = 1234;
}
class B : A{
float b;
}
On Friday, 4 March 2016 at 00:42:28 UTC, Walter Bright wrote:
On 3/3/2016 4:29 PM, Yuxuan Shui wrote:
After linking each _DxxTypeInfo___initZ symbol should have
a unique address,
so why are we using hash of type name as TypeInfo.toHash()?
I don't think this has anything to do with compactin
After linking each _DxxTypeInfo___initZ symbol should have a
unique address, so why are we using hash of type name as
TypeInfo.toHash()?
I don't think this has anything to do with compacting GC. Is
there something I'm missing?
On Monday, 22 February 2016 at 19:33:12 UTC, Ice Create Man wrote:
On Thursday, 18 February 2016 at 23:33:45 UTC, Yuxuan Shui
wrote:
Just come across Kotlin today, and found some interesting
ideas skimming through its tutorial:
[...]
Both those issues predate both Kotlin and Swift. C# has ha
On Friday, 19 February 2016 at 08:29:00 UTC, Jonathan M Davis
wrote:
On Thursday, 18 February 2016 at 17:27:13 UTC, Chris Wright
wrote:
[...]
Unfortunately, given how easy it is to cast between mutable,
const, immutable, shared (and it's quite common to construct
something as mutable and the
On Friday, 19 February 2016 at 12:16:49 UTC, Jacob Carlborg wrote:
On 2016-02-19 00:33, Yuxuan Shui wrote:
Just come across Kotlin today, and found some interesting
ideas skimming
through its tutorial:
1) Null check
[snip]
You can even do this:
if (var == null) return;
//You can us
Just come across Kotlin today, and found some interesting ideas
skimming through its tutorial:
1) Null check
Kotlin has Optional types, suffixed with a '?'. Like 'Int?', same
as in Swift. But instead of explicitly unwrapping them (e.g. var!
in Swift, or var.unwrap() in Rust), Kotlin let you d
On Wednesday, 4 November 2015 at 23:10:09 UTC, Vladimir Panteleev
wrote:
On Wednesday, 4 November 2015 at 23:07:42 UTC, Yuxuan Shui
wrote:
I think this is a reasonable use case:
auto A(R, S)(R a,S b) {return a+b;}
auto B(alias f)(){return f(1, 1.0);}
void main{writeln(B!(A!int)());}
Current
I think this is a reasonable use case:
auto A(R, S)(R a,S b) {return a+b;}
auto B(alias f)(){return f(1, 1.0);}
void main{writeln(B!(A!int)());}
On Wednesday, 4 November 2015 at 23:07:42 UTC, Yuxuan Shui wrote:
I think this is a reasonable use case:
auto A(R, S)(R a,S b) {return a+b;}
auto B(alias f)(){return f(1, 1.0);}
void main{writeln(B!(A!int)());}
For now I have to explicitly write A like this:
template A(R){auto A(S)(R a, S b
On Friday, 31 July 2015 at 22:40:25 UTC, Trent Forkert wrote:
On Friday, 31 July 2015 at 00:13:42 UTC, Yuxuan Shui wrote:
[...]
Oh hey, that's me!
[...]
I've got a handful of work-in-progress changes I've yet to push
publicly, and even more I've yet to commit. (Yes, I have weird
work hab
On Friday, 31 July 2015 at 02:00:41 UTC, Mike Parker wrote:
On Friday, 31 July 2015 at 00:13:42 UTC, Yuxuan Shui wrote:
are there any other build systems I should look into?
Premake [1] supports mixing languages in the same build script.
It's not a build tool itself, but can generate makefi
Hi,
I'm working on a project that mixes both C and D code, and does
code generation as well.
I've been using a shell script to hack this together, since I
can't figure out how to do this with dub.
Now I'm looking for a proper build system for building this
project. reggae (https://github.c
On Monday, 13 July 2015 at 09:23:36 UTC, Jonathan M Davis wrote:
On Monday, 13 July 2015 at 06:49:10 UTC, Yuxuan Shui wrote:
[...]
https://issues.dlang.org/show_bug.cgi?id=9769
In theory, the plan is to remove opEquals, opCmp, toString, and
toHash from Object so that they no longer force a p
On Monday, 13 July 2015 at 09:10:41 UTC, ketmar wrote:
On Mon, 13 Jul 2015 06:49:09 +, Yuxuan Shui wrote:
The main reason here is to use '==' in @safe code:
class A {
override @safe bool opEquals(Object o) {
return cast(A)o !is null;
}
}
@safe void main() {
The main reason here is to use '==' in @safe code:
class A {
override @safe bool opEquals(Object o) {
return cast(A)o !is null;
}
}
@safe void main() {
A a = new A;
A b = new A;
a == b;
}
This doesn't compile in current D, because objects.o
On Sunday, 12 July 2015 at 10:45:52 UTC, rsw0x wrote:
On Sunday, 12 July 2015 at 09:13:03 UTC, Yuxuan Shui wrote:
For example:
import std.conv;
T a(T)(int a) {
return to!T(a);
}
void main(){
string x = a(2);
}
D is not able to deduce T. Can we make it possible to deduce
templat
For example:
import std.conv;
T a(T)(int a) {
return to!T(a);
}
void main(){
string x = a(2);
}
D is not able to deduce T. Can we make it possible to deduce
template arguments from where the return value is assigned to?
Rust is able to do this:
fn main() {
let a : Vec =
On Wednesday, 8 July 2015 at 17:30:59 UTC, Timon Gehr wrote:
On 07/08/2015 10:31 AM, Martin Nowak wrote:
On Wednesday, 8 July 2015 at 07:15:27 UTC, Yuxuan Shui wrote:
[...]
Hardly anyone wants switch to be a better if-else ladder.
https://issues.dlang.org/show_bug.cgi?id=5862
I don't think
I think it will be useful to extent switch statement to support
any type that implements opEquals and opHash.
Is there any technical difficulties to implement this?
On Thursday, 4 June 2015 at 18:27:16 UTC, Steven Schveighoffer
wrote:
On 6/4/15 2:08 PM, Ali Çehreli wrote:
[...]
That is a terrible excuse if that is what the issue is.
I recalled Don discussing this, found these threads (they are
old, maybe something has gotten better since then):
http:/
On Sunday, 3 May 2015 at 21:11:58 UTC, Walter Bright wrote:
Just merged in is a new compiler switch that instruments
generated code to collect statistics on memory allocation usage
and generates a report upon program termination. (Much like how
-profile works.)
This was based on a prototype A
On Saturday, 13 June 2015 at 05:14:00 UTC, Kenji Hara wrote:
2015-06-13 9:29 GMT+09:00 Idan Arye via Digitalmars-d <
digitalmars-d@puremagic.com>:
On Friday, 12 June 2015 at 23:26:00 UTC, Yuxuan Shui wrote:
When there are multiple overloaded functions, whose return
type will I
get when I use
On Friday, 12 June 2015 at 13:22:59 UTC, extrawurst wrote:
On Friday, 12 June 2015 at 12:58:46 UTC, Robert burner Schadek
wrote:
std.(experimental.)logger has been in phobos for one release.
The idea was to mature stuff in experimental for one release
and then have a vote on inclusion into phob
When there are multiple overloaded functions, whose return type
will I get when I use ReturnType? Is there a way I could choose a
specific function by its parameter types?
On Thursday, 11 June 2015 at 00:50:01 UTC, Andrei Alexandrescu
wrote:
https://issues.dlang.org/show_bug.cgi?id=14679
https://issues.dlang.org/show_bug.cgi?id=14680
Andrei
As for the .di file, I believe Rust compiler store serialized AST
in .a and .so. Is it possible that we do the same? And w
I tried something like this:
foreach(e; scoped!SomeRangeType(args)) {
}
And my program segment faults. But this works:
{
auto x = scoped!SomeRangeType(args);
foreach(e; x) {
}
}
Shouldn't the range be alive until the end of the loop?
101 - 150 of 150 matches
Mail list logo