On Sunday, 5 June 2016 at 00:05:15 UTC, poliklosio wrote:
I need to throw some exceptions in my code, but I don't want to
ever care about the garbage collector.
I have seen some solutions to throwing exceptions in nogc code,
but only toy examples, like
https://p0nce.github.io/d-idioms/#Throwi
On Saturday, 4 June 2016 at 21:52:31 UTC, AbstractGuy wrote:
On Saturday, 4 June 2016 at 17:16:45 UTC, pineapple wrote:
Won't this pattern fail if items is a type implementing
opApply and/or opApplyReverse?
opApply/ApplyReverse predates the detection of the input/bidir
range primitives. It's
On 06/04/2016 05:05 PM, poliklosio wrote:
I need to throw some exceptions in my code, but I don't want to ever
care about the garbage collector.
I have seen some solutions to throwing exceptions in nogc code, but only
toy examples, like
https://p0nce.github.io/d-idioms/#Throwing-despite-@nogc
T
I need to throw some exceptions in my code, but I don't want to
ever care about the garbage collector.
I have seen some solutions to throwing exceptions in nogc code,
but only toy examples, like
https://p0nce.github.io/d-idioms/#Throwing-despite-@nogc
The solution sort of works, but doesn't s
On Saturday, 4 June 2016 at 18:58:51 UTC, Brad Anderson wrote:
On Saturday, 4 June 2016 at 18:55:09 UTC, Brad Anderson wrote:
On Saturday, 4 June 2016 at 18:20:26 UTC, Alex wrote:
[...]
Check out enumerate() in std.range;
Ah! thanks!
int counter = 5;
foreach(i, el; enumerate(r
On Saturday, 4 June 2016 at 17:16:45 UTC, pineapple wrote:
Won't this pattern fail if items is a type implementing opApply
and/or opApplyReverse?
opApply/ApplyReverse predates the detection of the input/bidir
range primitives. It's specified in the language. If an aggregate
implements both th
On Saturday, 4 June 2016 at 18:55:09 UTC, Brad Anderson wrote:
On Saturday, 4 June 2016 at 18:20:26 UTC, Alex wrote:
[...]
Check out enumerate() in std.range;
int counter = 5;
foreach(i, el; enumerate(randomCover(iota(counter
writeln("index: ", i, " element: ", el);
On Saturday, 4 June 2016 at 18:20:26 UTC, Alex wrote:
Hi all!
Could you help me clearify why a iota can't be accessed with
two arguments in a foreach loop?
following tests show my problem:
What does work:
int[] ku = [0, 1, 2, 3, 4];
foreach(i, el; ku)
writeln("index: ", i, " ele
PPS: The error shown is in line with the iota inside foreach:
Error: cannot infer argument types, expected 1 argument, not 2
Hi all!
Could you help me clearify why a iota can't be accessed with two
arguments in a foreach loop?
following tests show my problem:
What does work:
int[] ku = [0, 1, 2, 3, 4];
foreach(i, el; ku)
writeln("index: ", i, " element: ", el);
What does not work:
counter = 5;
On 06/04/2016 07:32 AM, pineapple wrote:
> It would be fantastic if I could write this -
>
> static if(forward){
> foreach(item; items) dostuff();
> }else{
> foreach_reverse(item; items) dostuff();
> }
>
> as something like this -
>
> foreach!forward(item; items) do
On Saturday, 4 June 2016 at 15:43:01 UTC, Mihail K wrote:
As far as I recall, foreach_reverse is deprecated in favour of
range operations.
ie.
import std.algorithm, std.range;
static if(forward)
{
items.each!(item => doStuff());
}
else
{
items.retro.each!(item => doStuf
On 06/04/2016 05:02 PM, chmike wrote:
Is it possible to instantiate immutable objects by using emplace
Yes. I'm not sure, but the memory may have to be untyped for the emplace
call to avoid mutating immutable data. I.e., call emplace with void[],
not with a pointer whose target is already typ
Hi,
I try to create objects by using the factory method in a static
library scenario.
file base.d
---
module base;
class Base { }
Object createObject(string name)
{
return Object.factory(name);
}
---
file child.d
---
On Saturday, 4 June 2016 at 15:27:53 UTC, xky wrote:
Hi! First, thank you to those who always answers.
I got some DataURL string(it's png image) like this...
===
On Saturday, 4 June 2016 at 14:32:23 UTC, pineapple wrote:
It would be fantastic if I could write this -
static if(forward){
foreach(item; items) dostuff();
}else{
foreach_reverse(item; items) dostuff();
}
as something like this -
foreach!forward(item; items) do
On Saturday, 4 June 2016 at 02:10:57 UTC, Adam D. Ruppe wrote:
On Saturday, 4 June 2016 at 01:04:08 UTC, Pie? wrote:
alias this pImage;
It is actually `alias pImage this;`
That should do what you want right here. Then you can add your
own methods or wrap/disable the image ones one by one
Hi! First, thank you to those who always answers.
I got some DataURL string(it's png image) like this...
So, i used std.base64 l
On Saturday, 4 June 2016 at 02:22:37 UTC, Adam D. Ruppe wrote:
On Friday, 3 June 2016 at 20:06:50 UTC, Pie? wrote:
Thanks! It is working. A few issues with my images being
clipped and not throwing when file doesn't exist...
That's weird.. I don't know what's going on there.
BTW have you seen
On Friday, 3 June 2016 at 21:04:41 UTC, ag0aep6g wrote:
Thank you ag0aep6g, especially for the missing shared in my
static this !
Since I'm implementing a (hopefully useful) library, it would be
unpleasant for users to have to cast away shared to print the
info.
It works with immutable at t
On Saturday, 4 June 2016 at 08:27:53 UTC, Russel Winder wrote:
On Sun, 2016-05-29 at 14:01 +0200, Jordi Sayol via
Digitalmars-d-learn wrote:
[…]
https://github.com/nomad-software/tkd
I am not a great fan of tk even in Python. It is true that Tk
is everywhere and so meets the portability r
It would be fantastic if I could write this -
static if(forward){
foreach(item; items) dostuff();
}else{
foreach_reverse(item; items) dostuff();
}
as something like this -
foreach!forward(item; items) dostuff();
Is there any way to accomplish this?
Hello, all I recently need to get the integrity level of a
process but i do not know how to do.
On Tuesday, 27 August 2013 at 19:50:03 UTC, luminousone wrote:
I was under the impression that the atomic spinlock has a lower
latency for any waiters, then a mutex when its unlocked?
I am using this for a temporary or depending on performance, a
perminate replacement for std.concurrency sen
On Sun, 2016-05-29 at 14:01 +0200, Jordi Sayol via Digitalmars-d-learn
wrote:
>
[…]
> https://github.com/nomad-software/tkd
>
I am not a great fan of tk even in Python. It is true that Tk is
everywhere and so meets the portability requirement, but I would still
go with Qt (well QML anyway) in pr
On Tue, 2016-05-24 at 09:00 +0200, Jacob Carlborg via Digitalmars-d-
learn wrote:
>
[…]
> I think that by default Dub should not check dependencies. There
> should
> be an explicit command to install the dependencies.
Dub must check all dependencies before starting a build, the question
is whet
26 matches
Mail list logo