Am 01.12.20 um 08:11 schrieb ryuukk_:
> Running .\dawn-test-application.exe
> 2 modules passed unittests
>
>
> Wich ones? it should print
>
>
> ```
> Running tests for target X
>
> - src/module_a.d Tests: OK <-- line in green
> - src/module_b.d Tests: OK
>
Am 01.12.20 um 14:55 schrieb drug:
> On 12/1/20 2:40 PM, Johannes Loher wrote:
>> ...
>> However, I am having trouble running the unit tests when using the
>> ...
>
> This can be one of solution https://github.com/dlang/dub/pull/2050
>
Thanks! Let's see if it gets merged or if a slightly more
Am 01.12.20 um 14:52 schrieb jmh530:
> On Tuesday, 1 December 2020 at 13:52:35 UTC, jmh530 wrote:
>> On Tuesday, 1 December 2020 at 11:40:38 UTC, Johannes Loher wrote:
>>> [snip]
>>>
>>> Any hints on how to execute unit tests from single file DUB packages?
>>> Is it even possible at the moment?
Hello everybody,
when solving today's problem for the adventofcode [1], I decided to try
out DUB's single file package feature, in order to keep things short.
When doing the adventofcode, I always use the given examples as unit
tests in order to verify that my solutions are actually correct.
Am 26.06.20 um 15:35 schrieb ag0aep6g:
> `isInputRange!R` fails because it has no knowledge of your free `empty`
> function. Without `empty`, `R` is obviously not a range.
Ah, OK, that makes sense. It's kind of sad though because it really
limits the extensibility of existing types with UFCS. Do
Recently, I read about problems regarding the API design of ranges (not
being able to make them const, differences between class and struct
based ranges etc.).
One of the issues that came up what the fact that sometimes it is useful
to use the class wrappers `InputRangeObject` etc. if you need to
On Saturday, 13 June 2020 at 12:47:31 UTC, Stanislav Blinov wrote:
[...]
The temporary exists until the end of full expression, or until
the end of enclosing statement. It is simply not an lvalue for
the caller, but it certainly exists, and so its interface must
function.
So public data
Consider the following example:
```
struct A
{
auto a(int _a)
{
return this._a = _a;
}
int _a = 0;
}
void main()
{
static assert(!__traits(compiles, { A()._a = 2; }));
static assert(__traits(compiles, { A().a(2); }));
}
```
(https://run.dlang.io/is/GkmpA8)
Why
On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
I want Sublime D auto import !
When typing code like this:
class Uno : IStylable
{
//
}
I want will be auto added "import IStylable" at begin of file.
Like this:
import ui.istylable : IStylable;
On Saturday, 30 May 2020 at 23:39:31 UTC, mw wrote:
On Saturday, 30 May 2020 at 22:21:14 UTC, Paul Backus wrote:
[...]
Thank you all for the reply.
I hate to write boilerplate code:
[...]
import std.stdio : writeln;
mixin template f(T, string name, T value = T.init)
{
mixin("T _" ~
On Friday, 29 May 2020 at 00:09:56 UTC, Clarice wrote:
It seems that @safe will be de jure, whether by the current
state of DIP1028 or otherwise. However, I'm unsure how to
responsibly determine whether a FFI may be @trusted: the type
signature and the body. Should I run, for example, a C
On Thursday, 28 May 2020 at 20:26:55 UTC, Quantium wrote:
I need to create a variable with custom name, like this
import std;
void main()
{
string name;
readf(" %s", );
// some code that generates a variable of type integer and
value 0
}
Could you help me with that?
Do you want
Am 27.05.20 um 12:30 schrieb wjoe:
>
> Could you please elaborate why checked exceptions are more annoying?
>
> The only exposure to checked exceptions I had was with Java and I always
> liked and appreciated them.
> It's super annoying the fiddle around with catch(Exception) all over the
>
On Tuesday, 26 May 2020 at 22:23:19 UTC, bauss wrote:
On Tuesday, 26 May 2020 at 12:08:29 UTC, Johannes Loher wrote:
[...]
You can just do this to get around it:
auto button = this;
log();
True, somebody else posted the same idea already. But as
explained, it doesn't do
Am 26.05.20 um 16:17 schrieb Vinod K Chandran:
> On Tuesday, 26 May 2020 at 13:48:52 UTC, ag0aep6g wrote:
>> On 26.05.20 15:43, Vinod K Chandran wrote:
>>> So far now, two solutions are very clear for this problem.
>>> 1. As per John Chapman's suggestion - use
>>> cast(DWORD_PTR)cast(void*)this).
On Tuesday, 26 May 2020 at 12:08:29 UTC, Johannes Loher wrote:
[...]
Small correction: I said that this is an lvalue and that you
cannot take the address of lvalues. Of course that is incorrect,
I meant to say that rvalues (this is an rvalue and you cannot
take the address of rvalues).
On Tuesday, 26 May 2020 at 11:44:58 UTC, Vinod K Chandran wrote:
On Monday, 25 May 2020 at 16:39:30 UTC, Mike Parker wrote:
On Monday, 25 May 2020 at 08:39:23 UTC, John Burton wrote:
I believe that in D *this* is a reference to the
object and not a pointer like in C++.
So I think that writing
On Tuesday, 3 December 2019 at 10:06:22 UTC, Mike Parker wrote:
On Tuesday, 3 December 2019 at 10:03:22 UTC, Basile B. wrote:
That's interesting details of D developement. Since you reply
to the first message I think you have not followed but in the
last reply I told that maybe we should be
On Monday, 9 September 2019 at 10:46:10 UTC, Dennis wrote:
Such a shame it got rejected in favor of ugly 'no return'
annotations [...]
This is incorrect. It was rejected because the proposal was not
solid enough. While it is true that a lot of people seemed to
prefer an annotation based
Am 13.08.19 um 11:48 schrieb Mirjam Akkersdijk:
> Hello there,
> If I had a DLL, how would I sort it judging by the node contents, the D
> way?
>
> In C if I were to sort a piece of malloc'd memory pointing to node
> pointers, I would write my compare function and let qsort sort it out.
> In D, I
Am 22.07.19 um 20:38 schrieb Jonathan M Davis:
> On Monday, July 22, 2019 1:29:21 AM MDT Johannes Loher via Digitalmars-d-
> learn wrote:
>> Am 22.07.19 um 05:16 schrieb Paul Backus:
>>> On Sunday, 21 July 2019 at 18:03:33 UTC, Johannes Loher wrote:
>>>> I'd
Am 22.07.19 um 05:16 schrieb Paul Backus:
> On Sunday, 21 July 2019 at 18:03:33 UTC, Johannes Loher wrote:
>> I'd like to log stacktraces of caught exceptions in an @safe manner.
>> However, Throwable.TraceInfo.toString is not @safe (or @trusted), so
>> this is not possible. Why is it not @safe?
I'd like to log stacktraces of caught exceptions in an @safe manner.
However, Throwable.TraceInfo.toString is not @safe (or @trusted), so
this is not possible. Why is it not @safe? Can it be @trusted?
Thanks for your help!
Am 18.06.19 um 17:45 schrieb lili:
> Hi Guys:
> see this code
> ~~~
> int[] ar = [1,2,3,4,52,34,22];
> auto h = heapify(ar);
> assert(h.length() == ar.length);
> writeln("h:",h);
> assert(h.empty());
> ~~~
> dmd v2.086.0 run all assert passed. Why?
The result of heapify is
On Wednesday, 14 November 2018 at 18:05:55 UTC, Adam D. Ruppe
wrote:
On Wednesday, 14 November 2018 at 16:28:19 UTC, Radu wrote:
Looks like that there is no easy way to extract a function
parameters UDA list.
Indeed, the only way I can find is kinda crazy:
---
void foo(int f, @("test")
On Sunday, 19 May 2019 at 16:47:39 UTC, Mike Brockus wrote:
On Sunday, 19 May 2019 at 07:46:11 UTC, Johannes Loher wrote:
Am 18.05.19 um 08:20 schrieb Mike Brockus:
[...]
Hey there,
I already tried to answer your questions on reddit.
You can post links here by simply pasting the URL (the
Am 18.05.19 um 08:20 schrieb Mike Brockus:
> Hello there this is your hometown Meson build system user here just
> happen to have a
> question related to unit testing in D.
>
> So is there a way to run the unit-test in the test main as a costume
> test runner in
> "test/test.d", and run the
Am 14.04.19 um 15:22 schrieb Adam D. Ruppe:
> [...]
> Though, I'd point out the mixin code doesn't have to be too ugly.
> Consider this:
>
> void main()
> {
> enum letters = ['A', 'B', 'C'];
>
> static foreach(ch; letters)
> {
> mixin(q{
> void print}~ch~q{(int i) {
>
Am 07.03.19 um 22:50 schrieb Johannes Loher:
> [...]
As a small addition, if you always want to pass the function name as a
parameter, you can simplify this to the following:
```
enum profile_scope(string name = __FUNCTION__) = "import core.stdc.stdio
: printf; printf(\""
~ name ~ "\n\");
Am 07.03.19 um 22:21 schrieb Simon:
>
> Is there a way to achieve this while compiling with -betterC? I use a
> custom string struct right now, and your version needs TypeInfo,
> concatening using ~ needs the garbage collector. I have the feeling D is
> really not agreeing with the way I want to
Am 07.03.19 um 21:07 schrieb Simon:
> Hello,
>
> I am currently porting the frontend of my instrumenting profiler to D.
> It features a C++-makro that profiles the time between entering and
> leaving a scope (achieved with con-/destructors in C++). Since D has
> scopeguards, I hoped to achieve
Am 07.03.19 um 11:38 schrieb spir:
> Hello,
>
> First, I am not very experimented with the combination of static lang
> (alloc & typing) and OO (class-based). I'm implementing a library for
> lexical analysis (lexing), with 2 minor issues:
>
> -1- How to enforce that subclasses implement given
Am 28.01.19 um 18:29 schrieb H. S. Teoh:
> On Mon, Jan 28, 2019 at 04:59:22PM +, Victor Porton via
> Digitalmars-d-learn wrote:
>> Should I prefix all module names with `xmlboiler.` (where XML Boiler
>> is the name of my program). These packages are expected to be used
>> internally by my
On Wednesday, 9 January 2019 at 16:48:47 UTC, Russel Winder wrote:
On Tue, 2019-01-08 at 11:51 +, Nicholas Wilson via
Digitalmars-d-learn wrote:
[...]
[…]
[...]
[...]
If debugger integration is that important to you, you might want
to try out visual studio code with the corresponding
On Thursday, 27 December 2018 at 08:53:30 UTC, Johannes Loher
wrote:
On Thursday, 27 December 2018 at 04:27:03 UTC, Steven
Schveighoffer wrote:
[...]
As a side note:
During last DConf I talked to Walter and Andrei about the fact
that `typeof(SomeTemplate) == void` and they agreed that it
On Thursday, 27 December 2018 at 04:27:03 UTC, Steven
Schveighoffer wrote:
On 12/26/18 10:52 PM, Johannes Loher wrote:
Hey all,
I am a bit confused about the inferred types of function
literals which do not name their parameters (something like
`(int) {}`). The confusion arises from the fact
Hey all,
I am a bit confused about the inferred types of function literals
which do not name their parameters (something like `(int) {}`).
The confusion arises from the fact that the inferred type
sometimes is `void` (might be the case, because the function
literal is inferred to be a
On Monday, 24 December 2018 at 11:23:32 UTC, Johan Engelen wrote:
On Sunday, 23 December 2018 at 14:07:04 UTC, Johannes Loher
wrote:
[...]
The types of the 2nd and 3rd arguments of `cas` do not have to
be the same, and aren't in your case. I think what's happening
is that you are
I recently played around with atomic operations. While doing so,
I noticed a problem with the interaction of interfaces and cas.
Consider the following program:
```
import core.atomic;
import std.stdio;
interface TestInterface
{
}
class TestClass : TestInterface
{
}
void main()
{
shared
On Tuesday, 11 December 2018 at 21:09:55 UTC, Johannes Riecken
wrote:
Code:
import std.conv;
import std.stdio;
mixin template genInts()
{
enum arr = [0,1];
static foreach (t; arr) {
mixin("int i" ~ to!string(t) ~ " = 5;");
}
}
void main() {
mixin genInts!();
writeln(i0);
On Friday, 10 August 2018 at 09:33:34 UTC, Timoses wrote:
On Thursday, 9 August 2018 at 21:59:24 UTC, Johannes Loher
wrote:
I already posted this in the vibe.d forums
(https://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/58891/), but it seems, there is not a lot of activity
I already posted this in the vibe.d forums
(https://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/58891/), but it seems, there is not a lot of activity over there, so I am cross posting this here:
Is there a way to find out, if we are currently in a webinterface
request?
My
On Sunday, 29 July 2018 at 20:51:45 UTC, Alex wrote:
Do you mean something like this?
[...]
Yeah, I know that it possible to implement the template like
this, but that is not the point here. I would like to know why it
does not work the way I described it. To me it seems very
strange, that
I have a question about template argument matching in combination
with implicit conversion and alias this. Consider the following
code:
interface SomeInterface
{
}
class SomeClass : SomeInterface
{
}
struct SomeStruct
{
SomeClass someClass;
alias someClass this;
}
template
On Sunday, 22 July 2018 at 18:21:21 UTC, Venkat wrote:
On Sunday, 22 July 2018 at 08:43:23 UTC, Johannes Loher wrote:
On Sunday, 22 July 2018 at 06:21:40 UTC, Venkat wrote:
[...]
What is your usecase? If you simply want to pass a variable to
a diet template, just pass it as a template
On Sunday, 22 July 2018 at 06:21:40 UTC, Venkat wrote:
How do I make variables available to diet templates ? Java has
request.setAttribute. Vibe.d's HTTPServerRequest has params and
queryString. But by the looks of it, neither one of them is
created for the purpose of temporary storage in the
Am 16.04.2018 um 21:27 schrieb Jonathan M Davis:
> On Monday, April 16, 2018 21:10:03 Johannes Loher via Digitalmars-d-learn
> wrote:
>> Is there a way to do this? Here is a naive implementation:
>> https://run.dlang.io/is/JKvL80 .
>>
>> It does not pass `isInputRan
Is there a way to do this? Here is a naive implementation:
https://run.dlang.io/is/JKvL80 .
It does not pass `isInputRange` (I think, because the free functions are
not visible in the scope of `isInputRange`).
Trying to iterate over it with a foreach loop results in a compile error:
Error:
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
Hello
I'd like to use the vibed.web.auth framework for authentication
in my vibe.d app. If a user is not authorized to access a certain
page, he should be redirected to another page (a custom error
page for example, or the login page in my case). At the moment,
I'm using the following
On Sunday, 18 June 2017 at 14:16:03 UTC, Basile B. wrote:
On Sunday, 18 June 2017 at 09:41:01 UTC, Johannes Loher wrote:
Hey, I'm trying to work on
https://issues.dlang.org/show_bug.cgi?id=15708 so I decided it
might be interesting to find a way to (recursively) call all
postblits that belong
Hey, I'm trying to work on
https://issues.dlang.org/show_bug.cgi?id=15708 so I decided it
might be interesting to find a way to (recursively) call all
postblits that belong to certain struct or static array. This is
what I came up with so far:
import std.traits;
void callPostblits(S)(ref S
Is it possible to forward the build type to the dependencies of a dub
project? For example, if I build my project with
dub build -b unittest
is it possible to make dub build the dependencies of my project also
with the unittest build type? Even better would be a way to specify for
which
Am 05.09.2016 um 17:43 schrieb Lodovico Giaretta:
> 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
Am 02.08.2016 um 00:47 schrieb Seb:
> On Monday, 1 August 2016 at 08:53:30 UTC, Kagamin wrote:
>> A bug.
>
> ... which should be filled at Bugzilla and/or fixed. Thanks! :)
I created a pullrequest: https://github.com/dlang/phobos/pull/4720
Am 31.07.2016 um 23:46 schrieb Seb:
> On Sunday, 31 July 2016 at 21:31:52 UTC, Darren wrote:
>> Hey, all.
>>
>> I'm pretty much a programming novice, so I hope you can bear with me.
>> Does anyone know how I can change an int into a char equivalent?
>>
>> e.g.
>> int i = 5;
>> dchar value;
>>
Currently, the function Base64.decode for decoding char[] to ubyte[] has
an in contract, that should ensure that the supplied buffer is large
enough. However, it uses the function decodeLength, which does not give
the accurate decodeLength, but instead an upper bound (decodeLength can
be up to 2
Am 05.07.2016 um 17:22 schrieb Marc Schütz:
> auto concat(T : E[n], E, size_t n)(const E[][] args...) @nogc
> {
> size_t offset = 0;
> T result = void;
> foreach(arr; args) {
> result[offset .. offset+arr.length] = arr;
> offset += arr.length;
> }
>
Am 05.07.2016 um 17:12 schrieb Johannes Loher:
> Am 05.07.2016 um 16:39 schrieb Rene Zwanenburg:
>> On Tuesday, 5 July 2016 at 12:34:20 UTC, Johannes Loher wrote:
>>> I tried this, but it does not work correctly with slices.
>>
>> The length of a slice is a runtime value, which is why it can't be
Am 05.07.2016 um 16:39 schrieb Rene Zwanenburg:
> On Tuesday, 5 July 2016 at 12:34:20 UTC, Johannes Loher wrote:
>> I tried this, but it does not work correctly with slices.
>
> The length of a slice is a runtime value, which is why it can't be used
> to set static array size. What were you
Am 05.07.2016 um 00:41 schrieb Rene Zwanenburg:
> On Monday, 4 July 2016 at 19:22:52 UTC, Johannes Loher wrote:
>> This looks really nice, but I have several occurences of this, with
>> different arrays (and lengths), so i would need to create several of
>> those structs. But it looks really clean
Am 04.07.2016 um 19:24 schrieb ZombineDev:
> On Monday, 4 July 2016 at 14:31:41 UTC, Johannes Loher wrote:
>> In a project I am currently working on, I have lot's of code of the
>> following form:
>>
>> static immutable ubyte[4] sigma0 = [101, 120, 112, 97]; static
>> immutable ubyte[4] sigma1 =
Am 04.07.2016 um 20:33 schrieb Ali Çehreli:
> On 07/04/2016 07:31 AM, Johannes Loher wrote:
>> In a project I am currently working on, I have lot's of code of the
>> following form:
>>
>> static immutable ubyte[4] sigma0 = [101, 120, 112, 97];
>> static immutable ubyte[4] sigma1 = [110, 100, 32,
In a project I am currently working on, I have lot's of code of the
following form:
static immutable ubyte[4] sigma0 = [101, 120, 112, 97];
static immutable ubyte[4] sigma1 = [110, 100, 32, 51];
static immutable ubyte[4] sigma2 = [ 50, 45, 98, 121];
static immutable ubyte[4] sigma3 = [116,
On Wednesday, 17 February 2016 at 01:35:34 UTC, Johannes Loher
wrote:
Hello, I have a problem with using std.range.choose():
When using std.range.choose() on a range R, for which
hasElaborateCopyConstructor!R is true, then a postblit for the
result of std.range.choose() is created, which
Hello, I have a problem with using std.range.choose():
When using std.range.choose() on a range R, for which
hasElaborateCopyConstructor!R is true, then a postblit for the
result of std.range.choose() is created, which includes a call to
R.__postblit(). However, hasElaborateCopyConstructor!R
On Saturday, 26 September 2015 at 18:27:52 UTC, Mike McKee wrote:
On Saturday, 26 September 2015 at 10:31:13 UTC, wobbles wrote:
Have you installed dkit for sublime?
As in?
https://github.com/yazd/DKit
Looks like it's alpha and doesn't run on Mac? No homebrew
install?
I'm using this and
67 matches
Mail list logo