On Saturday, 10 March 2018 at 02:25:38 UTC, Richard wrote:
Hi,
I've been trying to see if I can get an mbed project to work
with Dlang
basically compiling D code for use on a Cortex-M Proccessor
You might be interested in the following, if you're not already
aware:
*
Eh, you can simplify it a lot by just writing your own C main
(legal with or without betterC btw)
---
import core.stdc.stdio;
extern(C)
int main(int argc, char** argv) {
printf("hello world, %s\n", argc > 1 ? argv[1] : "user");
return 0;
}
---
that should work with any
Hi,
I've been trying to see if I can get an mbed project to work with
Dlang
basically compiling D code for use on a Cortex-M Proccessor
So far I've been using the latest release of LDC with the
-BetterC Flag
From what I can gather, normally without -BetterC it works like
this:
* main() -
On Friday, 9 March 2018 at 14:46:04 UTC, Simen Kjærås wrote:
This is the best I've come up with in the current language:
struct S {
int n;
mixin property!("field", "get => this.n", "set => this.n =
set");
}
Not bad. Not good, but not bad either.
Sadly, there are issues:
1) Wrong
On Fri, Mar 09, 2018 at 09:30:53PM +, Cecil Ward via Digitalmars-d-learn
wrote:
> Can we return a literal struct value straight from a return statement?
>
> ie something like
> mystruct_t myfunc()
> { // ... blah
> return { field1: val1, field2: val2; };
> }
> assuming that the
On Friday, 9 March 2018 at 19:24:03 UTC, Nordlöw wrote:
I'm looking for a function (that probably should be placed in
std.meta) named something like `areEqual` that checks whether
all it's arguments are equal or not.
Is there such as function already in Phobos?
My usage is
static if
On Sunday, 4 March 2018 at 16:46:56 UTC, Marc wrote:
then copy it to sources folder?
...
Also, symlinks are power tool for organizing your files without
copying.
Can we return a literal struct value straight from a return
statement ?
ie something like
mystruct_t myfunc()
{ // ... blah
return { field1: val1, field2: val2; };
}
assuming that the return type is defined suitably, and the struct
is just a C struct, plain-old-data (ie not a
On Friday, March 09, 2018 19:33:26 WhatMeWorry via Digitalmars-d-learn
wrote:
> On Friday, 9 March 2018 at 10:42:47 UTC, Kagamin wrote:
> > To make a struct noncopyable, add @disable this(this); to it,
> > then compiler will give an error on an attempt to copy it.
>
> I tried the @disable
On Friday, 9 March 2018 at 10:42:47 UTC, Kagamin wrote:
To make a struct noncopyable, add @disable this(this); to it,
then compiler will give an error on an attempt to copy it.
I tried the @disable this(this); but now it doesn't even compile?
Error: template std.concurrency.spawn cannot
On Friday, 9 March 2018 at 19:24:03 UTC, Nordlöw wrote:
I'm looking for a function (that probably should be placed in
std.meta) named something like `areEqual` that checks whether
all it's arguments are equal or not.
Is there such as function already in Phobos?
My usage is
static if
I'm looking for a function (that probably should be placed in
std.meta) named something like `areEqual` that checks whether all
it's arguments are equal or not.
Is there such as function already in Phobos?
My usage is
static if (allEqual!(staticMap!(ElementEncodingType, Rs)))
{
//
On Friday, 9 March 2018 at 17:47:46 UTC, Timoses wrote:
To retrieve the member names the following (and filtering for
only the functions) does the job:
alias members = aliasSeqOf!([__traits(allMembers, S)]);
This can be simplified to
alias members = Alias!(__traits(allMembers, S));
Hi,
I feel like starting to dig deeper into D. And I got lost : D.
I would like to reflect on defined bitfields:
struct S
{
mixin!(bitfields!(
, , ,
...
));
}
which produces something like this in the back scenes:
struct S
{
uint storage;
On Friday, March 09, 2018 14:12:10 Basile B. via Digitalmars-d-learn wrote:
> On Friday, 9 March 2018 at 13:47:34 UTC, Basile B. wrote:
> > I would need this to work:
> >
> > ```
> > struct Foo
> > {
> >
> > TypeInfo typeCache;
> >
> > TypeInfo getTypeCache()
> > {
> >
> >
On Friday, 9 March 2018 at 14:41:47 UTC, J-S Caux wrote:
Going further, I'm really wondering what the plan is as far as
Complex is concerned. Right now it just feels neglected
(half-done/aborted transition from creal etc to Complex, lots
of missing basic functions etc), and is one major
On Friday, 9 March 2018 at 14:41:47 UTC, J-S Caux wrote:
Is this a case for a bug report? Seems pretty bizarre to do
that, like an oversight/neglect.
Yes if there's not one there for it already.
OK thanks. I looked at libmir, and saw many good things there.
I was wondering: is it still
On Friday, 9 March 2018 at 01:22:15 UTC, Mike Franklin wrote:
* binary assignment operators (e.g. +=)
* unary assignment operators (e.g. ++)
* @safe, @nogc, and -betterC compatible
* at least as good code generation as that proposed in the DIP
when optimizations are enabled.
* And should be
On Friday, 9 March 2018 at 13:56:33 UTC, Nicholas Wilson wrote:
- I would expect the D `Complex!double` case to work faster
than the `real` one. Why is it the other way around? [I can
accept (and use) D with Complex!real running 1/3 the speed of
C++ (but with increased accuracy), but I'd also
On Friday, 9 March 2018 at 13:47:34 UTC, Basile B. wrote:
I would need this to work:
```
struct Foo
{
TypeInfo typeCache;
TypeInfo getTypeCache()
{
alias NotThePoint = ubyte;
if (typeCache is null)
typeCache = typeid(NotThePoint);
return
On Friday, 9 March 2018 at 13:54:07 UTC, Basile B. wrote:
On Friday, 9 March 2018 at 13:47:34 UTC, Basile B. wrote:
- `type()` really has to be const because it's used in an
opEquals that's used by an AA (key is const so opEquals has to
as well)
And the most annoying is that the non reduced
On Friday, 9 March 2018 at 12:34:40 UTC, J-S Caux wrote:
Please bear with me, this is a long question!
To explain, I'm a scientist considering switching from C++ to
D, but before I do, I need to ensure that I can:
- achieve execution speeds comparable to C++ (for the same
accuracy; I can
On Friday, 9 March 2018 at 13:47:34 UTC, Basile B. wrote:
- `type()` really has to be const because it's used in an
opEquals that's used by an AA (key is const so opEquals has to
as well)
And the most annoying is that the non reduced Foo has a custom
toHash that hashes a payload so the cast
I got this error msg today (see below):
DUB version 1.8.0, built on Mar 3 2018
vibe.d version 0.8.3
dmd 2.078.3 (the same with 2.079.0 and 2.077.0)
.dub/build/server64_72_debug-debug-linux.posix-x86_64-dmd_2079-CAC4A12AC8FE4B4625A9511E4EFEB8F6/anscealai.o:
In function
I would need this to work:
```
struct Foo
{
TypeInfo typeCache;
TypeInfo getTypeCache()
{
alias NotThePoint = ubyte;
if (typeCache is null)
typeCache = typeid(NotThePoint);
return typeCache;
}
TypeInfo type() const
{
alias
Please bear with me, this is a long question!
To explain, I'm a scientist considering switching from C++ to D,
but before I do, I need to ensure that I can:
- achieve execution speeds comparable to C++ (for the same
accuracy; I can accept a slight slowdown, call it 30%, to get a
few more
To make a struct noncopyable, add @disable this(this); to it,
then compiler will give an error on an attempt to copy it.
spawn doesn't infer `ref` storage class and copies eventBuffer by
value.
28 matches
Mail list logo