On Friday, 1 May 2015 at 03:34:53 UTC, Luigi wrote:
Hi everybody.
I am tring to use a function where its parameter is another
function, and at the same time are both already made - they
cannot be modified - and the second one has to be conditioned
before to be passed as argument.
Let's say
Hi everybody.
I am tring to use a function where its parameter is another
function, and at the same time are both already made - they
cannot be modified - and the second one has to be conditioned
before to be passed as argument.
Let's say I have these function and I cannot modify:
-jac(+d)
On Thursday, April 30, 2015 11:59:00 Ali Çehreli via Digitalmars-d-learn wrote:
> (Thanks to Luís Marques for waking me up.)
>
> Although it makes sense now, somehow some parts of this story is news to
> me after all these years. :-/
>
> When there are multiple slices to all elements of an array, t
On Thursday, 30 April 2015 at 23:27:49 UTC, bitwise wrote:
Well, the third thing was just my reasoning for asking in the
first place. I need to be able to acquire/release shared
resources reliably, like an OpenGL texture, for example.
If you want to release resources, you are going to have to
On Thursday, 30 April 2015 at 12:14:39 UTC, Robert M. Münch wrote:
How can I make use of the -vgc compiler switch in my DUB
project?
Does dflags work ?
http://code.dlang.org/package-format
On Thursday, 30 April 2015 at 21:01:36 UTC, Vlad Levenfeld wrote:
I was wondering if there's a mechanism to make anonymous
templates, e.g.
given:
enum Policy {A, B}
alias List = TypeTuple!(...);
instead of this:
enum has_policy_A (T) = T.policy == Policy.A;
alias Result = Filter!(has_
On Thu, 30 Apr 2015 16:17:10 -0400, Adam D. Ruppe
wrote:
On Thursday, 30 April 2015 at 20:07:11 UTC, bitwise wrote:
destructors are called on a separate thread, in parallel to the main
thread. Is this correct?
Not necessarily. the way the GC works in D today is whenever any thread
alloc
Paul:
When compiled on a 64 bit machine, this line
int r = uniform(0, mobs.length);
".length" returns a size_t, and 0 is an int. uniform() probably
decides to unify those types to a size_t. A size_t is 32 bit on
32 bit machines and 64 bits on 64 bit machines. But D "int" is
always a 32 bit
On Thursday, 30 April 2015 at 22:01:43 UTC, Justin Whear wrote:
On Thu, 30 Apr 2015 21:30:34 +, TheGag96 wrote:
Was the behavior of the remove() function changed recently?
Thanks guys.
I believe remove has always worked this way. What you're
seeing is
explained by this note in the docum
On Thu, 30 Apr 2015 21:30:34 +, TheGag96 wrote:
> Was the behavior of the remove() function changed recently? Thanks guys.
I believe remove has always worked this way. What you're seeing is
explained by this note in the documentation for remove:
> The original array has remained of the same
On Thursday, 30 April 2015 at 21:30:36 UTC, TheGag96 wrote:
arr.remove(1);
You didn't assign the result here... the site says
arr = arr.remove(index);
Notice too that the docs do NOT take the array by reference; they
don't necessarily modify it in-place.
http://dlang.org/phobos/std_algo
Same output:
[1, 10]
true
[1]
false
with dmd 2.067.1
On Thursday, 30 April 2015 at 21:30:36 UTC, TheGag96 wrote:
I was looking at the d-idioms website today and saw this code
example:
http://p0nce.github.io/d-idioms/#Adding-or-removing-an-element-from-arrays
And I was kind of irked. I just recently working with removing
an element from an array
I was looking at the d-idioms website today and saw this code
example:
http://p0nce.github.io/d-idioms/#Adding-or-removing-an-element-from-arrays
And I was kind of irked. I just recently working with removing an
element from an array in a small project I worked on two weeks
ago, and I had to
I was wondering if there's a mechanism to make anonymous
templates, e.g.
given:
enum Policy {A, B}
alias List = TypeTuple!(...);
instead of this:
enum has_policy_A (T) = T.policy == Policy.A;
alias Result = Filter!(has_policy_A, List);
use something like this:
Filter!(T => T.policy
On Thursday, 30 April 2015 at 20:07:11 UTC, bitwise wrote:
destructors are called on a separate thread, in parallel to the
main thread. Is this correct?
Not necessarily. the way the GC works in D today is whenever any
thread allocates, it runs the GC functions which might do a
collection. Thi
On Thursday, 30 April 2015 at 20:07:11 UTC, bitwise wrote:
After reading GC page in the reference, it seems that class
destructors are called on a separate thread, in parallel to the
main thread. Is this correct?
There's no guarantee what thread will be used in the standard GC
implementation
After reading GC page in the reference, it seems that class
destructors are called on a separate thread, in parallel to the
main thread. Is this correct?
What about structs? Are the destructors called when they go out
of scope in a C++ RAII fashion, or do they happen on a separate
thread too?
(Thanks to Luís Marques for waking me up.)
Although it makes sense now, somehow some parts of this story is news to
me after all these years. :-/
When there are multiple slices to all elements of an array, they all
start with same capacity until an element is added to one of them. After
that
When compiled on a 64 bit machine, this line
int r = uniform(0, mobs.length);
gives me an error:
Error: cannot implicitly convert expression (uniform(0,
mobs.length)) of type ulong to int
but it compiles ok on a 32 bit machine.
I thought it was the expression on the righthand side returning
Note that my solution relies on the pre-release version of std.uni, those
lazy functions aren't in the latest release.
Just for fun:
// map, join, text, iota, writeln,
tuple
import std.algorithm, std.array, std.conv, std.range, std.stdio,
std.typecons;
void main()
{
iota(1,100)
.map!(a => tuple(a, a % 3 == 0 ? 0 : 4, a % 5 == 0 ? 8 : 4))
.map!(a => a[1] == a[2] ? a[0].text
On Thursday, 30 April 2015 at 03:00:36 UTC, zhmt wrote:
On Thursday, 30 April 2015 at 02:02:50 UTC, zhmt wrote:
dub build is running on centos7. It works well until today, It
becomes very slow suddenly. It will take minuties per
compilation, there is 10 files in project.
Has anyone experience
How can I make use of the -vgc compiler switch in my DUB project?
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
Another possible way is to check the bounds at compile time. The
different operators need to be overloaded for that. For example,
if you have to types Int!(0, 100) and Int!(20, 30), the result
type of an addition needs to be Int!(20, 130).
Then, there can be an overloaded opCast() to bool for
Dennis Ritchie:
There is an array of values to store each of which sufficiently
6 bits.
As it is written down on the D?
You can't do it directly in D. Someone has to write a packed
array data structure to do it.
Bye,
bearophile
Hi,
There is an array of values to store each of which sufficiently 6
bits.
As it is written down on the D?
-
With Ada.Text_IO; Use Ada.Text_IO;
With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
procedure Program is
type T_Type is range -10 .. 27;
for T_Type'Size use 6;
type Vect
On Thursday, 30 April 2015 at 08:18:16 UTC, Benjamin Thaut wrote:
On Wednesday, 29 April 2015 at 19:04:11 UTC, extrawurst wrote:
On Wednesday, 29 April 2015 at 13:55:46 UTC, Benjamin Thaut
wrote:
On Monday, 27 April 2015 at 21:19:02 UTC, extrawurst wrote:
here is the shortened version of the
On 2015-04-29 23:24, Chris wrote:
Yes. Doesn't work.
What happens when you run "./dvm install dvm"? What is the output? If
the installation of DVM itself fails you will not be able to install
compilers.
You can verify the installation of DVM by opening a new shell session (a
new tab or wi
On Wed, 29 Apr 2015 07:57:07 -0700, H. S. Teoh via Digitalmars-d-learn
wrote:
> Switch statements in D allow all sorts of abominations, if only you
> would try it. I think it was originally designed to support a particular
> loop idiom (sorry I forgot what it was called, and don't have time to
> l
On Wed, 29 Apr 2015 10:48:36 +, Gary Willoughby wrote:
> Please raise an issue in bugzilla. This is obviously an error.
done: https://issues.dlang.org/show_bug.cgi?id=14532
signature.asc
Description: PGP signature
On Wednesday, 29 April 2015 at 19:04:11 UTC, extrawurst wrote:
On Wednesday, 29 April 2015 at 13:55:46 UTC, Benjamin Thaut
wrote:
On Monday, 27 April 2015 at 21:19:02 UTC, extrawurst wrote:
here is the shortened version of the returned class CSteamID:
https://gist.github.com/Extrawurst/936f56c
On Wednesday, 29 April 2015 at 22:02:29 UTC, novice2 wrote:
Hello.
Help me please to understand, how to show usage help to user,
who enter wrong options?
For example, user not provided required filename.
I want to show error message, and program usage help text.
But likely getopt don't provide
33 matches
Mail list logo