On 26/06/2018 16:25, Robert M. Münch wrote:
On 2018-06-24 13:08:53 +, Rainer Schuetze said:
a new release of Visual D has just been uploaded. Major changes are
* improved Visual C++ project integration: better dependencies,
automatic libraries, name demangling
* new project wizard
*
On Wednesday, 27 June 2018 at 02:39:49 UTC, Shigeki Karita wrote:
import std.stdio;
import std.conv;
void main() {
int i;
try {
readf("%d\n", &i); // "a"
} catch (ConvException e) {
auto s = readln();
writeln(s); // "aa", "aaa" or SEGV ???
}
}
https://wan
import std.stdio;
import std.conv;
void main() {
int i;
try {
readf("%d\n", &i); // "a"
} catch (ConvException e) {
auto s = readln();
writeln(s); // "aa", "aaa" or SEGV ???
}
}
https://wandbox.org/permlink/NMYNjpOgQtfUprBQ
I just want to retry reading if
On Tuesday, 26 June 2018 at 22:16:28 UTC, Jonathan M Davis wrote:
If what you're asking is whether it's possible for a template
constraint that uses something like isSomeString will ever
match a user-defined type, then the answer is no.
Thats exactly what I wanted xD.
My idea was that if you
n Tuesday, June 26, 2018 17:14:08 SrMordred via Digitalmars-d-learn wrote:
> Is possible to make a Custom Struct String work for D string
> constraints?
>
> eg:
>
> struct MyString
> {
> char[] arr;
> alias arr this;
> }
>
> void getString( char[] str ){}
>
> MyString().split(";"); //oops
On Tuesday, June 26, 2018 19:03:20 kdevel via Digitalmars-d-learn wrote:
> On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote:
> > On Monday, June 25, 2018 19:40:30 kdevel via
> >
> > Digitalmars-d-learn wrote:
> >> R r;
> >>
> >> if (r.s is null)
> >>
> >>throw new Exc
On Tuesday, 26 June 2018 at 20:47:27 UTC, Steven Schveighoffer
wrote:
Naming the hook for `put` the same thing as the global function
was one of the biggest mistakes in the range library. I almost
think we would be better off to deprecate that and pick another
hook name.
If you ever do that i
On 6/26/18 6:01 AM, ag0aep6g wrote:
On line 23, you're apparently trying to call std.range.put (which would
in turn call tarr[t].put). But being in a method that is itself called
"put", that line is instead interpreted as a recursive call (which
fails). To refer to std.range.put, you have to p
On Tuesday, 26 June 2018 at 14:32:59 UTC, Nathan S. wrote:
On Monday, 25 June 2018 at 19:40:30 UTC, kdevel wrote:
Is it possible
to "lower" the Nullable operations if T is a class type such
that there
is only one level of nullification?
Yes: https://run.dlang.io/is/hPxbyf
template Null
On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote:
On Monday, June 25, 2018 19:40:30 kdevel via
Digitalmars-d-learn wrote:
R r;
if (r.s is null)
throw new Exception ("some error message");
[...]
Why can't this programming error be detected at compile time?
If
On Tuesday, 26 June 2018 at 12:58:29 UTC, Adam D. Ruppe wrote:
On Tuesday, 26 June 2018 at 12:40:05 UTC, phs wrote:
Although, it's a little bit strange because I have never had
this issue with my C++ development.
The c++ compiler and runtime libraries are common enough that
the antivirus real
On 06/26/2018 10:37 AM, Rib wrote:
to get get() from std.net.curl return a ubyte[] and use my http
instance, all those failed:
string link = "http://...";;
auto client = HTTP();
// set some client attributes...
auto fileContents = get!(AutoProtocol, ubyte)(link, client);
auto fileContents = get
to get get() from std.net.curl return a ubyte[] and use my http
instance, all those failed:
string link = "http://...";;
auto client = HTTP();
// set some client attributes...
auto fileContents = get!(AutoProtocol, ubyte)(link, client);
auto fileContents = get!(ubyte)(link, client);
auto fileCon
Is possible to make a Custom Struct String work for D string
constraints?
eg:
struct MyString
{
char[] arr;
alias arr this;
}
void getString( char[] str ){}
MyString().split(";"); //oops, type mismatch
getString( MyString() ); //fine, implicit conversion
isSomeString!(char[]).writel
On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote:
Java does try to force you to initialize stuff (resulting in
annoying false positives at times), but in general, it still
can't guarantee when a variable is null or not and is forced to
insert runtime null checks.
Java can be so
On Monday, 25 June 2018 at 19:40:30 UTC, kdevel wrote:
Is it possible
to "lower" the Nullable operations if T is a class type such
that there
is only one level of nullification?
Yes: https://run.dlang.io/is/hPxbyf
template Nullable(S)
{
import std.traits : isPointer, isDynamicArray;
On 2018-06-24 13:08:53 +, Rainer Schuetze said:
a new release of Visual D has just been uploaded. Major changes are
* improved Visual C++ project integration: better dependencies,
automatic libraries, name demangling
* new project wizard
* mago debugger: show vtable, dynamic type of inte
On Tuesday, 26 June 2018 at 12:19:16 UTC, Jonathan M Davis wrote:
On Tuesday, June 26, 2018 11:28:11 Radu via Digitalmars-d-learn
wrote:
> [...]
Ha! :) yeah I was pretty sure this will not work.
I'm looking to generate some custom wrappers and knowing when
something is really `size_t` is impo
On Tuesday, 26 June 2018 at 12:40:05 UTC, phs wrote:
Although, it's a little bit strange because I have never had
this issue with my C++ development.
The c++ compiler and runtime libraries are common enough that the
antivirus realizes it is nothing special, but since D is more
obscure it just
On Tuesday, 26 June 2018 at 12:26:45 UTC, rikki cattermole wrote:
On 27/06/2018 12:25 AM, phs wrote:
Hello. I've made a simple hello world program using dub and
dmd for Windows. Everything works well, except that every
first run after each rebuild takes around 3 seconds just to
start up. Is it
Hello. I've made a simple hello world program using dub and dmd
for Windows. Everything works well, except that every first run
after each rebuild takes around 3 seconds just to start up. Is it
normal at all?
On 27/06/2018 12:25 AM, phs wrote:
Hello. I've made a simple hello world program using dub and dmd for
Windows. Everything works well, except that every first run after each
rebuild takes around 3 seconds just to start up. Is it normal at all?
Its normal if you don't add an exclusion for that
On Tuesday, June 26, 2018 11:28:11 Radu via Digitalmars-d-learn wrote:
> > I'm pretty sure that that's impossible. As I understand it, the
> > compiler basically just replaces aliases with what they refer
> > to and doesn't care what the original type was. And they
> > _definitely_ don't affect man
On Tuesday, 26 June 2018 at 10:19:44 UTC, Jonathan M Davis wrote:
On Tuesday, June 26, 2018 09:47:44 Radu via Digitalmars-d-learn
wrote:
On Tuesday, 26 June 2018 at 09:24:15 UTC, Stefan Koch wrote:
> On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote:
>> Consider this https://run.dlang.io/is/H
On Tuesday, June 26, 2018 09:47:44 Radu via Digitalmars-d-learn wrote:
> On Tuesday, 26 June 2018 at 09:24:15 UTC, Stefan Koch wrote:
> > On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote:
> >> Consider this https://run.dlang.io/is/HyY2qG
> >>
> >> ---
> >> void main()
> >> {
> >>
> >> impor
On Tuesday, 26 June 2018 at 10:01:06 UTC, ag0aep6g wrote:
On line 23, you're apparently trying to call std.range.put
(which would in turn call tarr[t].put). But being in a method
that is itself called "put", that line is instead interpreted
as a recursive call (which fails). To refer to std.ran
On 06/26/2018 11:35 AM, Alex wrote:
´´´
import std.range;
void main()
{
T.member.tarr.length = 42;
//put(T.member, 4); // line 6
T.member.put(4); // line 7
}
struct T
{
void put(Type)(Type t){} // line 13
static B member;
}
struct B
{
T[] tarr;
void put(Typ
On Tuesday, 26 June 2018 at 09:24:15 UTC, Stefan Koch wrote:
On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote:
Consider this https://run.dlang.io/is/HyY2qG
---
void main()
{
import std.traits;
size_t s;
pragma(msg, typeof(s).stringof);
pragma(msg, mangledName!(typeof(s)));
Hi all,
I have a strange case of template recursion, which I don't know
how to solve:
´´´
import std.range;
void main()
{
T.member.tarr.length = 42;
//put(T.member, 4); // line 6
T.member.put(4); // line 7
}
struct T
{
void put(Type)(Type t){} // line 13
On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote:
Consider this https://run.dlang.io/is/HyY2qG
---
void main()
{
import std.traits;
size_t s;
pragma(msg, typeof(s).stringof);
pragma(msg, mangledName!(typeof(s)));
pragma(msg, mangledName!s);
}
---
It outputs:
---
ulong
m
Consider this https://run.dlang.io/is/HyY2qG
---
void main()
{
import std.traits;
size_t s;
pragma(msg, typeof(s).stringof);
pragma(msg, mangledName!(typeof(s)));
pragma(msg, mangledName!s);
}
---
It outputs:
---
ulong
m
_D9onlineapp4mainFZ1sm
---
I'm looking for a way to g
On Monday, 25 June 2018 at 17:45:01 UTC, zbr wrote:
Hi, this question is not specifically D related but I'll just
ask anyway. Consider the following snippet:
void mergeSort(int[] arr, int l, int r)
{
if (l < r) // 1
{
int m = l+(r-l)/2;// 2
me
32 matches
Mail list logo