On Thursday, 28 June 2018 at 19:02:51 UTC, Ali Çehreli wrote:
On 06/28/2018 11:08 AM, Mr.Bingo wrote:
> Thanks, why not add the ability to pass through ranges and
arrays and
> add it to phobos?
Makes sense. It needs an enhancement request at
http://issues.dlang.org/, a good implementation,
On Friday, June 29, 2018 01:25:39 kdevel via Digitalmars-d-learn wrote:
> In https://dlang.org/phobos/std_exception.html#errnoEnforce this
> example is shown:
>
> ---
> auto f = errnoEnforce(fopen("data.txt"));
> auto line = readln(f);
> enforce(line.length); // expect a non-empty line
> ---
>
> I
On Thursday, 28 June 2018 at 18:43:11 UTC, Andre Pany wrote:
Hi,
I try to write a binding for the GRPC core. There is a struct
which has some ugly fields:
(https://github.com/grpc/grpc/blob/master/src/core/lib/surface/call.cc#L229)
struct grpc_call {
gpr_refcount ext_ref;
gpr_arena*
In https://dlang.org/phobos/std_exception.html#errnoEnforce this
example is shown:
---
auto f = errnoEnforce(fopen("data.txt"));
auto line = readln(f);
enforce(line.length); // expect a non-empty line
---
I added
import std.stdio;
import std.exception;
and get an error message which
On Thursday, 28 June 2018 at 19:22:38 UTC, Jonathan M Davis wrote:
On Thursday, June 28, 2018 18:10:07 kdevel via
Digitalmars-d-learn wrote:
On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis
wrote:
> [H]onestly, I don't understand why folks keep trying to put
> nullable types in
On Thursday, June 28, 2018 19:45:52 kdevel via Digitalmars-d-learn wrote:
> On Thursday, 28 June 2018 at 19:22:38 UTC, Jonathan M Davis wrote:
> > Nullable makes sense in generic code, because the code isn't
> > written specifically for them, but something like
> > Nullable!MyClass in non-generic
On Thursday, 28 June 2018 at 18:10:07 UTC, kdevel wrote:
On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis
wrote:
[H]onestly, I don't understand why folks keep trying to put
nullable types in Nullable in non-generic code.
How do you signify that a struct member of class type is
On Thursday, 28 June 2018 at 19:22:38 UTC, Jonathan M Davis wrote:
Nullable makes sense in generic code, because the code isn't
written specifically for them, but something like
Nullable!MyClass in non-generic code is pointless IMHO, because
a class reference is already nullable.
It is
On Thursday, June 28, 2018 18:10:07 kdevel via Digitalmars-d-learn wrote:
> On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis wrote:
> > [H]onestly, I don't understand why folks keep trying to put
> > nullable types in Nullable in non-generic code.
>
> How do you signify that a struct
On 06/28/2018 11:08 AM, Mr.Bingo wrote:
> Thanks, why not add the ability to pass through ranges and arrays and
> add it to phobos?
Makes sense. It needs an enhancement request at
http://issues.dlang.org/, a good implementation, and a pull request. :)
Ali
Hi,
I try to write a binding for the GRPC core. There is a struct
which has some ugly fields:
(https://github.com/grpc/grpc/blob/master/src/core/lib/surface/call.cc#L229)
struct grpc_call {
gpr_refcount ext_ref;
gpr_arena* arena;
...
grpc_core::ManualConstructor
sending_stream;
On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis wrote:
[H]onestly, I don't understand why folks keep trying to put
nullable types in Nullable in non-generic code.
How do you signify that a struct member of class type is optional?
On Thursday, 28 June 2018 at 17:00:37 UTC, Mr.Bingo wrote:
I mean, if you think about it, the memory layout of a tuple is
sequential types:
T1
T2
...
So, to popFront a tuple is just changing the starting offset.
You're right; it can definitely be done.
struct TupleRange(T...)
{
On Thursday, 28 June 2018 at 18:03:09 UTC, Ali Çehreli wrote:
On 06/28/2018 10:00 AM, Mr.Bingo wrote:
> But is this going to be optimized?
Not our job! :o)
> That is, a tuple is a range!
Similar to the array-slice distinction, tuple is a container,
needing its range.
> It is clearly easy
On 06/28/2018 10:00 AM, Mr.Bingo wrote:
> But is this going to be optimized?
Not our job! :o)
> That is, a tuple is a range!
Similar to the array-slice distinction, tuple is a container, needing
its range.
> It is clearly easy to see if a tuple is empty, to get the front,
Ok.
> and to
>
On Thursday, 28 June 2018 at 16:02:59 UTC, Alex wrote:
On Thursday, 28 June 2018 at 14:35:33 UTC, Mr.Bingo wrote:
Seems like it would unify things quite a bit.
Yeah... this is, because you can't popFront on a tuple, as the
amount of entries is fixed. You can, however, popFront on every
On Thursday, 28 June 2018 at 14:35:33 UTC, Mr.Bingo wrote:
Seems like it would unify things quite a bit.
Yeah... this is, because you can't popFront on a tuple, as the
amount of entries is fixed. You can, however, popFront on every
range.
But as Timoses wrote you can easily make a range
On Thursday, 28 June 2018 at 14:35:33 UTC, Mr.Bingo wrote:
Seems like it would unify things quite a bit.
import std.typecons, std.range, std.array, std.algorithm,
std.stdio;
void main()
{
auto t = tuple(3,4,5,6);
//auto t = [3,4,5,6];
writeln(t.map!(a =>
On Thursday, 28 June 2018 at 12:36:11 UTC, Simen Kjærås wrote:
On Thursday, 28 June 2018 at 11:46:31 UTC, vino.B wrote:
Output in Linux
Server Details**
Server Name : 1 IP: 1XX
Server Name : 2 IP: 2XX
Server Name : 3 IP: 3XX
On Thursday, 28 June 2018 at 08:01:42 UTC, vino.B wrote:
Hi All,
Request your help on how to get the source code, i wrote a
program named clean.d, complied it and by mistake deleted the
source code(clean.d), so can we get back the source using the
complied program(clean), if yes, can you
Seems like it would unify things quite a bit.
import std.typecons, std.range, std.array, std.algorithm,
std.stdio;
void main()
{
auto t = tuple(3,4,5,6);
//auto t = [3,4,5,6];
writeln(t.map!(a => 3*a).sum());
}
On 6/28/18 4:33 AM, vino.B wrote:
Hi Basile,
Thank you very much, luckily the file was backed up by the backup
scheduler, so was able to restore the same.
I was going to suggest, next time use a backup, but you already have.
Amazing how nice it is when you realize that has happened :)
On Thursday, 28 June 2018 at 13:29:58 UTC, vit wrote:
Hello,
Is it possible to create scope wrapper initialized by non
default constructor with scope parameter?
something like this:
struct Wrapper{
int* p;
static Wrapper create(scope return int* p)@safe{
Wrapper w;
Hello,
Is it possible to create scope wrapper initialized by non default
constructor with scope parameter?
something like this:
struct Wrapper{
int* p;
static Wrapper create(scope return int* p)@safe{
Wrapper w;
w.p = p;
return w;
}
/++ This doesn't
On Thursday, 28 June 2018 at 11:46:31 UTC, vino.B wrote:
Output in Linux
Server Details**
Server Name : 1 IP: 1XX
Server Name : 2 IP: 2XX
Server Name : 3 IP: 3XX
The output in
Hi All,
Request your help, i have a D code which generates a log file
with below text, in Linux, when i send this log file(text file)
as an mail attachment the text in the attachment are scrambled so
request your help on this.
Tried the below Options (no luck):
Content-Type: text/plain
On Thursday, 28 June 2018 at 09:47:07 UTC, Jonathan M Davis wrote:
On Thursday, June 28, 2018 09:26:10 Flaze07 via
Digitalmars-d-learn wrote:
On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote:
> [...]
what about during runtime ?
Ranges in general have an arbitrary length,
On Thursday, 28 June 2018 at 09:42:54 UTC, Flaze07 wrote:
On Thursday, 28 June 2018 at 09:38:36 UTC, Stefan Koch wrote:
On Thursday, 28 June 2018 at 09:26:10 UTC, Flaze07 wrote:
On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote:
On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07
On Thursday, June 28, 2018 09:26:10 Flaze07 via Digitalmars-d-learn wrote:
> On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote:
> > On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07 wrote:
> >> is there some sort of ways to turn range into tuple ? ( an
> >> array preferably )
> >> e.g
On Thursday, 28 June 2018 at 09:38:36 UTC, Stefan Koch wrote:
On Thursday, 28 June 2018 at 09:26:10 UTC, Flaze07 wrote:
On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote:
On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07 wrote:
is there some sort of ways to turn range into tuple ?
On Thursday, 28 June 2018 at 09:26:10 UTC, Flaze07 wrote:
On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote:
On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07 wrote:
is there some sort of ways to turn range into tuple ? ( an
array preferably )
e.g
uint[] arr = [ 10, 20, 30 ];
On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote:
On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07 wrote:
is there some sort of ways to turn range into tuple ? ( an
array preferably )
e.g
uint[] arr = [ 10, 20, 30 ];
auto tup = rangeToTup( arr );
assert( tup[ 0 ] == 10 );
On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07 wrote:
is there some sort of ways to turn range into tuple ? ( an
array preferably )
e.g
uint[] arr = [ 10, 20, 30 ];
auto tup = rangeToTup( arr );
assert( tup[ 0 ] == 10 );
assert( tup[ 1 ] == 20 );
assert( tup[ 2 ] == 30 );
I think you are
On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07 wrote:
is there some sort of ways to turn range into tuple ? ( an
array preferably )
e.g
uint[] arr = [ 10, 20, 30 ];
auto tup = rangeToTup( arr );
assert( tup[ 0 ] == 10 );
assert( tup[ 1 ] == 20 );
assert( tup[ 2 ] == 30 );
is there some sort of ways to turn range into tuple ? ( an array
preferably )
e.g
uint[] arr = [ 10, 20, 30 ];
auto tup = rangeToTup( arr );
assert( tup[ 0 ] == 10 );
assert( tup[ 1 ] == 20 );
assert( tup[ 2 ] == 30 );
On Thursday, 28 June 2018 at 08:21:20 UTC, Basile B. wrote:
On Thursday, 28 June 2018 at 08:01:42 UTC, vino.B wrote:
Hi All,
Request your help on how to get the source code, i wrote a
program named clean.d, complied it and by mistake deleted the
source code(clean.d), so can we get back the
On Thursday, 28 June 2018 at 08:01:42 UTC, vino.B wrote:
Hi All,
Request your help on how to get the source code, i wrote a
program named clean.d, complied it and by mistake deleted the
source code(clean.d), so can we get back the source using the
complied program(clean), if yes, can you
Hi All,
Request your help on how to get the source code, i wrote a
program named clean.d, complied it and by mistake deleted the
source code(clean.d), so can we get back the source using the
complied program(clean), if yes, can you any one help on the same.
From,
Vino.B
38 matches
Mail list logo