On 5/07/2015 6:53 p.m., Szabo Bogdan wrote:
Hi,
Recently while I was reviewing some swift code, a colleague left me the
impression that I am the one with the bad habits and these were learned
while coding in D. I still think that I proposed some changes to avoid
some bugs but I was told that I a
On Sun, 05 Jul 2015 06:53:34 +, Szabo Bogdan wrote:
> For both of these issues I was told that swift is not Java and if the
> situations that I described happens, you don't want to crash the user
> app, because this will make the user unhappy.
i completely agree. it's way better to keep going
On 5/07/2015 9:37 p.m., ketmar wrote:
On Sun, 05 Jul 2015 19:01:59 +1200, Rikki Cattermole wrote:
Failing gracefully. Not something most developers do.
usually that is not related. i mean that if program entered invalid
state, it may be too late to save user data. it may be even undesirable
t
On 5/07/2015 9:32 p.m., ketmar wrote:
On Sun, 05 Jul 2015 06:53:34 +, Szabo Bogdan wrote:
For both of these issues I was told that swift is not Java and if the
situations that I described happens, you don't want to crash the user
app, because this will make the user unhappy.
i completely
On Sun, 05 Jul 2015 19:01:59 +1200, Rikki Cattermole wrote:
> Failing gracefully. Not something most developers do.
usually that is not related. i mean that if program entered invalid
state, it may be too late to save user data. it may be even undesirable
to do so, as the data may be already co
On Sun, 05 Jul 2015 21:39:23 +1200, Rikki Cattermole wrote:
> Of course of course.
> Valid options in failing gracefully include resetting the data and
> informing the user. Also giving them an option to send a bug report to
> the devs.
> Point being, having it just fail on start each time is not
On Sunday, 5 July 2015 at 00:18:18 UTC, Tanel Tagaväli wrote:
On Saturday, 4 July 2015 at 16:29:44 UTC, Marc Schütz wrote:
Try std.range.transposed:
http://dlang.org/phobos/std_range.html#.transposed
Does this work with user-defined types?
I defined two structs that implement the InputRange(p
OK, so there was an old bug fixed in 2.067
(https://issues.dlang.org/show_bug.cgi?id=4421) so that now
unions apparently can't contain a struct that has invariants. It
kinda makes sense, although I don't see why the invariants can be
simply ignored, as they don't have as much importance as
des
On Sunday, 5 July 2015 at 11:35:14 UTC, Marc Schütz wrote:
Maybe it's the last condition, `hasAssignableElements`. I don't
know whether that one is really necessary...
It probably is. The last check returned false.
Since I already would have to implement "r.front = ", I'll just
use arrays.
T
On Sunday, 5 July 2015 at 12:15:32 UTC, Artem Tarasov wrote:
OK, so there was an old bug fixed in 2.067
(https://issues.dlang.org/show_bug.cgi?id=4421) so that now
unions apparently can't contain a struct that has invariants.
It kinda makes sense, although I don't see why the invariants
can be
On Sunday, 5 July 2015 at 14:44:30 UTC, John Colvin wrote:
struct A
{
ubyte[B.sizeof] mem;
@property ref B b()
{
return *cast(B*)(mem.ptr);
}
mixin std.typecons.Proxy!b;
}
Thanks, I followed your suggestion and effectively rolled out my
own union implementation. U
Consider this code:
```
import std.digest.digest;
import std.stdio;
ubyte[] hmac_sha1(const(ubyte)[] key, const(ubyte)[] message)
{
import std.digest.sha;
enum block_size = 64;
if (key.length > block_size)
key = sha1Of(key);
if (key.length < block
Am Sat, 04 Jul 2015 11:15:57 +
schrieb "Guy Gervais" :
> On Saturday, 4 July 2015 at 08:34:00 UTC, Johannes Pfau wrote:
>
> > It's kinda fascinating that GDC/MinGW seems to work for some
> > real world applications.
>
> I haven't really tried a "real world application" as of yet;
> mostly
On Friday, 3 July 2015 at 04:08:32 UTC, Paul D Anderson wrote:
On Friday, 3 July 2015 at 03:57:57 UTC, Anon wrote:
On Friday, 3 July 2015 at 02:37:00 UTC, Paul D Anderson wrote:
enum BigInt test1 = BigInt(123);
enum BigInt test2 = plusTwo(test1);
public static BigInt plusTwo(in bigint n)
S
Can I call theAllocator.dispose from a struct destructor? None
of the things pointed to by the root will be allocated directly
by GC.
Laeeth.
Hi,
I have a struct with arithmetic operations defined using opBinary
but array operations with arrays of it don't work.
struct Vector3 {
public double[3] _p;
...
Vector3 opBinary(string op)(in Vector3 rhs) const
if (op == "+"){
Vector3 result;
result._p[] = this
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
Hi,
I have a struct with arithmetic operations defined using
opBinary but array operations with arrays of it don't work.
struct Vector3 {
public double[3] _p;
...
Vector3 opBinary(string op)(in Vector3 rhs) const
if (op == "+
On Monday, 6 July 2015 at 03:02:59 UTC, Nicholas Wilson wrote:
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
Hi,
I have a struct with arithmetic operations defined using
opBinary but array operations with arrays of it don't work.
struct Vector3 {
public double[3] _p;
...
Ve
On Sunday, 5 July 2015 at 18:57:46 UTC, sigod wrote:
Why does function return incorrect data? Using `.dup` in return
expression or using `ubyte[20]` as return type fixes problem,
but why?
Because sha1Of() returns ubyte[20], this is a stack-allocated
array, a value type. If you put correct ret
19 matches
Mail list logo