On Saturday, 5 June 2021 at 02:07:03 UTC, Adam D. Ruppe wrote:
This design was a mistake.
Of all the great things I learned and read about it, this
behavior was totally unexpected to me.
It is really difficult to code strong-typed apps this way -this
behavior is really wonderful for
Consider the following code to keep track of rectangle positions
on the screen; eg: (1,2)(3,2) ie: (left,top)(right,bottom),
providing get/set properties for one-based positions but only get
properties for zero-based positions:
```d
public struct gudtPosition {
final public void reset() {
On Saturday, 5 June 2021 at 02:38:50 UTC, someone wrote:
Furthermore, if, **at least**, there was a way to clearly state
what is short (eg 1S a la 1L) things will improve a lot
That actually doesn't matter. The compiler actually will
automatically type it to the most narrow thing it fits. The
On Saturday, 5 June 2021 at 01:34:06 UTC, Kyle Ingraham wrote:
It looks like you’re being caught by D’s arithmetic
conversions:
https://dlang.org/spec/type.html#usual-arithmetic-conversions
“If the signed type is larger than the unsigned type, the
unsigned type is converted to the signed
I think not -just in case.
On Saturday, 5 June 2021 at 01:46:45 UTC, someone wrote:
What's the point of declaring, for instance ushort's if then
nothing will treat them as ushort's and I have to manually
cast() everything to ushort() all the time ?
Yeah, it totally sucks.
D inherited a silly rule from C - the promote
On Friday, 4 June 2021 at 20:02:28 UTC, drug wrote:
a = b = c = 1;
fantastic ... спасибо :) !
On Saturday, 5 June 2021 at 00:24:01 UTC, someone wrote:
On Saturday, 5 June 2021 at 00:24:01 UTC, someone wrote:
? 0 : cast(ushort)(this.pintBottom1 - 1); }
It looks like you’re being caught by D’s arithmetic conversions:
https://dlang.org/spec/type.html#usual-arithmetic-conversions
“If
On Wednesday, 2 June 2021 at 23:23:58 UTC, bachmeier wrote:
Are you aware of my embedr project, which handles all that for
you, and does a lot of other stuff?
https://embedr.netlify.app
If you want to do it yourself, you can see the boilerplate you
need to add to call a shared library from R
On Friday, 4 June 2021 at 11:27:05 UTC, seany wrote:
In my untrained eye, this seems haphazard. One requires the use
of the new keyword
It doesn't.
T[] a;
just works. it is an array of length 0.
Consider initializing a dictionary or associative array :
T[U] AA;
For example :
double [int] AA;
This will be dynamic in size.
Now consider initializing a dynamic array :
T[] A = new T[] (0);
or
U[][] B = new U [][] (0,0);
This will also be dynamic in size.
In my
On Friday, 4 June 2021 at 11:33:32 UTC, wjoe wrote:
This is a contrived example. In reality I would use this with
custom array, hash map and other container implementations so I
could use them in @nogc territory by just switching out the
allocator.
If they are templates, just don't specify
Hi,
Consider Allocators, e.g.:
```d
struct Mallocator
{
enum usesGC = false;
/// implement alloc, free, etc. @nogc
}
struct GCAllocator
{
enum usesGC = true;
/// implement alloc, free, etc. via the GC
}
```
Now I want to have the function attributes set depending on the
On Friday, 4 June 2021 at 11:36:09 UTC, Adam D. Ruppe wrote:
On Friday, 4 June 2021 at 11:33:32 UTC, wjoe wrote:
This is a contrived example. In reality I would use this with
custom array, hash map and other container implementations so
I could use them in @nogc territory by just switching out
On Friday, 4 June 2021 at 07:26:53 UTC, data pulverizer wrote:
Thanks. Looks like I have some more reading to do. I did know
about embedr, but I saw it had dependencies and I wanted a
standalone and fully transparent D solution.
It requires an R package if you want to call D functions from
Dub is probably not much of a help :)
On Friday, 4 June 2021 at 15:33:32 UTC, Alain De Vos wrote:
Dub is probably not much of a help :)
That's right. I typically don't use Dub when I'm calling D
functions from R. It's the only way you can use a Dub package
like Mir, though, so that's why you might want it to generate a
dub.sdl
17 matches
Mail list logo