On Friday, 25 November 2022 at 11:01:09 UTC, Victor Porton wrote:
Somewhere in my brain memory, it was written:
A function argument that is both input and output, may be
passed to the function either as reference or do two
assignments: on entry of the function it is assigned to the
Somewhere in my brain memory, it was written:
A function argument that is both input and output, may be passed
to the function either as reference or do two assignments: on
entry of the function it is assigned to the parameter, on exit it
is assigned back. Whether it is a reference or two
On Wednesday, 19 August 2020 at 14:06:16 UTC, Victor Porton wrote:
This declaration does compile:
enum x;
But what is it? Is it an equivalent of
enum x { }
?
What in the specification allows this looking a nonsense
enum x;
?
Oh, found: "An empty enum body (For example enum E;) signifies
This declaration does compile:
enum x;
But what is it? Is it an equivalent of
enum x { }
?
What in the specification allows this looking a nonsense
enum x;
?
///
template sychronizedMemoize(alias fun) {
void sychronizedMemoize() { }
}
void f() { }
void main()
{
synchronizedMemoize!f();
}
///
/tmp/temp_7F3C101460D0.d(9,5): Error: template instance
`synchronizedMemoize!f` template `synchronizedMemoize` is not
defined, did you mean
Why this template code does not compile?
///
module runnable;
import std.meta;
import std.typecons;
template FieldInfo(argT, string argName) {
template FieldInfo(Nullable!argT argDefault =
Nullable!argT()) {
}
}
alias processFields(T, string name) =
AliasSeq!(FieldInfo!(T,
On Tuesday, 12 March 2019 at 15:26:05 UTC, Victor Porton wrote:
template FieldInfo(T, Nullable!T default_) {
}
On Tuesday, 12 March 2019 at 09:05:36 UTC, Nicholas Wilson
wrote:
It seems to be getting confused between the two types of
Nullable, namely:
Nullable(T), and
Nullable(T, T
On Tuesday, 12 March 2019 at 16:20:11 UTC, H. S. Teoh wrote:
On Tue, Mar 12, 2019 at 03:26:05PM +, Victor Porton via
Digitalmars-d-learn wrote: [...]
On Tuesday, 12 March 2019 at 09:05:36 UTC, Nicholas Wilson
wrote:
[...]
> template FieldInfo(T) {
> template FieldInfo(Nulla
template FieldInfo(T, Nullable!T default_) {
}
On Tuesday, 12 March 2019 at 09:05:36 UTC, Nicholas Wilson wrote:
It seems to be getting confused between the two types of
Nullable, namely:
Nullable(T), and
Nullable(T, T defaultVal)
I don't understand why exactly it is getting confused. How
On Tuesday, 12 March 2019 at 05:14:21 UTC, Victor Porton wrote:
Why does this not compile?
import std.typecons;
template FieldInfo(T, Nullable!T default_) {
}
/usr/lib/ldc/x86_64-linux-gnu/include/d/std/typecons.d(2570,17): Error: `alias
T = T;` cannot alias itself, use a qualified name to
Why does this not compile?
import std.typecons;
template FieldInfo(T, Nullable!T default_) {
}
/usr/lib/ldc/x86_64-linux-gnu/include/d/std/typecons.d(2570,17):
Error: `alias T = T;` cannot alias itself, use a qualified name
to create an overload set
I try to split a compile time sequence of types and names into a
sequence consisting of two-element subsequences (each of type and
name).
That is, I want to transform:
(int, "x", float, "y", double, "z")
into
(AliasSeq!(int, "x"), AliasSeq!(float, "y"), AliasSeq!(double,
"z"))
I am
I rewrote it again:
https://github.com/vporton/struct-params-dlang/blob/f50f7e5919f90b1d06bf0cc08e3055548aad1797/source/struct_params.d
But it does not work :-( What is my error?
source/struct_params.d(43,60): Error: function expected before
`()`, not `()` of type `()`
On Wednesday, 27 February 2019 at 13:15:06 UTC, Victor Porton
wrote:
.enumerate does not work for compile-time sequences. Consider
for the sake of discussion the following nonsense (I know it
cannot be done without enumerate) code:
I want namely integer (or size_t) index!
.enumerate does not work for compile-time sequences. Consider for
the sake of discussion the following nonsense (I know it cannot
be done without enumerate) code:
import std.meta;
import std.range;
string join(Fields...)() {
enum f(size_t i) = __traits(identifier, Fields[i]);
return
After following your suggestion to rewrite it with Stride it does
not work either. I assume the error is somehow related to
allSatisfy!.
https://github.com/vporton/struct-params-dlang/blob/c1adc86672f46fd6b743903cc270dceef120a8fe/source/struct_params.d
Please help. It is important for both D
On Tuesday, 26 February 2019 at 22:51:15 UTC, Q. Schroll wrote:
On Tuesday, 26 February 2019 at 21:43:31 UTC, Victor Porton
wrote:
Compilation of unittest at the bottom of this file fails with
an error. What is my error?
...
You have the line
ProviderParams("S", ((int, "x"), (float,
Compilation of unittest at the bottom of this file fails with an
error. What is my error?
https://github.com/vporton/struct-params-dlang/blob/c32cfde60dbb03cb80a4a8aeb8185f5c86705790/source/struct_params.d
It is very important both for this useful little D project and my
bigger research
I want to create a string mixin based on a supplementary variable
(name2 below):
Let we have something like:
mixin template X(string name) {
immutable string name2 = '_' ~ name;
mixin("struct " ~ name2 ~ "{ int i; }");
}
But it would create variable name2 inside X, which should not be
Can string mixing be split into several parts?
I have a mixin like this:
mixin("struct " ~ name ~ " {\n" ~
" struct Regular {\n" ~
"// ..." ~
" }\n" ~
" struct WithDefaults {\n" ~
"// ..." ~
" }\n" ~
'}');
I
I want to create a mixin with an arbitrary number of parameters.
I tried this:
mixin template ProviderParams(Types...)(Types t) {
}
But it does not compile. What's my error?
Let f be a variadic function:
Result f(...);
How to implement variadic function g which calls f with the same
arguments as one it receives?
Result g(...) {
// ...
}
What is the right way to store in a structure a class (not an
instance) derived from a given interface(s)?
ISO C++ specifies that the C++ file must end with a newline.
Should D file end with newline, too?
On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton wrote:
Why does -I flag in DFLAGS does not work? (Ubuntu Linux)
https://github.com/dlang/dub/issues/1645
On Saturday, 9 February 2019 at 11:40:57 UTC, Victor Porton wrote:
On Saturday, 9 February 2019 at 08:35:53 UTC, JN wrote:
On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton
wrote:
Why does -I flag in DFLAGS does not work? (Ubuntu Linux)
I'm no expert on dub, but it's possible that
On Saturday, 9 February 2019 at 08:35:53 UTC, JN wrote:
On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton
wrote:
Why does -I flag in DFLAGS does not work? (Ubuntu Linux)
I'm no expert on dub, but it's possible that it's overriding
the import path anyway. One of the main points of
On Saturday, 9 February 2019 at 10:32:36 UTC, DanielG wrote:
On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton
wrote:
Why does -I flag in DFLAGS does not work? (Ubuntu Linux)
Try adding the -i flag as well ("include imported modules in
-i in DFLAGS does not help.
-I works when
On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton wrote:
$ DFLAGS="-I/usr/local/include/d/librdf -L-L/usr/local/lib" dub
build --compiler=dmd --build=unittest
...
Why does -I flag in DFLAGS does not work? (Ubuntu Linux)
This does not work too:
$
For this project:
https://github.com/vporton/xml-boiler-dlang/tree/85b5587f50617ad1b001c035c72a5780a1e69c24
$ DFLAGS="-I/usr/local/include/d/librdf -L-L/usr/local/lib" dub
build --compiler=dmd --build=unittest
Performing "unittest" build using dmd for x86_64.
xml-boiler-dlang ~master:
I want "ordered set" container (like list or vector but with the
warranty of no duplicate elements).
Which type can I use?
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 program, not as an exported API (however
there are some little chances that in the future I will make a
public API)
This way I would make data duplication (data files distributed
with the source and the same data embedding as strings into my D
sources).
Note that the source is multilingual (I am currently working on a
multi-language bindings of a C library).
On Wednesday, 16 January 2019 at 21:07:24 UTC, Victor Porton
wrote:
What is the rule for unittest which uses a file (containing
example data for testing) available only in the source
distribution, not in binary distribution?
I am writing a library.
The library has also a file main.d which is
What is the rule for unittest which uses a file (containing
example data for testing) available only in the source
distribution, not in binary distribution?
I am writing a library.
The library has also a file main.d which is compiled only in DUB
"application" configuration (I use this
In Ada2012 there are "subtypes". Subtypes can have tighter
constraints (such as type invariants) than their base types.
I have a struct X in D. Is it possible to define a type
equivalent to X except that having tighter invariants?
As I understand if I derive Y from X, then it is no more X;
36 matches
Mail list logo