On Tuesday, 8 November 2016 at 07:39:12 UTC, Era Scarecrow wrote:
On Tuesday, 8 November 2016 at 06:04:59 UTC, thedeemon wrote:
On Tuesday, 8 November 2016 at 05:36:22 UTC, Era Scarecrow
wrote:
Hmmm.. I had the impression that if something was referenced
by another object, then it couldn't
On Sunday, 6 November 2016 at 21:46:52 UTC, Øivind wrote:
Hi,
My app occasionally gives me a
*** Error in `./hauto-test': double free or corruption
(fasttop): 0x7f504c002a60 ***
but gives me the following on every termination
On Saturday, 5 November 2016 at 13:34:51 UTC, Gianni Pisetta
wrote:
When i have time i will test it with ldc and see if the result
is the same, then it will probably be a front-end bug and i
will report it as an issue.
I think it has already been reported.
On Tuesday, 1 November 2016 at 18:13:32 UTC, TheGag96 wrote:
On Monday, 31 October 2016 at 07:16:50 UTC, Sebastien Alaiwan
wrote:
Hello,
From GCC 6.2, -fpie is becoming the default setting at compile
and at link time.
As dmd uses GCC to link, now the code needs to be compiled
with a special
On Monday, 31 October 2016 at 00:08:59 UTC, Charles Hixson wrote:
So now I removed the repository version of dmd and dub,
downloaded DMD64 D Compiler v2.072.0-b2, used dkpg to install
it, and appear to get the same errors.
(Well, actually I removed the commenting out of the code, but
it
On Sunday, 30 October 2016 at 20:50:47 UTC, Alfred Newman wrote:
Hello,
I'm migrating some Python code to D, but I stuck at a dead
end...
Sorry to provide some .py lines over here, but I got some
doubts about the best (fastest) way to do that in D.
Executing the function parsertoken("_My
On Sunday, 30 October 2016 at 18:02:28 UTC, Charles Hixson wrote:
dmd --version
DMD64 D Compiler v2.071.2
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
on debian testing.
dub is installed via apt-get.
Should I revert to an earlier version? Or what?
The program:
import
Hi!
A simple question: is there a way to list all defined version
specifications?
Something like:
pragma(msg, __traits(allVersions));
Example output (DMD on Ubuntu x64, release build):
[all, D_InlineAsm_X86_64, X86_64, Posix, linux, DigitalMars,
CRuntime_Glibc, D_Version2,
On Sunday, 2 October 2016 at 20:12:16 UTC, rumbu wrote:
[...]
I think you'll find the following article really interesting. It
talks exactly about what you are experiencing.
http://dlang.org/hijack.html
On Sunday, 2 October 2016 at 17:10:58 UTC, mikey wrote:
There is already a degree of transparency with how properties
being handled for example in allowing properties to be an
lvalue if they have a setter.
t.val = 42;
Actually, this is not specific to properties, as it also works on
On Sunday, 2 October 2016 at 14:26:46 UTC, mikey wrote:
[...]
Yeah, a property is quite different from a variable. In fact, a
property may refer to a computed value, which may not have an
address and as such cannot be modified:
@property auto currentTimeMillis()
{
return
On Sunday, 25 September 2016 at 09:01:44 UTC, Namespace wrote:
import std.stdio;
struct Something
{
int x, y;
float z;
auto opIndex()(string member) {
switch (member) {
case "x": return this.x;
case "y": return
On Thursday, 22 September 2016 at 20:35:13 UTC, e-y-e wrote:
[...]
Disclaimer: my answers are just early guesses.
1. Why is openRight a runtime flag? Is there really a use case
for this?
Runtime evaluation is more flexible. The reason to have
compile-time evaluation is to allowed
On Thursday, 22 September 2016 at 16:09:49 UTC, Sandu wrote:
It is often being claimed that D is at least as fast as C++.
Now, I am fairly new to D. But, here is an example where I want
to see how can this be made possible.
So far my C++ code compiles in ~850 ms.
I assume you meant that it
On Thursday, 22 September 2016 at 14:29:20 UTC, Jonathan Marler
wrote:
Actually, the more I think about it, I'm not sure there's a
good reason for the "package.d" semantics to exist. I guess it
establishes a pattern when people would like to combine smaller
modules into one public module, but
On Monday, 19 September 2016 at 18:10:22 UTC, bachmeier wrote:
Suppose I want to iterate over two arrays at once:
foreach(v1, v2; [1.5, 2.5, 3.5], [4.5, 5.5, 6.5]) {
...
}
I have seen a way to do this but cannot remember what it is and
cannot find it.
You can use std.range.zip:
On Saturday, 17 September 2016 at 19:01:10 UTC, Geert wrote:
On Saturday, 17 September 2016 at 18:36:52 UTC, llmp wrote:
On Saturday, 17 September 2016 at 18:18:37 UTC, Geert wrote:
I've compiled a small application, and it runs when i execute
it at the same directory where is the glade file.
On Saturday, 10 September 2016 at 19:46:51 UTC, Jonathan Marler
wrote:
This is been bugging me for a while. Is it possible to have a
mutable reference to an immutable class? [...]
You are probably looking for std.typecons.Rebindable:
https://dlang.org/phobos/std_typecons.html#.Rebindable
On Saturday, 10 September 2016 at 08:23:35 UTC, Q. Schroll wrote:
Is there a difference between inferred and annotated attributes?
Example:
struct X(T)
{
this(S)(in S[] arr) // inferred pure
{ }
}
void main() pure
{
X!uint mut = [ 1, 2 ]; // proves
On Thursday, 8 September 2016 at 11:40:17 UTC, Russel Winder
wrote:
Is the fact that:
void f() nothrow {
assert(1 == 0);
}
int main() {
f();
return 0;
}
compiles fine but at run time f does indeed throw an exception
what should happen? If
On Thursday, 8 September 2016 at 08:20:49 UTC, Jon Degenhardt
wrote:
I've been generalizing output routines by passing an
OutputRange as an argument. This gets interesting when the
output routine is an virtual function. Virtual functions cannot
be templates, so instead the template parameters
On Wednesday, 7 September 2016 at 11:37:44 UTC, Russel Winder
wrote:
I'd prefer immutable, but const sometimes has to do. The idea
is to find out how to enforce single assignment in D.
Everything depends on what you mean by "single assignment".
If you mean "I can't use opAssign", then const
On Wednesday, 7 September 2016 at 08:19:39 UTC, Russel Winder
wrote:
On Tue, 2016-09-06 at 14:50 +, Lodovico Giaretta via
Digitalmars-d- learn wrote:
[…]
From a quick look, it looks like `results` is a
`const(TickDuration[3])`, that is a fixed-length array. And
fixed-length arrays
On Tuesday, 6 September 2016 at 20:46:54 UTC, Jon Degenhardt
wrote:
Is there a way to constrain template arguments to reference or
value types? I'd like to do something like:
T foo(T)(T x)
if (isReferenceType!T)
{ ... }
--Jon
You can use `if(is(T : class) || is(T : interface))`.
If you
On Tuesday, 6 September 2016 at 14:38:54 UTC, Russel Winder wrote:
The code fragment:
const results = benchmark!(run_mean, run_mode, run_stdDev)(1);
const times = map!((TickDuration t) { return
(to!Duration(t)).total!"seconds"; })(results);
seems entirely reasonable to me. However
On Monday, 5 September 2016 at 17:33:17 UTC, pineapple wrote:
I have a program which I have stripped down to a single
offending line which, when present in my program, causes an
invalid memory operation to occur after main has evaluated:
import mach.sdl.window;
void main(){
On Monday, 5 September 2016 at 15:20:10 UTC, pineapple wrote:
I'd like to be able to write something like this, but I haven't
been able to find anything in the docs
class Base{}
class Sub: Base{}
static assert(is(SuperClassOf!Sub == Base));
On Monday, 5 September 2016 at 12:15:35 UTC, dom wrote:
[...]
You misunderstood the error message and the lambda syntax (it
also happened to me the first time).
The grammar says that you can use one of these syntaxes:
1) `(arguments) {block of code}`
2) `(arguments) => expression`, which
On Monday, 5 September 2016 at 10:00:26 UTC, Suliman wrote:
Usually I am storing daba from DB as array of structures.
Something like:
struct MyData
{
int id;
string name;
int age;
}
MyData mydata;
Then I am creating array of structures:
MyData [] mydatas;
And fill data in my code. Then
On Monday, 5 September 2016 at 06:45:07 UTC, data pulverizer
wrote:
On Sunday, 4 September 2016 at 14:49:30 UTC, Lodovico Giaretta
wrote:
Your getCol(i) could become getCol!T(i) and return an instance
of GenericVector!T directly, after checking that the required
column has in fact that type:
On Sunday, 4 September 2016 at 19:15:15 UTC, Igor wrote:
So, you are saying compiler is keeping a kind of linked list of
dependencies and then checks if any of those lists are
circular? But how exactly would that list be structured since
one expression can have multiple dependencies, like:
On Sunday, 4 September 2016 at 14:24:12 UTC, data pulverizer
wrote:
On Sunday, 4 September 2016 at 14:20:24 UTC, data pulverizer
wrote:
On Sunday, 4 September 2016 at 14:07:54 UTC, data pulverizer
wrote:
@Lodovico Giaretta Thanks I just saw your update!
@Lodovico Giaretta BTW what do you
On Sunday, 4 September 2016 at 09:55:53 UTC, data pulverizer
wrote:
[...]
Your code is not very D style and, based on your needs, there may
be better ways to achieve your goal, but without knowing your use
case, it's difficult to give correct advice.
Talking about that writeln statement,
On Saturday, 3 September 2016 at 14:06:06 UTC, Igor wrote:
Can anyone explain in plain English how does compiler process
and detect a "test.d(6) Error: forward reference of variable a"
in following code:
import std.stdio;
enum a = 1 + b;
enum d = 5 + a; // No error here
enum b = 12 + c;
enum
On Sunday, 28 August 2016 at 21:52:48 UTC, Illuminati wrote:
The interlocked functions generate memory barriers, does
atomicOp do that?
Also D doesn't seem to have a volitile keyword anymore which is
required to prevent the compiler from prematurely optimizing
critical code.
I'm under the
On Sunday, 28 August 2016 at 19:53:51 UTC, Illuminati wrote:
What are the D equivalents to these types of functions?
I do not see anything in core.atomic that can accomplish this.
I have tried to include core.sys.windows.winbase but still get
linker errors(I've also directly tried importing
On Monday, 22 August 2016 at 12:14:41 UTC, Alexandru Ermicioi
wrote:
Good day.
In current implementation of dmd/ldc/gdc, does this trait
guarantee, that the order of elements returned in tuple, is
same, in several calls of it on same Type and member?
Also, is guaranteed that in future
On Sunday, 21 August 2016 at 20:36:54 UTC, Engine Machine wrote:
On Sunday, 21 August 2016 at 19:42:08 UTC, Lodovico Giaretta
wrote:
[...]
You're right. I didn't realize that variables could be shadowed
in classes. Seems dangerous. D doesn't allow shadowing in a
normal context and gives an
On Sunday, 21 August 2016 at 19:42:08 UTC, Lodovico Giaretta
wrote:
On Sunday, 21 August 2016 at 19:29:26 UTC, Engine Machine wrote:
[...]
The problem of this code has nothing to do with aliases. They
work correctly. The problem is variable shadowing. In the
following code, Child has two x
On Sunday, 21 August 2016 at 19:29:26 UTC, Engine Machine wrote:
[...]
The problem of this code has nothing to do with aliases. They
work correctly. The problem is variable shadowing. In the
following code, Child has two x variables, one of which is only
accessible from a Parent reference,
On Thursday, 18 August 2016 at 16:19:41 UTC, Johan Engelen wrote:
On Thursday, 18 August 2016 at 11:43:03 UTC, Lodovico Giaretta
wrote:
Which compiler version are you using? On DMD 2.071.0 this does
not work.
Note: this does work with LDC 1.1.0 even though it is based on
DMD 2.071.
On Thursday, 18 August 2016 at 11:11:10 UTC, mogu wrote:
On Thursday, 18 August 2016 at 10:45:14 UTC, Lodovico Giaretta
wrote:
Which kind of error? An error message by the compiler? One by
the linker? The compiler crashes?
Compiler Error exactly. The minimal code is(dmd or ldc2 in
ubuntu
On Wednesday, 17 August 2016 at 19:15:48 UTC, ag0aep6g wrote:
On 08/17/2016 08:38 PM, Engine Machine wrote:
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico
Giaretta wrote:
[...]
You mean something like:
struct MySequence(Args...)
{
enum length = Args.length;
alias args = Args;
On Wednesday, 17 August 2016 at 13:21:16 UTC, Cauterite wrote:
On Wednesday, 17 August 2016 at 13:18:06 UTC, Adam D. Ruppe
wrote:
Best you can do is use them in an alias argument directly, but
you cannot use them in an enum argument.
I think you missed the point; it works perfectly fine
On Tuesday, 16 August 2016 at 23:18:28 UTC, Adam D. Ruppe wrote:
On Tuesday, 16 August 2016 at 19:17:27 UTC, Engine Machine
wrote:
alias x = AliasSeq!(a, b, AliasSeq!(c, d));
results in a flat sequence. I would like to be able to keep
them separate so I can have sub sequences.
wrap them in
On Tuesday, 16 August 2016 at 19:23:51 UTC, Engine Machine wrote:
On Tuesday, 16 August 2016 at 17:39:14 UTC, Lodovico Giaretta
wrote:
On Monday, 15 August 2016 at 19:31:14 UTC, Engine Machine
wrote:
[...]
I don't know if this is exactly what you want:
=
On Monday, 15 August 2016 at 19:31:14 UTC, Engine Machine wrote:
Suppose I have a templated type like
struct S(T) { int x; static if (T is Y) int y; }
I would like to be able to create a reference to S(T) for any T,
struct Q
{
S!* s; // Can hold any type of S.
}
and be able to access s.x,
On Tuesday, 16 August 2016 at 15:46:23 UTC, WhatMeWorry wrote:
I've got a large Visual Studio Solution which contains lots of
Projects. Each project is a standalone D/OpenGL tutorial. I
want to make it OS and IDE agnostic so it can be easily played
with on Windows, Linux, and Mac OS so I
On Monday, 15 August 2016 at 15:01:13 UTC, Oleg B wrote:
Hello.
In std.xml docs I read that is deprecated, [...]
For XML I found this project
https://github.com/lodo1995/experimental.xml. Is this really
candidate to std, or author just called it as he want?
Hi!
I'm the developer of that XML
On Thursday, 11 August 2016 at 20:27:51 UTC, Michael Coulombe
wrote:
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
On Thursday, 11 August 2016 at 18:11:30 UTC, Engine Machine wrote:
[...]
If, in your case, it is possible to use one type as the other,
then specify it.
I mean, implement a templated opAssign that allows you to assign
values of one instantiation to values of another. While doing so,
On Wednesday, 10 August 2016 at 21:00:01 UTC, Lodovico Giaretta
wrote:
On Wednesday, 10 August 2016 at 20:54:15 UTC, Steven
Schveighoffer wrote:
[...]
Wow. Thanks. I didn't know the compiler would try opSlice. I
will file it.
Filed on bugzilla:
On Wednesday, 10 August 2016 at 20:54:15 UTC, Steven
Schveighoffer wrote:
On 8/10/16 2:08 PM, Lodovico Giaretta wrote:
[...]
The issue is that it tries using [] on the item to see if it
defines a range-like thing. Since you don't define opSlice(),
it automatically goes to the subrange.
On Wednesday, 10 August 2016 at 19:37:39 UTC, Ali Çehreli wrote:
A quick read reveals popFront() is implemented only for bool
Arrays. That explains the issue.
I don't know whether it's an oversight.
Ali
First of all, thank you for spending your time on this issue. I
really appreciate that.
On Wednesday, 10 August 2016 at 18:38:00 UTC, Ali Çehreli wrote:
RangeWrapper does not provide the InputRange interface, so the
compiler uses 'alias this' and iterates directly on the member
range.
I tried making RangeWrapper an InputRange but failed. It still
uses 'range'.
// Still fails
On Wednesday, 10 August 2016 at 18:08:02 UTC, Lodovico Giaretta
wrote:
I'm probably missing something stupid but...
Why on earth do the two loops in main print a different result?
It looks like the foreach lowering is ignoring my definition of
front...
I'm probably missing something stupid but...
Why on earth do the two loops in main print a different result?
It looks like the foreach lowering is ignoring my definition of
front...
=
import std.stdio, std.container.array;
struct
On Wednesday, 10 August 2016 at 15:54:42 UTC, Adam D. Ruppe wrote:
On Wednesday, 10 August 2016 at 15:48:10 UTC, Lodovico Giaretta
wrote:
I read the spec again, and found out that it says interfaces
cannot contain templated functions... So either my
interpretation is the intended one and the
On Wednesday, 10 August 2016 at 15:48:10 UTC, Lodovico Giaretta
wrote:
On Wednesday, 10 August 2016 at 15:39:19 UTC, Arafel wrote:
Would it even make sense to "force" (deprecation warning) a
"final" keyword in any implicitly-final function (I wasn't
even aware of those, I have to admit)? It
On Wednesday, 10 August 2016 at 15:39:19 UTC, Arafel wrote:
On Wednesday, 10 August 2016 at 15:25:40 UTC, Lodovico Giaretta
wrote:
Because templated functions cannot be virtual, it follows that
I.func is final. Having no body, the compiler thinks that its
body will be found by the linker in
On Wednesday, 10 August 2016 at 15:20:37 UTC, Arafel wrote:
I'm not sure if the following is even expected to work, since
I'm not sure how the vtable for the interface would look like
(well, that would be applicable to any overriden templated
method, though):
---
public interface I {
On Friday, 29 July 2016 at 13:18:00 UTC, Suliman wrote:
Use the `destroy` function to finalize an object by calling its
destructor. The memory of the object is not immediately
deallocated, instead the GC will collect the memory of the
object at an undetermined point after finalization:
class
On Thursday, 28 July 2016 at 15:24:22 UTC, Dechcaudron wrote:
On Thursday, 28 July 2016 at 15:18:24 UTC, Lodovico Giaretta
wrote:
3) at program end, live objects are not scheduled for
finalization;
4) at program end, pending finalizations from previous
collections may not be run.
I didn't
On Thursday, 28 July 2016 at 15:02:58 UTC, Dechcaudron wrote:
On Thursday, 28 July 2016 at 14:43:32 UTC, Lodovico Giaretta
wrote:
No! Never run important finalization in a class destructor!
The GC is not obliged to run the destructors, so you may end
up with your objects destroyed but the
On Thursday, 28 July 2016 at 14:33:26 UTC, Dechcaudron wrote:
On Thursday, 28 July 2016 at 14:01:45 UTC, Suliman wrote:
2. Should I call destructor and how it's should like?
You certainly want to close the connection to the db.
Basically, the destructor is intended to free resources such as
On Thursday, 28 July 2016 at 09:10:33 UTC, Kagamin wrote:
Create an RFE? Given that regex returns results as slices of
the input string, using the replacement character doesn't
introduce data corruption.
(RFE = Request For Enhancement, right?)
Yes, all algorithms that use decode internally
On Sunday, 24 July 2016 at 15:31:28 UTC, lqjglkqjsg wrote:
Almost off topic but I've recognized a typical error here, I
think that many of us have already seen it too. You develop a
nice class. You put attributes everywhere @safe pure nothrow
@nogc. Yay the unittest pass.
Later you use it
On Sunday, 24 July 2016 at 15:28:53 UTC, Jonathan Marler wrote:
Whoa wait a second...I didn't know you could do this. I
thought everything had to inherit from the object class. Can
you share the syntax to define a class that doesn't derive from
object?
Currently, you cannot. Everything
On Sunday, 24 July 2016 at 14:54:11 UTC, Jonathan Marler wrote:
I believe Rufus was only referring to the virtual methods
defined in the object class. That would be:
toHash (Note: this is already nothrow, that's intersting and
quite restrictive)
opCmp
opEquals
I think all 3 of these are
On Sunday, 24 July 2016 at 02:17:27 UTC, Rufus Smith wrote:
This just isn't right. What your saying is that because someone
screwed up, we must live with the screw up and build everyone
around the screw up. This mentality is why everyone is so
screwed up in the first place, do you not see
On Saturday, 23 July 2016 at 21:44:05 UTC, Rufus Smith wrote:
On Saturday, 23 July 2016 at 17:27:24 UTC, Lodovico Giaretta
wrote:
- we trust what we are doing: e.g. we cannot mark a thing
@nogc, but we know it is and the profiler confirms that no
allocation happens, so we are happy; our
On Saturday, 23 July 2016 at 21:44:05 UTC, Rufus Smith wrote:
Templates are not the end all be all. They don't allow for
run-time polymorphism, which is an important aspect of software.
Ok, so you need runtime polymorphism. And you want it in @nogc
code. That's not difficult. Just have the
On Saturday, 23 July 2016 at 17:04:42 UTC, Jonathan Marler wrote:
On Saturday, 23 July 2016 at 16:46:20 UTC, Jonathan Marler
wrote:
[...]
Actually Im going to disagree with myself. This technique
actually wouldn't work with virtual methods:)
I don't think we have the big problems with
On Saturday, 23 July 2016 at 14:53:49 UTC, Rufus Smith wrote:
Um, this isn't right. GC code can always call non-gc code.
If you mark opEquals nogc, it breaks nothing except
implementations of opEquals that use the GC. GC code can still
call it nogc opequals, it only enforces opEquals code to
On Saturday, 23 July 2016 at 13:18:03 UTC, Rufus Smith wrote:
Trying to compare a *ptr value with a value in nogc code
results in the error:
Error: @nogc function '...' cannot call non-@nogc function
'object.opEquals'
Shouldn't object opEquals be marked?
If object.opEquals is marked
On Friday, 22 July 2016 at 20:26:50 UTC, Rufus Smith wrote:
On Friday, 22 July 2016 at 19:52:59 UTC, Lodovico Giaretta
wrote:
On Friday, 22 July 2016 at 18:30:13 UTC, Rufus Smith wrote:
Trying to compile code that uses GDC, had to import phobos
files from dmd in to project since they are not
On Friday, 22 July 2016 at 18:30:13 UTC, Rufus Smith wrote:
Trying to compile code that uses GDC, had to import phobos
files from dmd in to project since they are not in the GDC's
phobo lib(the core.sys.windows stuff).
Almost all the errors are related to stuff like
PALETTEENTRY* peNew()
On Friday, 22 July 2016 at 18:30:13 UTC, Rufus Smith wrote:
Trying to compile code that uses GDC, had to import phobos
files from dmd in to project since they are not in the GDC's
phobo lib(the core.sys.windows stuff).
Almost all the errors are related to stuff like
PALETTEENTRY* peNew()
On Thursday, 21 July 2016 at 09:46:10 UTC, Lodovico Giaretta
wrote:
Interesting.
This is worth a bugzilla issue, IMHO. In fact, if you try the
other way (i.e.: you provide an implementation of func in class
C), you get the opposite error, that you are overriding a final
function (B.func).
On Thursday, 21 July 2016 at 09:41:27 UTC, Saurabh Das wrote:
I have an interface A which declares a certain function. A
second interface B inherits from A and wishes to provide a
default implementation for that function. How can I achieve
this? I'm facing an error when I try this:
interface
On Wednesday, 20 July 2016 at 18:08:14 UTC, stunaep wrote:
On Wednesday, 20 July 2016 at 05:45:21 UTC, Jonathan M Davis
wrote:
On Wednesday, July 20, 2016 04:03:23 stunaep via
Digitalmars-d-learn wrote:
[...]
If you want the list of members in an enum, then use
std.traits.EnumMembers and
On Wednesday, 20 July 2016 at 05:54:41 UTC, mogu wrote:
On Wednesday, 20 July 2016 at 01:50:37 UTC, Adam D. Ruppe wrote:
On Wednesday, 20 July 2016 at 01:14:05 UTC, mogu wrote:
Why S's type isn't something like `S: (T) -> S`?
Because S isn't a type... think of a template as being like a
On Tuesday, 19 July 2016 at 17:05:55 UTC, Rufus Smith wrote:
On Tuesday, 19 July 2016 at 16:59:48 UTC, Lodovico Giaretta
wrote:
On Tuesday, 19 July 2016 at 16:50:56 UTC, Rufus Smith wrote:
On Tuesday, 19 July 2016 at 16:09:38 UTC, Lodovico Giaretta
wrote:
[...]
But this doesn't create a
On Tuesday, 19 July 2016 at 16:50:56 UTC, Rufus Smith wrote:
On Tuesday, 19 July 2016 at 16:09:38 UTC, Lodovico Giaretta
wrote:
On Tuesday, 19 July 2016 at 15:55:02 UTC, Rufus Smith wrote:
I have some functions that take other functions. I would like
the attributes to be able to "fall" through
On Tuesday, 19 July 2016 at 15:55:02 UTC, Rufus Smith wrote:
I have some functions that take other functions. I would like
the attributes to be able to "fall" through so I get overload
like behavior. I only care that I am passing a function, not if
it is shared, extern(C), pure, @nogc, etc.
On Tuesday, 19 July 2016 at 15:36:42 UTC, Lodovico Giaretta wrote:
As you have to do `isTuple!(T[0])`, you also have to do
`x[0].expand`.
That's because T... works "as if" it was an array of types, and
x, being of type T, it works "as if" it was an array of values.
So you have to use an index
On Tuesday, 19 July 2016 at 13:33:41 UTC, jmh530 wrote:
On Tuesday, 19 July 2016 at 07:23:52 UTC, John wrote:
auto bar(T...)(T x)
{
static if (T.length == 1 && isTuple!(T[0]))
return foo(x.expand);
else
return foo(x);
}
Hmm, this actually doesn't seem to be resolving my issue.
On Tuesday, 19 July 2016 at 12:23:11 UTC, celavek wrote:
On Tuesday, 19 July 2016 at 09:57:27 UTC, Lodovico Giaretta
wrote:
On Tuesday, 19 July 2016 at 09:42:40 UTC, celavek wrote:
Works for me:
size_t[char] counts;
const string dna_chain =
On Tuesday, 19 July 2016 at 09:42:40 UTC, celavek wrote:
On Tuesday, 19 July 2016 at 09:41:32 UTC, John wrote:
On Tuesday, 19 July 2016 at 09:34:11 UTC, celavek wrote:
Hi,
I am trying to count characters in a string like:
const string dna_chain =
On Monday, 18 July 2016 at 21:12:38 UTC, Meta wrote:
On Monday, 18 July 2016 at 13:00:16 UTC, Lodovico Giaretta
wrote:
As per title, is it possible to iterate all visible symbols of
the current module and of all imported modules and packages?
My aim is to find everything in scope that has a
On Monday, 18 July 2016 at 18:21:41 UTC, ketmar wrote:
short answer: no.
there is still no way to write a reliable enumerator like this:
too much things to hack around.
as for module symbols, it is easy: they has no type. literally:
`!is(typeof(...))`.
`is(typeof(...))` is a necessary
As per title, is it possible to iterate all visible symbols of
the current module and of all imported modules and packages? My
aim is to find everything in scope that has a specific UDA.
module foo;
import std.stdio, std.array, std.algorithm;
void bar(){}
struct S{}
void main()
{
//
On Thursday, 14 July 2016 at 19:28:23 UTC, Andrey wrote:
On Thursday, 14 July 2016 at 19:27:14 UTC, Andrey wrote:
Hi guys!
Help a newbie please.
Playing with D and trying to understand some features.
Here is my try to carry out my code from C++ project to D
struct Sigmoid(T)
{
const T
On Wednesday, 13 July 2016 at 22:42:36 UTC, Adam Sansier wrote:
On Wednesday, 13 July 2016 at 21:27:16 UTC, Lodovico Giaretta
wrote:
At the end, all memory comes from one of these: GC heap,
malloc, mmap, sbrk. All other allocators build on top of these
(or on top of user supplied buffers,
On Wednesday, 13 July 2016 at 21:12:29 UTC, Adam Sansier wrote:
The advantages over a simple malloc are:
1) You can change between GC allocation, malloc, mmap and
other allocators by changing a single line, instead of
changing every throw;
Ok, I like!
2) you can use very fast allocators,
On Wednesday, 13 July 2016 at 20:44:52 UTC, Adam Sansier wrote:
On Wednesday, 13 July 2016 at 16:28:23 UTC, Lodovico Giaretta
wrote:
It's actually quite easy. Here's the code (untested):
import
On Wednesday, 13 July 2016 at 16:13:21 UTC, Adam Sansier wrote:
On Wednesday, 13 July 2016 at 11:39:11 UTC, Lodovico Giaretta
wrote:
On Wednesday, 13 July 2016 at 00:57:38 UTC, Adam Sansier wrote:
[...]
You shall use a static per-thread Region allocator[1] backed
by Mallocator[2].
Then you
On Wednesday, 13 July 2016 at 12:37:26 UTC, Miguel L wrote:
I tried Appender, but for some reason garbage collector still
seems to be running every few iterations.
I will try to expand a little on my code because maybe there is
something i am missing:
Appender!(A[]) a;
void foo( out
On Wednesday, 13 July 2016 at 12:20:07 UTC, cym13 wrote:
The best option would be a.clear(). From the language specs:
“Removes all remaining keys and values from an associative
array. The array is not rehashed after removal, to allow for
the existing storage to be reused. This will affect all
On Wednesday, 13 July 2016 at 11:59:18 UTC, Miguel L wrote:
I am using a temporary dynamic array inside a loop this way:
A[] a;
for()
{
a=[]; //discard array contents
... appends thousand of elements to a
... use a for some calculations
}
I would like to know which would be the best way to
1 - 100 of 141 matches
Mail list logo