On Tuesday, 4 April 2023 at 16:22:29 UTC, Steven Schveighoffer
wrote:
On 4/4/23 11:34 AM, Salih Dincer wrote:
On Tuesday, 4 April 2023 at 14:20:20 UTC, Steven Schveighoffer
wrote:
parallel is a shortcut to `TaskPool.parallel`, which is
indeed a foreach-only construct, it does not return a range
On Thu, Apr 06, 2023 at 01:20:28AM +, Paul via Digitalmars-d-learn wrote:
[...]
> Yes I understand, basically, what's going on in hardware. I just
> wasn't sure if the access type was linked to the container type. It
> seems obvious now, since you've both made it clear, that it also
> depends
On Wednesday, 5 April 2023 at 23:06:54 UTC, H. S. Teoh wrote:
So your data structures and algorithms should be designed in a
way that takes advantage of linear access where possible.
T
Yes I understand, basically, what's going on in hardware. I just
wasn't sure if the access type was link
On 4/5/23 8:59 PM, Mathias LANG wrote:
immutable ubyte[4] data = [1, 2, 3, 4];
Using a static array instead of a slice will do the trick. You can leave
the `__gshared` if you want, but it is redundant on a global,
initialized `immutable` variable.
I found out the same thing. But I don't rea
immutable ubyte[4] data = [1, 2, 3, 4];
Using a static array instead of a slice will do the trick. You
can leave the `__gshared` if you want, but it is redundant on a
global, initialized `immutable` variable.
I am trying to port a small C project to D and am getting a
compilation error I don't understand.
I've simplified the situation down to the example here.
This C version compiles fine:
```c
#include
static const unsigned char data[] = {1, 2, 3, 4};
static const unsigned char * p = &data[0];
On Wed, Apr 05, 2023 at 10:34:22PM +, Paul via Digitalmars-d-learn wrote:
> On Tuesday, 4 April 2023 at 22:20:52 UTC, H. S. Teoh wrote:
>
> > Best practices for arrays in hot loops:
[...]
> > - Where possible, prefer sequential access over random access (take
> > advantage of the CPU cache h
On 4/5/23 6:34 PM, Paul wrote:
On Tuesday, 4 April 2023 at 22:20:52 UTC, H. S. Teoh wrote:
Best practices for arrays in hot loops:
- Avoid appending if possible; instead, pre-allocate outside the loop.
- Where possible, reuse existing arrays instead of discarding old ones
and allocating new o
On Tuesday, 4 April 2023 at 22:20:52 UTC, H. S. Teoh wrote:
Best practices for arrays in hot loops:
- Avoid appending if possible; instead, pre-allocate outside
the loop.
- Where possible, reuse existing arrays instead of discarding
old ones
and allocating new ones.
- Use slices where possi
On Wednesday, 5 April 2023 at 15:19:55 UTC, Cecil Ward wrote:
How much code do you thing I would need to write for this? I’m
still thinking about its feasibility. I don’t want to invent
the wheel and write a custom parser by hand, so’d rather steal
the code using sim eg called ‘a library’. :-)
How much code do you thing I would need to write for this? I’m
still thinking about its feasibility. I don’t want to invent the
wheel and write a custom parser by hand, so’d rather steal the
code using sim eg called ‘a library’. :-)
The idea would be that the user could run this to sanity-chec
On 4/4/23 3:08 AM, Chris Katko wrote:
Second, could you give me some case examples where this problem occurs?
Is the issue if I override refresh in a derived class, and the base
class will accidentally use child.refresh()?
An example of a problem:
```d
class Base
{
this() { virtualCall()
Originally vibe.d included its own main function by default. That is now
opt-in instead of opt-out. Circa 2016.
You can either add the version ``VibeDefaultMain`` or use a main
function and call ``runApplication`` yourself.
https://vibed.org/docs#first-steps
On Wednesday, 5 April 2023 at 09:19:17 UTC, Alexander Zhirov
wrote:
How to compile the example given in the book correctly? When
compiling, an error occurs that the main function is missing.
If I replace `shared static this()` with `void main()', then
everything starts. What does the compilatio
How to compile the example given in the book correctly? When
compiling, an error occurs that the main function is missing. If
I replace `shared static this()` with `void main()', then
everything starts. What does the compilation string in `dub` and
`dmd` look like correctly?
```d
import vibe.
15 matches
Mail list logo