On Tuesday, 15 June 2021 at 06:39:24 UTC, seany wrote:
I know that c# has parallel for [like
this](https://dotnettutorials.net/lesson/parallel-for-method-csharp/) .
[...]
PS :
I need the entire include list - while they are not necessary for
this minimal example - they are needed for the fu
I know that c# has parallel for [like
this](https://dotnettutorials.net/lesson/parallel-for-method-csharp/) .
I know that D has parallel foreach [like
this](http://ddili.org/ders/d.en/parallelism.html).
I want to do the following :
Given 4 sets , A = {a_1, a_2, ... }; B = {b_1, b_2, ... } ;
On Tuesday, 15 June 2021 at 04:24:09 UTC, surlymoor wrote:
At the moment, I feel that as long as the stashed front element
isn't too "big" (For some definition of big, I guess.), that
built-in caching should be fine. But is this acceptable? What's
the best practice for determining which range
On 15.06.21 07:17, mw wrote:
https://dlang.org/library/std/range/primitives/front.html
the 2nd decl:
dchar front(T) (
scope const(T)[] a
) pure @property @safe
if (isAutodecodableString!(T[]));
you can see `const`
but
https://dlang.org/library/std/range/primitives/pop_front.html
void popFr
On Tuesday, 15 June 2021 at 05:17:06 UTC, mw wrote:
I think there is another convention (although it's not formally
enforced, but should be) is:
-- `obj.front() [should be] const`, i.e. it shouldn't modify
`obj`, so can be called multiple times at any given state, and
produce the same result
On Tuesday, 15 June 2021 at 05:03:45 UTC, surlymoor wrote:
On Tuesday, 15 June 2021 at 04:57:45 UTC, mw wrote:
In English, `front` is a noun, `popFront` have a verb in it,
so you know who should do more work :-)
Sure, but, for example, the front method of Phobos' MapResult
is the one applying
On Tuesday, 15 June 2021 at 04:57:45 UTC, mw wrote:
In English, `front` is a noun, `popFront` have a verb in it, so
you know who should do more work :-)
Sure, but, for example, the front method of Phobos' MapResult is
the one applying the predicate to the source's front. There's a
clear separ
On Tuesday, 15 June 2021 at 04:24:09 UTC, surlymoor wrote:
All my custom range types perform all their meaningful work in
their respective popFront methods, in addition to its expected
source data iteration duties. The reason I do this is because I
swear I read in a github discussion that front
On Tuesday, 15 June 2021 at 04:43:38 UTC, jfondren wrote:
Well, consider this program:
```d
import std;
struct Noisy {
int[] source;
int pops, fronts;
bool empty() { return source.empty; }
void popFront() { writeln("popFront #", ++pops);
source.popFront; }
int front() { wri
On Tuesday, 15 June 2021 at 04:24:09 UTC, surlymoor wrote:
All my custom range types perform all their meaningful work in
their respective popFront methods, in addition to its expected
source data iteration duties. The reason I do this is because I
swear I read in a github discussion that front
All my custom range types perform all their meaningful work in
their respective popFront methods, in addition to its expected
source data iteration duties. The reason I do this is because I
swear I read in a github discussion that front is expected to be
O(1), and the only way I can think to ac
On Monday, 14 June 2021 at 18:08:27 UTC, Justin Choi wrote:
Is there any shortcut for unpacking slices like I'd want to do
in a scenario like this?
`info = readln.strip.split;`
`string a = info[0], b = info[1], c = info[2];`
This doesn't leave you with multiple local variables, but it
leaves
On Monday, 14 June 2021 at 18:08:27 UTC, Justin Choi wrote:
Is there any shortcut for unpacking slices like I'd want to do
in a scenario like this?
`info = readln.strip.split;`
`string a = info[0], b = info[1], c = info[2];`
I tried to implement PHP's "list" language construct here, which
doe
On 6/14/21 11:08 AM, Justin Choi wrote:
Is there any shortcut for unpacking slices like I'd want to do in a
scenario like this?
`info = readln.strip.split;`
`string a = info[0], b = info[1], c = info[2];`
D does not have automatic unpacking. Here is a quick, dirty, and fun
experiment:
struc
Is there any shortcut for unpacking slices like I'd want to do in
a scenario like this?
`info = readln.strip.split;`
`string a = info[0], b = info[1], c = info[2];`
On 6/14/21 11:09 AM, Jalil David Salamé Messina wrote:
I'm searching for a way to do something like this in D:
```cpp
struct MyStruct {
const size_t length;
int *const data;
MyStruct(size_t n) : length(n) {
data = new int[length];
}
}
```
This way it is mutable, but non resize
On Monday, 14 June 2021 at 15:01:01 UTC, Justin Choi wrote:
Could somebody explain or point me to documentation that helps
to explain the usage of strings in predicates?
My main question is how D infers the omitted variable
specifications given otherwise - for example:
`filter!(a => a < 3)(arr)
I'm searching for a way to do something like this in D:
```cpp
struct MyStruct {
const size_t length;
int *const data;
MyStruct(size_t n) : length(n) {
data = new int[length];
}
}
```
This way it is mutable, but non resizeable:
```cpp
MyStruct s = MyStruct(10);
s.data[0] = 42;
Could somebody explain or point me to documentation that helps to
explain the usage of strings in predicates?
My main question is how D infers the omitted variable
specifications given otherwise - for example:
`filter!(a => a < 3)(arr);`
and
`filter!"a < 3"(arr);`
produce the same result.
this used work for me, after upgrade I get this error. how to
fix it ?
import std.traits;
enum LogLevel : ubyte {
INFO = 0,
WARN,
ERROR,
FATAL,
}
extern (C) string VFORMAT(LogLevel
Hi all,
Is it possible to add a UDA onto either the function call, and
detect its present? or onto the variable that the result will go
to?
E.g.
auto int x = function() @UDA;
int function() {
if (hasUDA(call_site)) { ... }
}
or
@UDA int y = function();
int function() {
On Monday, 14 June 2021 at 07:14:27 UTC, Imperatorn wrote:
Is it on dub?
published it just now :)
On Sunday, 13 June 2021 at 00:18:56 UTC, Ali Çehreli wrote:
- If a struct contains all bitwise copyable members, instead of
(de)serializing each member individually, the whole struct can
by memcpy'ed. This may be a performance gain especially for
arrays of structs: You can memcpy the whole arr
On 13.06.21 19:49, vit wrote:
Is possible create and use scope output range allocated on stack in
@safe code?
Example:
```d
//-dip1000
struct OutputRange{
private bool valid = true;
private void* ptr;
int count = 0;
void put(Val)(auto ref scope Val val
On Sunday, 13 June 2021 at 12:46:29 UTC, Financial Wiz wrote:
What are some of the best Financial Libraries for D? I would
like to be able to aggregate as much accurate information as
possible.
Thanks.
if you want a type-safe money handling type, try
https://code.dlang.org/packages/money
On Saturday, 12 June 2021 at 21:59:13 UTC, Sinisa Susnjar wrote:
Hi, D newbie here,
The library is on par with Google Protobuf performance-wise and
does not need a pre-compiler like Protobuf does, but instead
uses the meta programming facilities of D to (de)serialise D
data types from/to bina
On Monday, 14 June 2021 at 06:47:01 UTC, Financial Wiz wrote:
Ok, what I'm talking about by Financial library is mainly
aggregating data in to D from sources that provide them such as
yahoo or google so I can do what I want with the data.
http/ftp client library, inspired by python-requests
ht
27 matches
Mail list logo