On Monday, 21 May 2018 at 15:00:09 UTC, Dennis wrote:
I want to be convinced that Range programming works like a
charm, but the procedural approaches remain more flexible (and
faster too) it seems. Thanks for the example.
On Monday, 21 May 2018 at 22:11:42 UTC, Dennis wrote:
In this case I
On Monday, 21 May 2018 at 02:23:27 UTC, ag0aep6g wrote:
I tried this. Your code crashes in windows dmd x86 x64.
Hm. Works for me in a virtual machine. But I'm not surprised
that it's fragile. It might be completely wrong, and it just
happens to look alright on my machine.
On Monday, 21 May 2018 at 17:42:19 UTC, Jonathan M Davis wrote:
On Monday, May 21, 2018 15:00:09 Dennis via Digitalmars-d-learn
wrote:
drop is range-based, so if you give it a string, it's going to
decode because of the whole auto-decoding mess with
std.range.primitives.front and popFront.
On 5/21/18 1:50 PM, Robert M. Münch wrote:
On 2018-05-21 17:24:12 +, Steven Schveighoffer said:
I'm not 100% sure but I expect:
scope(failure)
someCode();
putting a breakpoint on someCode should work.
When calling a function an then setting the breakpoint there, like in
someCode()
On Monday, 21 May 2018 at 15:20:14 UTC, Dr.No wrote:
On Monday, 21 May 2018 at 15:16:11 UTC, Atila Neves wrote:
On Friday, 18 May 2018 at 15:16:52 UTC, Russel Winder wrote:
Hi,
What's the current official position on how to create
temporary files for use during a unittest. I found
Not
On Monday, 21 May 2018 at 17:03:40 UTC, Russel Winder wrote:
On Mon, 2018-05-21 at 15:16 +, Atila Neves via
Digitalmars-d-learn wrote:
On Friday, 18 May 2018 at 15:16:52 UTC, Russel Winder wrote:
> Hi,
>
> What's the current official position on how to create
> temporary files for use
On Monday, May 21, 2018 16:05:00 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 5/21/18 3:22 PM, Jonathan M Davis wrote:
> > That's basically what I was suggesting that he do, but I guess that I
> > wasn't clear enough.
>
> Well one thing that seems clear from this example -- we now
On 5/21/18 3:22 PM, Jonathan M Davis wrote:
That's basically what I was suggesting that he do, but I guess that I wasn't
clear enough.
Well one thing that seems clear from this example -- we now have
__traits(isSame) to tell if lambdas are the same, but it looks like the
compiler doesn't
On 5/21/18 3:20 PM, Jonathan M Davis wrote:
On Monday, May 21, 2018 14:40:24 Steven Schveighoffer via Digitalmars-d-
learn wrote:
For me, the code smell is using arr is null (is it really necessary to
check for a null pointer here?), for which I always have to look at more
context to see if
On Monday, May 21, 2018 18:13:26 Dr.No via Digitalmars-d-learn wrote:
> I'm trying to do some hashing at compile time with xxhash
> algorithm but I get this error:
>
> ..\..\..\AppData\Local\dub\packages\xxhash-master\xxhash\src\xxhash.d(39,3
> 7): Error: reinterpreting cast from const(ubyte)* to
On Monday, May 21, 2018 12:44:21 Malte via Digitalmars-d-learn wrote:
> I was interested by asserts and how the compiler uses them to
> optimize the code. So I looked at the compiler explorer to see
> how and found it, it doesn't.
>
> What I tried to do is turn a std.conv.to!ulong(byte) to a
On Monday, May 21, 2018 11:13:16 Ali Çehreli via Digitalmars-d-learn wrote:
> On 05/20/2018 10:46 AM, Robert M. Münch wrote:
> > But I still don't understand why I can't write things explicitly but
> > have to use an alias for this.
>
> Templatized range types work well when they are used as
On Monday, May 21, 2018 14:55:36 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 5/20/18 1:46 PM, Robert M. Münch wrote:
> > On 2018-05-20 17:40:39 +, Robert M. Münch said:
> >> Hi Jonathan, great! This got me a step further. So I can declare my
> >> member now. But I get an implict
On Monday, May 21, 2018 14:40:24 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 5/21/18 2:05 PM, Jonathan M Davis wrote:
> > The core problem here is that no one reading a piece of code has any way
> > of knowing whether the programmer knew what they were doing or not when
> > using ==
On 5/20/18 1:46 PM, Robert M. Münch wrote:
On 2018-05-20 17:40:39 +, Robert M. Münch said:
Hi Jonathan, great! This got me a step further. So I can declare my
member now. But I get an implict cast error when I try:
class a {
... myStream;
}
class b {
typeof(a.myStream.filter!(x
On Monday, May 21, 2018 14:00:55 ANtlord via Digitalmars-d-learn wrote:
> On Monday, 21 May 2018 at 11:38:12 UTC, SrMordred wrote:
> > After all this time I saw this:
> >
> > writeln = iota = 5;
> >
> > what??
> >
> > I never saw that before!
> >
> > This is interesting, there is something useful
On 5/21/18 2:05 PM, Jonathan M Davis wrote:
The core problem here is that no one reading a piece of code has any way of
knowing whether the programmer knew what they were doing or not when using
== null with an array, and the vast majority of newbies are not going to
have understood the
On Monday, 21 May 2018 at 15:41:21 UTC, Simen Kjærås wrote:
On Saturday, 19 May 2018 at 18:44:42 UTC, IntegratedDimensions
wrote:
On Saturday, 19 May 2018 at 18:19:35 UTC, IntegratedDimensions
wrote:
Is there any way to create an int24 type that behaves just
like any other built in type
I'm trying to do some hashing at compile time with xxhash
algorithm but I get this error:
..\..\..\AppData\Local\dub\packages\xxhash-master\xxhash\src\xxhash.d(39,37):
Error: reinterpreting cast from const(ubyte)* to const(uint)* is not supported
in CTFE
this is line 39
On 05/20/2018 10:46 AM, Robert M. Münch wrote:
> But I still don't understand why I can't write things explicitly but
> have to use an alias for this.
Templatized range types work well when they are used as template
arguments themselves.
When you need to keep a single type like 'b' (i.e. b
On Monday, May 21, 2018 10:01:15 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 5/18/18 9:48 PM, Jonathan M Davis wrote:
> > Of
> > course, the most notable case where using == with null is a terrible
> > idea is dynamic arrays, and that's the case where the compiler
> > _doesn't_
On 2018-05-21 17:24:12 +, Steven Schveighoffer said:
I'm not 100% sure but I expect:
scope(failure)
someCode();
putting a breakpoint on someCode should work.
When calling a function an then setting the breakpoint there, like in
someCode() yes, that should work.
I used code like
A project I can compile via the command line and dub, gives an error in
VisualD. I created the VisualD configuration through dub:
fatal error C1905: Front-End und Back-End sind nicht kompatibel
(müssen den gleichenProzessor verwenden).
This translates to: "Front-End and Back-End are not
On Monday, May 21, 2018 15:00:09 Dennis via Digitalmars-d-learn wrote:
> On Thursday, 17 May 2018 at 21:10:35 UTC, Dennis wrote:
> > It's unfortunate that Phobos tells you 'there's problems with
> > the encoding' without providing any means to fix it or even
> > diagnose it.
>
> I have to take
On 5/21/18 1:00 PM, Robert M. Münch wrote:
If I use scope(failure) with code that should be run if an exception is
thrown, how can I set a breakpoint for this code in the debugger?
I'm not 100% sure but I expect:
scope(failure)
someCode();
putting a breakpoint on someCode should work.
If I use scope(failure) with code that should be run if an exception is
thrown, how can I set a breakpoint for this code in the debugger?
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
On Mon, 2018-05-21 at 15:16 +, Atila Neves via Digitalmars-d-learn wrote:
> On Friday, 18 May 2018 at 15:16:52 UTC, Russel Winder wrote:
> > Hi,
> >
> > What's the current official position on how to create temporary
> > files for use during a unittest. I found
>
> Not official, but...
>
>
"%s %s".writefln = ("foo".tuple = "bar").expand;
lol
where's this stored?
On 22/05/2018 4:21 AM, Dr.No wrote:
where's this stored?
-v should do the trick
On Saturday, 19 May 2018 at 18:44:42 UTC, IntegratedDimensions
wrote:
On Saturday, 19 May 2018 at 18:19:35 UTC, IntegratedDimensions
wrote:
Is there any way to create an int24 type that behaves just
like any other built in type without having to reimplement
everything?
In fact, what I'd like
On Monday, 21 May 2018 at 15:16:11 UTC, Atila Neves wrote:
On Friday, 18 May 2018 at 15:16:52 UTC, Russel Winder wrote:
Hi,
What's the current official position on how to create
temporary files for use during a unittest. I found
Not official, but...
import unit_threaded;
On 5/21/18 10:59 AM, kdevel wrote:
On Monday, 21 May 2018 at 14:17:23 UTC, Steven Schveighoffer wrote:
Data f;
allrows[0].toStruct (f);
I haven't checked this.
This only works if your struct has exactly the same layout as the fields.
So if, for instance, your rows are selected
On Friday, 18 May 2018 at 15:16:52 UTC, Russel Winder wrote:
Hi,
What's the current official position on how to create temporary
files for use during a unittest. I found
Not official, but...
import unit_threaded;
with(const Sandbox()) {
writeFile("myfile.txt", "contents");
On Thursday, 17 May 2018 at 21:10:35 UTC, Dennis wrote:
It's unfortunate that Phobos tells you 'there's problems with
the encoding' without providing any means to fix it or even
diagnose it.
I have to take that back since I found out about std.encoding
which has functions like `sanitize`,
On Monday, 21 May 2018 at 14:17:23 UTC, Steven Schveighoffer
wrote:
Data f;
allrows[0].toStruct (f);
I haven't checked this.
This only works if your struct has exactly the same layout as
the fields.
So if, for instance, your rows are selected "title", "name",
"surname", but your
On Monday, 21 May 2018 at 11:38:12 UTC, SrMordred wrote:
what??
Here's another weird example:
```
void funWithUfcsAndPropertySyntax() {
import std.typecons : tuple;
"%s %s".writefln = ("foo".tuple = "bar").expand;
}
```
source:
On Monday, 21 May 2018 at 11:38:12 UTC, SrMordred wrote:
After all this time I saw this:
writeln = iota = 5;
what??
I never saw that before!
This is interesting, there is something useful that i can do
with this kind of call?
That's pretty cool, but at the same time this should be wiped
On 5/21/18 9:39 AM, kdevel wrote:
On Sunday, 20 May 2018 at 16:08:03 UTC, ipkwena wrote:
How does one access the columns fields in a Mysql query results by the
column name.
[...]
Data f;
f.name = to!string(allrows[0][0]);
f.surname = to!string(allrows[0][1]);
f.title =
On 5/21/18 8:15 AM, SrMordred wrote:
Right, so this should´n be working I think.
struct SomeStruct
{
void foo(int);
}
SomeStruct s;
s.foo = 10;
I thought that only with @property this will work.
That was the plan, but it got derailed.
Whoever wrote that original line of code, they
On 5/20/18 12:08 PM, ipkwena wrote:
I have started learning D and I am enjoying it so far.
How does one access the columns fields in a Mysql query results by the
column name. Currently I have to use the method as shown in a couple of
example by indexing array values (f being a struct
On 5/18/18 9:48 PM, Jonathan M Davis wrote:
On Saturday, May 19, 2018 01:27:59 Neia Neutuladh via Digitalmars-d-learn
wrote:
On Friday, 18 May 2018 at 23:53:12 UTC, IntegratedDimensions
wrote:
Why does D complain when using == to compare with null? Is
there really any technical reason? if one
On Monday, 21 May 2018 at 11:38:12 UTC, SrMordred wrote:
After all this time I saw this:
writeln = iota = 5;
what??
I never saw that before!
This is interesting, there is something useful that i can do
with this kind of call?
What the hell is this? I don't figure out why are there so many
On Sunday, 20 May 2018 at 16:08:03 UTC, ipkwena wrote:
How does one access the columns fields in a Mysql query results
by the column name.
[...]
Data f;
f.name = to!string(allrows[0][0]);
f.surname = to!string(allrows[0][1]);
f.title = to!string(allrows[0][2]);
I am using the mysql-native
I was interested by asserts and how the compiler uses them to
optimize the code. So I looked at the compiler explorer to see
how and found it, it doesn't.
What I tried to do is turn a std.conv.to!ulong(byte) to a simple
cast with the help of assertions.
https://godbolt.org/g/4uckWU
If there
Right, so this should´n be working I think.
struct SomeStruct
{
void foo(int);
}
SomeStruct s;
s.foo = 10;
I thought that only with @property this will work.
On 21/05/2018 11:50 PM, 0xEAB wrote:
What's the correct way to copy a `File` into another one in D?
If `LockingTextReader` wasn't undocumented, I'd have gone for that
approach:
import std.algorithm.mutation : copy;
import std.stdio : File, LockingTextReader;
void main()
{
auto a =
What's the correct way to copy a `File` into another one in D?
If `LockingTextReader` wasn't undocumented, I'd have gone for
that approach:
import std.algorithm.mutation : copy;
import std.stdio : File, LockingTextReader;
void main()
{
auto a = File("a.txt", "r");
auto b =
On Monday, 21 May 2018 at 11:38:12 UTC, SrMordred wrote:
After all this time I saw this:
writeln = iota = 5;
what??
I never saw that before!
This is interesting, there is something useful that i can do
with this kind of call?
I probably wouldn't use that. That wasn't what it was intended
After all this time I saw this:
writeln = iota = 5;
what??
I never saw that before!
This is interesting, there is something useful that i can do with
this kind of call?
50 matches
Mail list logo