On Friday, 24 January 2020 at 16:21:48 UTC, Jan Hönig wrote:
I am looking for a detailed explanation or showcase regarding
CTFE and string mixins.
I want to play with D a little bit regarding code generation.
I would like to have a pseudo-AST, consisting of a few classes,
to represent some calc
On Thursday, 4 July 2019 at 15:10:05 UTC, aliak wrote:
Any ideas on how to be able to do something like this?
struct S(alias _fun) {
alias Fun = _fun;
}
void algorithm(alias f, T)(T s) {
static if (&f == &T.Fun) {
// trivial return
} else {
// must perform work, then return
}
}
On Tuesday, 25 June 2019 at 05:33:57 UTC, mark wrote:
I have the following array of structs:
struct Person {
string name;
int age;
};
Person people[];
Person p;
Person p1 = {
"Bob",
12
};
Person p2 = {
"Bob",
12
};
people ~= p1;
people ~= p2;
I've read through the s
On Friday, 21 June 2019 at 19:18:02 UTC, KnightMare wrote:
On Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote:
On Friday, June 21, 2019 5:10:03 AM MDT JN via
Some folks argued a while back that iota was a terrible name
and that it should be changed, but it was decided not to
cha
On Wednesday, 19 June 2019 at 08:29:15 UTC, dangbinghoo wrote:
hi there,
Does anyone know the micro-service oriented design library or
framework in D?
thanks!
binghoo dang
What do you need from such a library?
Some suggestions:
For networking, there is vibe.d[0] which provides both
On Tuesday, 18 June 2019 at 09:17:09 UTC, Bart wrote:
I'm new to component based programming. I've read it is an
alternative to oop for speed. I don't understand how it is
possible to have an alternative to oop and still have oop like
behavior(polymorphism) nor how to do this. It seems all the
On Thursday, 13 June 2019 at 16:08:52 UTC, Mike wrote:
Hi,
my name is Mike and I'm new to D (coming from a Javabackground)
and for fun I'm trying to learn D now.
I created a simple class
class Block {
int a, b;
this() {}
}
And now I have a dynamic array of objects of this class in
On Sunday, 9 June 2019 at 19:12:32 UTC, Mike Brockus wrote:
On Wednesday, 5 June 2019 at 09:45:53 UTC, Jacob Carlborg wrote:
On 2019-06-05 03:19, Mike Brockus wrote:
Where can I find a reference for compiler flags?
Here's the reference [1]. You can also run "dmd --help" to
print out the ava
On Thursday, 6 June 2019 at 09:01:11 UTC, rnd wrote:
I am trying to check if any character in the string is > 127 by
following function:
import std.algorithm.searching;
import std.algorithm.iteration;
bool isBinary(char[] ss){
return (any!(map!(a => a > 127)(ss)));
}
However, I am getting th
On Tuesday, 21 May 2019 at 05:51:30 UTC, Jim wrote:
Hi,
consider this:
interface Base
{
void setup();
}
interface FeatureX
{
void x();
}
class Foo: Base, FeatureX
{
void setup(){};
void x(){};
}
void main()
{
Base foo = new Foo(); // This would be the result of a
factory class
Thank you both for the quick replies.
On Thursday, 16 May 2019 at 12:55:34 UTC, Kagamin wrote:
Try mach.d https://github.com/pineapplemachine/mach.d it uses
explicit range accessors for iteration.
Thank you. I've looked into it, and it appears to be quite a big
library. I've looked into mach.
On Thursday, 16 May 2019 at 12:45:03 UTC, Adam D. Ruppe wrote:
I think you have overcomplicated something quite simple.
int[4] buffer;
int bufferLength;
buffer[bufferLength++] = item_to_append;
buffer[bufferLength++] = item_to_append;
int[] slice = buffer[0 .. bufferLength];
// you can use sl
Hey all,
I want to create a small collection of items to store
intermediate results of a calculation. It runs on a background
thread, so it does not need to be the most efficient
implementation. However, I want to prevent my background thread
introducing a stop-the-world garbage collection.
I
On Saturday, 11 May 2019 at 14:27:50 UTC, Russel Winder wrote:
Hi,
Is there a way of asking which version of package XXX "dub
fetch XXX"
will actually fetch. I would like to avoid checking the
contents of
~/.dub/packages before and after.
Use the `--annotate` option:
$ dub fetch dlangide
On Monday, 1 April 2019 at 17:32:29 UTC, Andrey wrote:
Hello,
enum Key : string
{
First = "qwerty",
Last = "zaqy"
}
void main()
{
enum decl(alias values1) = q{
static foreach(value; values1)
mixin("bool " ~ value ~ " = false;");
};
enum qqq =
On Tuesday, 19 February 2019 at 05:50:04 UTC, yisooan wrote:
I wonder there is the way as I said in the title. For instance,
in C,
#define indexInvalidException Exception("The index is invalid")
/* Do something with the macro here */
if (false)
indexInvalidException;
This is allowed.
But I
On Wednesday, 13 February 2019 at 16:40:18 UTC, H. S. Teoh wrote:
On Wed, Feb 13, 2019 at 11:32:46AM +, envoid via
Digitalmars-d-learn wrote:
Unfortunately, that guarantee also excludes a lot of otherwise
useful idioms, like objects that cache data -- a const object
cannot cache data becaus
This is not D. It should be giving you a compiler error. How
are you compiling? Or did you type 'using' in the post by
mistake? Anyway, what you want is:
import style;
I indeed made a typo while typing the post (and also on various
occasions while writing the program, but compiler errors fixe
I'm trying to build a small manga reader application (because why
search the internet if you can build it yourself), using DSFML.
However, I'm getting a weird compilation error that I can't
decrypt.
In directory.d:
using style;
(...)
_text = new Text;
with(_text)
{
setFont(Style.DirectoryF
19 matches
Mail list logo