Is it somehow possible to only run the unittests of a single d
file within a dub project? Of course without resorting to typing
the complete commandline with all versions includes switches etc.
On Sunday, 4 March 2018 at 10:43:06 UTC, Arjan wrote:
Is it somehow possible to only run the unittests of a single d
file within a dub project? Of course without resorting to
typing the complete commandline with all versions includes
switches etc.
In Coedit yes.
1/ The path to the other
Why is the following not working?
class Foo(string baz = "baz")
{
mixin("int " ~ baz ~ ";");
}
class Bar : Foo
{
}
Shouldn't it implicit do, without me having to do it manually?
class Bar : Foo!"baz"
{
}
...
What's the reason you can't specify default values for template
parameters on
Hi, I have a custom type D with front/popFront/empty implemented
as free functions, but isInputRange returns false. I copied the
implementation of isInputRange, and that custom implementation
returns true... anyone know what's going on here?
===
import std.stdio, std.range, std.traits;
//
On Sunday, 4 March 2018 at 11:57:12 UTC, Jonathan M Davis wrote:
On Sunday, March 04, 2018 11:35:23 bauss via
Digitalmars-d-learn wrote:
Why is the following not working?
class Foo(string baz = "baz")
{
mixin("int " ~ baz ~ ";");
}
class Bar : Foo
{
}
Shouldn't it implicit do, without
On Sunday, 4 March 2018 at 11:59:52 UTC, Mike Parker wrote:
On Sunday, 4 March 2018 at 11:35:23 UTC, bauss wrote:
Why is the following not working?
class Foo(string baz = "baz")
{
mixin("int " ~ baz ~ ";");
}
class Bar : Foo
{
}
Shouldn't it implicit do, without me having to do it
On Sunday, March 04, 2018 11:35:23 bauss via Digitalmars-d-learn wrote:
> Why is the following not working?
>
> class Foo(string baz = "baz")
> {
> mixin("int " ~ baz ~ ";");
> }
>
> class Bar : Foo
> {
> }
>
> Shouldn't it implicit do, without me having to do it manually?
>
> class Bar :
On Sunday, 4 March 2018 at 11:35:23 UTC, bauss wrote:
Why is the following not working?
class Foo(string baz = "baz")
{
mixin("int " ~ baz ~ ";");
}
class Bar : Foo
{
}
Shouldn't it implicit do, without me having to do it manually?
class Bar : Foo!"baz"
{
}
class Bar : Foo!()
{
}
On Sunday, 4 March 2018 at 11:38:37 UTC, Basile B. wrote:
On Sunday, 4 March 2018 at 10:43:06 UTC, Arjan wrote:
[...]
In Coedit yes.
1/ The path to the other source (usually the path>/src/ or /source/) folder must be registered
in the library manager.
2/ Menu "Compilation" item "Run file
On Sunday, 4 March 2018 at 13:17:30 UTC, Adam D. Ruppe wrote:
On Sunday, 4 March 2018 at 12:57:41 UTC, aliak wrote:
@property int front(D d) { return 2; }
@property bool empty(D d) { return false; }
void popFront(D d) {}
Those functions are in scope for your function, but not inside
then copy it to sources folder?
let's say I have a small library folder at C:\mylibrary\D where I
want to use dir.d from it. How do I add that file dependence to
dub? But I do not want to that file be passed directly to dmd, I
want to that file be copied to application's source folder (so
On Sunday, 4 March 2018 at 12:22:35 UTC, Basile B. wrote:
On Sunday, 4 March 2018 at 11:38:37 UTC, Basile B. wrote:
On Sunday, 4 March 2018 at 10:43:06 UTC, Arjan wrote:
[...]
In Coedit yes.
1/ The path to the other source (usually the path>/src/ or /source/) folder must be
registered in
Does anyone knows about any crash repórter library for D? there's
nothing I couldn't find at code packages. Something as simple and
easy to use like this C#'s
https://archive.codeplex.com/?p=crashreporterdotnet
On Sunday, 4 March 2018 at 16:46:56 UTC, Marc wrote:
then copy it to sources folder?
let's say I have a small library folder at C:\mylibrary\D where
I want to use dir.d from it. How do I add that file dependence
to dub? But I do not want to that file be passed directly to
dmd, I want to that
On Sunday, 4 March 2018 at 12:57:41 UTC, aliak wrote:
@property int front(D d) { return 2; }
@property bool empty(D d) { return false; }
void popFront(D d) {}
Those functions are in scope for your function, but not inside
std.range.
in other words std.range hasn't imported your module, so
When zeroing a slice of memory (either stack or heap) such as
enum n = 100;
ubyte[n] chunk;
should I use `memset` such as
memset(chunk.ptr, 0, n/2); // zero first half
or an array assignment such as
chunk[0 .. n/2] = 0; // zero first half
or are they equivalent in release
On Sunday, 4 March 2018 at 15:23:41 UTC, Nordlöw wrote:
When zeroing a slice of memory (either stack or heap) such as
enum n = 100;
ubyte[n] chunk;
should I use `memset` such as
memset(chunk.ptr, 0, n/2); // zero first half
or an array assignment such as
chunk[0 .. n/2] = 0;
On Sunday, March 04, 2018 14:43:41 bauss via Digitalmars-d-learn wrote:
> On Sunday, 4 March 2018 at 11:57:12 UTC, Jonathan M Davis wrote:
> > On Sunday, March 04, 2018 11:35:23 bauss via
> >
> > Digitalmars-d-learn wrote:
> >> Why is the following not working?
> >>
> >> class Foo(string baz =
On Sunday, March 04, 2018 21:03:23 arturg via Digitalmars-d-learn wrote:
> On Sunday, 4 March 2018 at 19:58:14 UTC, ag0aep6g wrote:
> > On 03/04/2018 08:54 PM, aliak wrote:
> >> wait a minute... so I can't use any std.range functions on a
> >> type if I add the range primitives as free functions?
On Sunday, 4 March 2018 at 21:12:44 UTC, arturg wrote:
you can pass it by alias:
import std.stdio;
void main(string[] args)
{
int x;
printName!(x);
}
void printName(alias var)()
{
writeln(__traits(identifier, var), " ", var);
}
Well, it works. But I am confused now, why. Isn't
On Sunday, 4 March 2018 at 21:48:53 UTC, JN wrote:
On Sunday, 4 March 2018 at 21:12:44 UTC, arturg wrote:
you can pass it by alias:
import std.stdio;
void main(string[] args)
{
int x;
printName!(x);
}
void printName(alias var)()
{
writeln(__traits(identifier, var), " ", var);
}
On Sunday, 4 March 2018 at 21:47:43 UTC, Jonathan M Davis wrote:
On Sunday, March 04, 2018 21:03:23 arturg via
Digitalmars-d-learn wrote:
isn't this what DIP 1005 tried to solve?
No. What DIP 1005 was trying to solve was avoiding having to
have imports used by your function signature or
On 03/04/2018 08:17 PM, Dennis wrote:
I was making a stack interface for an array:
```
struct Stack(T) {
import std.array: empty;
T[] stack;
alias stack this;
}
void main()
{
Stack!int stack;
bool x = stack.empty;
}
```
My expectation is that you can now call `empty` on
On 3/4/18 11:31, Drew Phil wrote:
Hey there!
I'm trying to figure out which of D's many multithreading options to use
for my application. I'm making a game that runs at 60 frames per second
that can also run user-made Lua scripts. I would like to have the Lua
scripts run in a separate thread so
On Sunday, 4 March 2018 at 20:07:06 UTC, visitor wrote:
On Sunday, 4 March 2018 at 19:53:59 UTC, ag0aep6g wrote:
On 03/04/2018 08:45 PM, ag0aep6g wrote:
I don't know what's going on here. The error message doesn't
make sense to me. Might be a bug in the compiler.
This one works:
struct
Imagine a function like this:
void printValue(T)(string name, T value)
{
writeln(name, " = ", value);
}
int x = 10;
printValue("x", x);
is it somehow possible to convert that printValue into a mixin or
something, so I could do something like:
printValue(x);
and it will figure out the "x"
I was making a stack interface for an array:
```
struct Stack(T) {
import std.array: empty;
T[] stack;
alias stack this;
}
void main()
{
Stack!int stack;
bool x = stack.empty;
}
```
My expectation is that you can now call `empty` on a stack
instance since I imported it in
Hey there!
I'm trying to figure out which of D's many multithreading options
to use for my application. I'm making a game that runs at 60
frames per second that can also run user-made Lua scripts. I
would like to have the Lua scripts run in a separate thread so
they can't delay frames if
On 03/04/2018 08:45 PM, ag0aep6g wrote:
I don't know what's going on here. The error message doesn't make sense
to me. Might be a bug in the compiler.
This one works:
struct Stack(T) {
T[] stack;
alias stack this;
bool empty() {return empty(stack);} /* not using UFCS */
On Sunday, 4 March 2018 at 13:17:30 UTC, Adam D. Ruppe wrote:
On Sunday, 4 March 2018 at 12:57:41 UTC, aliak wrote:
@property int front(D d) { return 2; }
@property bool empty(D d) { return false; }
void popFront(D d) {}
Those functions are in scope for your function, but not inside
I had the same issue, happens with any conflicting selective
import.
It seems to work if you dont use selective imports, but importing
it inside the function if possible is a better option.
On 03/04/2018 08:54 PM, aliak wrote:
wait a minute... so I can't use any std.range functions on a type if I
add the range primitives as free functions? O.o
Yes. In other words: You can't implement range primitives as free
functions. Because std.range (and std.algorithm, etc.) doesn't know
On Sunday, 4 March 2018 at 19:53:59 UTC, ag0aep6g wrote:
On 03/04/2018 08:45 PM, ag0aep6g wrote:
I don't know what's going on here. The error message doesn't
make sense to me. Might be a bug in the compiler.
This one works:
struct Stack(T) {
T[] stack;
alias stack this;
bool
On Sunday, 4 March 2018 at 19:58:14 UTC, ag0aep6g wrote:
On 03/04/2018 08:54 PM, aliak wrote:
wait a minute... so I can't use any std.range functions on a
type if I add the range primitives as free functions? O.o
Yes. In other words: You can't implement range primitives as
free functions.
On Sunday, 4 March 2018 at 21:03:04 UTC, JN wrote:
Imagine a function like this:
void printValue(T)(string name, T value)
{
writeln(name, " = ", value);
}
int x = 10;
printValue("x", x);
is it somehow possible to convert that printValue into a mixin
or something, so I could do something
`printName(alias var)()` is not a great solution, eg: doesn't work
with expressions, doesn't work with variadics, introduces template
bloat.
https://github.com/dlang/dmd/pull/7821 introduces
__traits(getCallerSource, symbol) which will allow what you want.
On Sun, Mar 4, 2018 at 1:53 PM, bauss
///
void fun(){}
///$(TABLE $(TR $(TD Back to:) $(TD href="#fun">Declaration) $(TD $(LINK2 #top, Top
unittest
{
}
it basically should look like this:
Declaration
void fun()
Example
---
---
[Back to:] [Declaration] [Top]
and if i replace the embbeded html with $(LINK2 #fun,
On 05/03/2018 6:35 PM, J-S Caux wrote:
I'm considering shifting a large existing C++ codebase into D (it's a
scientific code making much use of functions like atan, log etc).
I've compared the raw speed of atan between C++ (Apple LLVM version
7.3.0 (clang-703.0.29)) and D (dmd v2.079.0, also
On Monday, 5 March 2018 at 05:40:09 UTC, rikki cattermole wrote:
On 05/03/2018 6:35 PM, J-S Caux wrote:
I'm considering shifting a large existing C++ codebase into D
(it's a scientific code making much use of functions like
atan, log etc).
I've compared the raw speed of atan between C++
On Monday, 5 March 2018 at 05:40:09 UTC, rikki cattermole wrote:
atan should work out to only be a few instructions (inline
assembly) from what I've looked at in the source.
Also you should post the code you used for each.
Should be 3-4 instructions. Load input to the FPU (Optional?
On Saturday, 3 March 2018 at 02:32:11 UTC, Mario wrote:
So I've been learning D since the day 11 (I posted for first
time here) and now I've decided to try Vibe.D to make my
company API.
The fact is that I've achieved to do it (according to the
provided code) and it works! But it shows a
On 05/03/2018 7:01 PM, J-S Caux wrote:
On Monday, 5 March 2018 at 05:40:09 UTC, rikki cattermole wrote:
On 05/03/2018 6:35 PM, J-S Caux wrote:
I'm considering shifting a large existing C++ codebase into D (it's a
scientific code making much use of functions like atan, log etc).
I've compared
I'm considering shifting a large existing C++ codebase into D
(it's a scientific code making much use of functions like atan,
log etc).
I've compared the raw speed of atan between C++ (Apple LLVM
version 7.3.0 (clang-703.0.29)) and D (dmd v2.079.0, also ldc2
1.7.0) by doing long loops of
43 matches
Mail list logo