On Wednesday, 3 August 2022 at 03:36:55 UTC, Domain wrote:
I want to find out all public functions in all modules in a
package. Can I do that at compile time?
I think it's not possible.
On Friday, 6 November 2020 at 10:51:20 UTC, Andrey Zherikov wrote:
struct Result(T)
{
struct Success
{
static if(!is(T == void))
{
T value;
}
}
struct Failure
{
string error;
}
Algebraic!(Success, Failure) result;
this
On Sunday, 22 December 2019 at 17:20:51 UTC, BoQsc wrote:
There are lots of editors/IDE's that support D language:
https://wiki.dlang.org/Editors
What kind of editor/IDE are you using and which one do you like
the most?
IntelliJ IDEA CE with this extension:
https://intellij-dlanguage.github
On Thursday, 15 August 2019 at 19:51:30 UTC, Jonathan M Davis
wrote:
Not being able to implicitly convert to const is a bit odd, but
arguably, nothing should ever be called on a shared AA anyway.
If an operation isn't thread-safe, then it shouldn't work with
shared. To use a shared object safel
Code:
import std;
shared(string[string]) dict;
void main()
{
dict.keys;
}
Error:
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(3417):
Error: cannot implicitly convert expression aa of type
shared(string[string]) to const(shared(string)[string])
onlineapp.d(7): Error: templat
On Saturday, 6 October 2018 at 13:17:22 UTC, bauss wrote:
Let's say you have a range with struct, but some of the struct
are duplicates of each other.
Is there a standard function in Phobos to remove duplicates?
My first thought was "uniq", but it can't really do it like
that, but it doesn't
This code:
import std.stdio;
class X1 {}
class X2 : X1
{
void run() @safe
{
writeln("DONE");
}
}
void main() @safe
{
X1 x1 = new X1;
X2 x2 = cast(X2) x1;
x2.run();
}
is obviously wrong gets killed by OS
On Tuesday, 10 July 2018 at 13:24:43 UTC, WebFreak001 wrote:
It's supposed to make webservers safe and not crash because of
segmentation faults, etc.
If you still want to write code like you are used to and don't
care about that in your webserver, just mark everything in the
implementation @t
Hello,
I've recently started building a little REST application on
vibe.d. I decided to use the "database" library, as I need to
communicate with the PostgreSQL instance.
During the compilation I see the deprecation warning:
"Non-@safe methods are deprecated in REST interfaces"
So two questi
Given this code:
abstract class A
{
package @property void x(int x);
package @property int x();
}
class B : A
{
package @property override void x(int x) {}
package @property override int x() { return 0; }
}
void main() {}
I get the following message:
onlineapp.d(9): Error: fun
For some reason this is true:
slide!(Yes.withPartial)([1, 2, 3, 4, 5], 3).array == [[1, 2, 3],
[2, 3, 4], [3, 4, 5]]
Shouldn't it rather return [[1], [1, 2], [1, 2, 3], [2, 3, 4],
[3, 4, 5], [4, 5], [5]], or at least [[1, 2, 3], [2, 3, 4], [3,
4, 5], [4, 5], [5]]?
I can see no difference o
Hello,
The code below:
import std.traits;
enum Attr;
class MyClass
{
private @Attr int a;
static assert(getSymbolsByUDA!(typeof(this), MyClass).length
== 1);
}
does not compile as static assertion fails. Making the filed a
public makes it compile p
Code:
===
import std.conv;
import std.regex;
struct A
{
int field1;
int field2;
this(int field1, int field2)
{
if(field1 > field2)
throw new Exception("This is illegal!");
}
Hello, I have this code:
immutable class Base
{
this() {}
}
immutable class Derived : Base {}
void main()
{
new immutable Derived();
}
I'd like class Derived to automatically inherit the default
constructor from Base. However, this is not the case:
main.d(6): Error: class ma
14 matches
Mail list logo