I am look a method like Fiber.yieldAndThrow, but also call all
scopeguard.
I am hack Fiber into struct with no throw, try to use it on
network project with high performance.
I use scopeguard to auto release memory or resource, but when I
call Fiber .yieldAndThrow the scopeguard chain will
On Wednesday, 20 December 2017 at 18:43:21 UTC, Ali Çehreli wrote:
Thanks to Mengü for linking to that section. I have to make
corrections below.
Ali
Thanks for explain, Ali And Mengu.
What I am try to do is implement a unique data type. (the
ownership auto moved into new handle)
conside
On Friday, 29 December 2017 at 16:11:20 UTC, Dukc wrote:
I was building one example of DLangUi (dub build
--build-mode=allAtOnce --build=debuglinker) and it did compile
but the linker started to complain. I did notice it seemed to
be related to the standard library, so I updated it and
DRuntim
On Friday, December 29, 2017 22:32:01 Tony via Digitalmars-d-learn wrote:
> In DLang Tour:Arrays
> https://tour.dlang.org/tour/en/basics/arrays
>
> there is:
> ---
> int size = 8; // run-time variable
> int[] arr = new int[size];
>
> The type of arr is in
On Friday, 29 December 2017 at 22:32:01 UTC, Tony wrote:
In DLang Tour:Arrays
https://tour.dlang.org/tour/en/basics/arrays
there is:
---
int size = 8; // run-time variable
int[] arr = new int[size];
The type of arr is int[], which is a slice.
On Friday, 29 December 2017 at 22:32:01 UTC, Tony wrote:
Based on those two web pages it appears that the name for a
dynamic array in D is "slice". That is, anytime
you have a dynamic array (even a null reference version) it is
called a slice. Is that correct?
Not exactly, but basically. rea
In DLang Tour:Arrays
https://tour.dlang.org/tour/en/basics/arrays
there is:
---
int size = 8; // run-time variable
int[] arr = new int[size];
The type of arr is int[], which is a slice.
---
In "D Slices"
htt
On Friday, 29 December 2017 at 21:43:25 UTC, Chris Paulson-Ellis
wrote:
On Friday, 29 December 2017 at 21:34:27 UTC, vit wrote:
use:
n = Nullable!Object.init; //doesn't call destroy
instead of:
n.nullify();
Only nullify() can make isNull return true again. I need that
semantic.
On Friday, 29 December 2017 at 21:43:25 UTC, Chris Paulson-Ellis
wrote:
Only nullify() can make isNull return true again. I need that
semantic.
Quick idea without much afterthought: instead of Nullable, use
pointer to o?
On Friday, 29 December 2017 at 21:34:27 UTC, vit wrote:
use:
n = Nullable!Object.init; //doesn't call destroy
instead of:
n.nullify();
Only nullify() can make isNull return true again. I need that
semantic.
On Friday, 29 December 2017 at 20:52:51 UTC, Chris Paulson-Ellis
wrote:
I've been bitten by trying to use Nullable(T) on class types.
Minimal example...
[...]
use:
n = Nullable!Object.init; //doesn't call destroy
instead of:
n.nullify();
I've been bitten by trying to use Nullable(T) on class types.
Minimal example...
import std.typecons : Nullable;
void main()
{
auto o = new Object();
o.toString();
Nullable!Object n = o;
o.toString();
n.nullify();
o.toString(); // SegV!
}
The SEGV is caused by nullify
On Friday, 29 December 2017 at 19:38:44 UTC, aliak wrote:
So when I'm dealing with ranges, there're a number of times
where I get the front of the returned result of a set of
operations, but of course there is no front so you get an
runtime access error.
This could be what you want:
auto mak
On Friday, December 29, 2017 19:38:44 aliak via Digitalmars-d-learn wrote:
> Hi,
>
> So when I'm dealing with ranges, there're a number of times where
> I get the front of the returned result of a set of operations,
> but of course there is no front so you get an runtime access
> error.
You don't
On Friday, 29 December 2017 at 19:38:44 UTC, aliak wrote:
Hi,
So when I'm dealing with ranges, there're a number of times
where I get the front of the returned result of a set of
operations, but of course there is no front so you get an
runtime access error.
[...]
Do you know about the pr
On Friday, 29 December 2017 at 13:08:38 UTC, rikki cattermole
wrote:
On 29/12/2017 12:59 PM, rjframe wrote:
On Fri, 29 Dec 2017 12:39:25 +, Nicholas Wilson wrote:
[...]
I've actually thought about doing this to get rid of a bunch
of if
qualifiers in my function declarations. `static int
Hi,
So when I'm dealing with ranges, there're a number of times where
I get the front of the returned result of a set of operations,
but of course there is no front so you get an runtime access
error.
In some other languages the concept of "front" or "first" returns
a safe referece, or opti
On Fri, Dec 29, 2017 at 10:35:53AM +, Andrei via Digitalmars-d-learn wrote:
> On Thursday, 28 December 2017 at 18:45:39 UTC, H. S. Teoh wrote:
> > On Thu, Dec 28, 2017 at 05:56:32PM +, Andrei via Digitalmars-d-learn
> > wrote:
> > ...
> > The string / wstring / dstring types in D are intend
On Tuesday, 26 December 2017 at 16:12:07 UTC, Seb wrote:
On Tuesday, 26 December 2017 at 15:56:19 UTC, Vino wrote:
Hi All,
What is the difference between std.algorithm.reduce and
mir.ndslice.algorithm.reduce.
From,
Vino.B
Mir's reduce works on Slices whereas Phobos's reduce works on
Arr
I was building one example of DLangUi (dub build
--build-mode=allAtOnce --build=debuglinker) and it did compile
but the linker started to complain. I did notice it seemed to be
related to the standard library, so I updated it and DRuntime to
the lastest master, rebuilt them and replaced phobos.
I would like to know if there is any repository that uses QT to
create QT creator-style programs with buttons and combobox cute?
Thank You for fast help! I just reply late because I wanted to
try out many things.
With Benjamin's list it was indeed easy to set up the environment.
I also installed LDC and it worked without problems too.
Made some tests about sse vectorization and it turned out that
I'm in love with LDC now
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote:
In C#, structs can inherit from and implement interfaces.
Is that simply because it hasn't been implemented or suggested
yet for D, or was there a deliberate design decision?
Thanks for your insight,
Mike
I think it's deliber
On Friday, 29 December 2017 at 13:08:38 UTC, rikki cattermole
wrote:
On 29/12/2017 12:59 PM, rjframe wrote:
On Fri, 29 Dec 2017 12:39:25 +, Nicholas Wilson wrote:
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin
wrote:
The problem is that interfaces are a runtime thing (e.g. yo
On 29/12/2017 12:59 PM, rjframe wrote:
On Fri, 29 Dec 2017 12:39:25 +, Nicholas Wilson wrote:
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote:
The problem is that interfaces are a runtime thing (e.g. you can cast a
class to an interface)
structs implement compile time inte
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote:
In C#, structs can inherit from and implement interfaces.
using System;
interface IPrint
{
void Print();
}
struct MyStruct : IPrint
{
public void Print()
{
Console.WriteLine(ToString());
}
}
public
On Fri, 29 Dec 2017 12:39:25 +, Nicholas Wilson wrote:
> On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote:
>
> The problem is that interfaces are a runtime thing (e.g. you can cast a
> class to an interface)
> structs implement compile time interfaces via template duck typing
>
On Friday, December 29, 2017 12:18:57 Mike Franklin via Digitalmars-d-learn
wrote:
> On Friday, 29 December 2017 at 12:11:46 UTC, rikki cattermole
>
> wrote:
> > Structs are structs, classes are classes.
>
> I'm talking about interfaces, which are neither structs nor
> classes.
Interfaces are rel
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote:
Is that simply because it hasn't been implemented or suggested
yet for D, or was there a deliberate design decision?
It's a design decision.
Look carefully at structs vs. classes here:
https://dlang.org/spec/struct.html
There is
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote:
In C#, structs can inherit from and implement interfaces.
using System;
interface IPrint
{
void Print();
}
struct MyStruct : IPrint
{
public void Print()
{
Console.WriteLine(ToString());
}
}
public
On Friday, 29 December 2017 at 12:13:02 UTC, Mike Franklin wrote:
On Friday, 29 December 2017 at 12:06:12 UTC, tipdbmp wrote:
It seems to me that some of the language reference/spec pages
that are somewhat long,
could provide a Toc (Table of contents) which should help
users see an overview of
On Friday, 29 December 2017 at 12:11:46 UTC, rikki cattermole
wrote:
Structs are structs, classes are classes.
I'm talking about interfaces, which are neither structs nor
classes.
C++ had the mixed model similar to what you suggested, we got
it right and kept it nice and separate. This was
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote:
In C#, structs can inherit from and implement interfaces.
using System;
interface IPrint
{
void Print();
}
struct MyStruct : IPrint
{
public void Print()
{
Console.WriteLine(ToString());
}
}
public
Structs are structs, classes are classes.
C++ had the mixed model similar to what you suggested, we got it right
and kept it nice and separate. This was done on purpose.
On Friday, 29 December 2017 at 12:06:12 UTC, tipdbmp wrote:
It seems to me that some of the language reference/spec pages
that are somewhat long,
could provide a Toc (Table of contents) which should help users
see an overview of what's
there and improve the searchability and the navigation of th
It seems to me that some of the language reference/spec pages
that are somewhat long,
could provide a Toc (Table of contents) which should help users
see an overview of what's
there and improve the searchability and the navigation of the
content.
The 'Functions' page has a Toc already.
In C#, structs can inherit from and implement interfaces.
using System;
interface IPrint
{
void Print();
}
struct MyStruct : IPrint
{
public void Print()
{
Console.WriteLine(ToString());
}
}
public class Program
{
public static void Main()
{
MyStruc
On Friday, 29 December 2017 at 10:35:53 UTC, Andrei wrote:
Though it is not suitable for GUI type of a Windows application.
AFAIK, Windows GUI have no ANSI/OEM problem.
You can use Unicode.
For Windows ANSI/OEM problem you can use also
https://dlang.org/phobos/std_windows_charset.html
On Thursday, 28 December 2017 at 18:45:39 UTC, H. S. Teoh wrote:
On Thu, Dec 28, 2017 at 05:56:32PM +, Andrei via
Digitalmars-d-learn wrote:
...
The string / wstring / dstring types in D are intended to be
Unicode strings. If you need to use other encodings, you
really should be using uby
On Friday, 29 December 2017 at 10:23:24 UTC, codephantom wrote:
On Friday, 29 December 2017 at 09:38:50 UTC, Vino wrote:
Let me re-frame the question with an example, as the Dsafe
the below line of code is considered as unsafe(Pointer
arithmetic),
...
ini[10] a;
int* p = &a[0];
for (size
On Friday, 29 December 2017 at 09:38:50 UTC, Vino wrote:
Let me re-frame the question with an example, as the Dsafe
the below line of code is considered as unsafe(Pointer
arithmetic), so let imagine that we have several similar line
of code, how do we find such unsafe line, does the compile
On Friday, 29 December 2017 at 09:19:13 UTC, codephantom wrote:
On Friday, 29 December 2017 at 08:21:10 UTC, Vino wrote:
Hi All,
Is there a way to find or test which line of a give code is
not safe(possible memory corruption).
From,
Vino.B
That question needs to be refined ;-)
Hi,
Le
On Friday, 29 December 2017 at 08:21:10 UTC, Vino wrote:
Hi All,
Is there a way to find or test which line of a give code is not
safe(possible memory corruption).
From,
Vino.B
That question needs to be refined ;-)
Hi All,
Is there a way to find or test which line of a give code is not
safe(possible memory corruption).
From,
Vino.B
44 matches
Mail list logo