On Wednesday, 13 August 2014 at 21:22:31 UTC, Nordlöw wrote:
return range.find(a => a != element);
What have I done wrong?
You forgot the !, making the predicate a function argument. It
should be
return range.find!(a => a != element);
- Jonathan M Davis
On Wednesday, 13 August 2014 at 21:22:31 UTC, Nordlöw wrote:
unittest { dln([1, 2, 3].dropWhile(1)); }
should be
unittest { [1, 2, 3].dropWhile(1) == [2, 3]; }
On Wednesday, 13 August 2014 at 14:45:43 UTC, Jonathan M Davis
via Digitalmars-d-learn wrote:
They're called find and until. You just have to give them the
opposite
predicate that you'd give a function called dropIf or takeIf.
Ok, thx.
As an exercise I tried
auto dropWhile(R, E)(R range, E e
On Tuesday, 12 August 2014 at 22:25:24 UTC, Johnathan Sunders
wrote:
I'm having an issue with building programs that link with LuaD
using VisualD. If I use Dub, it builds without an issue, but
generating a project file and compiling it through VisualD
results in "Error 162: Bad Type Index refer
On Wed, Aug 13, 2014 at 08:52:32PM +, via Digitalmars-d-learn wrote:
> On Wednesday, 13 August 2014 at 20:27:29 UTC, H. S. Teoh via
> Digitalmars-d-learn wrote:
> >On Wed, Aug 13, 2014 at 07:58:49PM +, Gary Willoughby via
> >Digitalmars-d-learn wrote:
> >>On Wednesday, 13 August 2014 at 19:
On Wednesday, 13 August 2014 at 20:27:29 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Wed, Aug 13, 2014 at 07:58:49PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
On Wednesday, 13 August 2014 at 19:43:20 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
>On Wed, Aug 13, 2014 at 07:37:
On Wed, Aug 13, 2014 at 07:58:49PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
> On Wednesday, 13 August 2014 at 19:43:20 UTC, H. S. Teoh via
> Digitalmars-d-learn wrote:
> >On Wed, Aug 13, 2014 at 07:37:09PM +, Gary Willoughby via
> >Digitalmars-d-learn wrote:
> >>On Wednesday, 13 A
On Wednesday, 13 August 2014 at 19:43:20 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Wed, Aug 13, 2014 at 07:37:09PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
>On Wed, Aug 13, 2014 at 06:31:
On Wed, Aug 13, 2014 at 07:37:09PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
> On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via
> Digitalmars-d-learn wrote:
> >On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via
> >Digitalmars-d-learn wrote:
[...]
> >>I've used yo
On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
>Anyway, clearly we're not underst
On Wed, Aug 13, 2014 at 07:23:30PM +, via Digitalmars-d-learn wrote:
> On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via
> Digitalmars-d-learn wrote:
> >On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via
> >Digitalmars-d-learn wrote:
[...]
> >>I've used your advice and imp
On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
>Anyway, clearly we're not underst
On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
> On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via
> Digitalmars-d-learn wrote:
> >Anyway, clearly we're not understanding each other, so let me present
> >some concrete code so that we aren't just ta
On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
Anyway, clearly we're not understanding each other, so let me
present
some concrete code so that we aren't just talking past each
other:
I've used your advice and implemented a range over the list as
suggeste
On Tue, 2014-08-12 at 23:53 +0100, Russel Winder wrote:
[…]
> Per Nordlöw has offered a putative fix via a pull request. I'll check
> out the claim and if it seems to be true (and I fully expect it to be
> so) I'll accept the pull request. People using MELPA should see the new
> package quite quick
On Wed, 13 Aug 2014 07:45:17 -0700
Jonathan M Davis via Digitalmars-d-learn
wrote:
> On Wed, 13 Aug 2014 14:28:29 +
> Meta via Digitalmars-d-learn
> wrote:
>
> > On Wednesday, 13 August 2014 at 12:37:34 UTC, Nordlöw wrote:
> > > Are there variants of drop* and take* that only drop element if
On Wed, Aug 13, 2014 at 03:03:14PM +0200, simendsjo via Digitalmars-d-learn
wrote:
> On 08/13/2014 02:50 PM, Dicebot wrote:
> > On Wednesday, 13 August 2014 at 12:26:02 UTC, simendsjo wrote:
> >> This is the first time I've seen attributes on unittests:
> >> https://github.com/D-Programming-Langua
On Wed, 13 Aug 2014 14:28:29 +
Meta via Digitalmars-d-learn wrote:
> On Wednesday, 13 August 2014 at 12:37:34 UTC, Nordlöw wrote:
> > Are there variants of drop* and take* that only drop element if
> > its equal to a value kind of like strip does?
> >
> > If not I believe they should be added
On Wednesday, 13 August 2014 at 12:37:34 UTC, Nordlöw wrote:
Are there variants of drop* and take* that only drop element if
its equal to a value kind of like strip does?
If not I believe they should be added.
No, but it'd probably be useful. Maybe call them dropIf/takeIf,
or just add an ove
On 08/13/2014 02:50 PM, Dicebot wrote:
> On Wednesday, 13 August 2014 at 12:26:02 UTC, simendsjo wrote:
>> This is the first time I've seen attributes on unittests:
>> https://github.com/D-Programming-Language/phobos/pull/2349/files#diff-ba05e420ac1da65db044e79304d641b6R179
>>
>>
>> Has this always
On Wednesday, 13 August 2014 at 12:26:02 UTC, simendsjo wrote:
This is the first time I've seen attributes on unittests:
https://github.com/D-Programming-Language/phobos/pull/2349/files#diff-ba05e420ac1da65db044e79304d641b6R179
Has this always been supported? I guess it's good practice to
add t
Are there variants of drop* and take* that only drop element if
its equal to a value kind of like strip does?
If not I believe they should be added.
This is the first time I've seen attributes on unittests:
https://github.com/D-Programming-Language/phobos/pull/2349/files#diff-ba05e420ac1da65db044e79304d641b6R179
Has this always been supported? I guess it's good practice to add these
on unittests too, but does people even know about this featur
On Wednesday, 13 August 2014 at 07:58:40 UTC, Nordlöw wrote:
{
float x = 1.23e10;
auto y = *cast(FloatRep*)(&x);
writeln(y.fraction, ", ",
y.exponent, ", ",
y.sign);
}
{
double x = 1.23e10;
auto y = *cast(DoubleR
On Wednesday, 13 August 2014 at 07:51:30 UTC, Nordlöw wrote:
Could someone briefly outline the algorithm that converts the
fraction part of FloatRep into a string in base 10?
Walter Bright broke down the Floating point to explain how it
works and why as i recall..
http://dlang.org/d-floati
On Wednesday, 13 August 2014 at 07:51:30 UTC, Nordlöw wrote:
1. http://dlang.org/phobos/std_bitmanip.html#.FloatRep
Can somebody shortly explain why
import std.stdio, std.algorithm, std.range, std.stdio,
std.bitmanip;
void main(string args[])
{
{
float x = 1.23e10;
auto
On Monday, 11 August 2014 at 15:30:30 UTC, Justin Whear wrote:
1. http://dlang.org/phobos/std_bitmanip.html#.FloatRep
Could someone briefly outline the algorithm that converts the
fraction part of FloatRep into a string in base 10?
My first guess is
sum = 0;
foreach (bit_index i, bit_value
27 matches
Mail list logo