On Wednesday, 8 August 2018 at 13:13:42 UTC, Simen Kjærås wrote:
On Wednesday, 8 August 2018 at 12:57:43 UTC, learnfirst1 wrote:
Why this is a error ?
```
struct S {
bool v;
string x;
}
S* add(A...)(ref A a) {
__gshared s = S(a);
return
}
void main(){
On Wednesday, August 8, 2018 3:54:34 PM MDT aliak via Digitalmars-d-learn
wrote:
> I'm trying to debug stuff, so I want to add verbose logging
>
> struct S(T) {
>this() {
> writeln("created S(T) with properties and ID");
>}
> }
>
> static a = S!int(); // bah
>
> I guess users can
I'm trying to debug stuff, so I want to add verbose logging
struct S(T) {
this() {
writeln("created S(T) with properties and ID");
}
}
static a = S!int(); // bah
I guess users can call this code from any context, but when i'd
also like to see the log output for debugging purposes. Is
On Wednesday, 8 August 2018 at 17:08:57 UTC, vit wrote:
Hello, is in phobos some function which convert float/double to
string and is pure @nogc and nothrow?
Short answer: no.
Long answer: https://issues.dlang.org/show_bug.cgi?id=17628
vit wrote:
thanks, that code can be modified to pure nothrow @nogc @safe.
Is that lib ok? Is little complicated...
converting float to string is a *very* complicated task. that lib is quite
small for what it is doing ('cause it hacks around some... interesting
cases). the *real* thing will
On Wednesday, 8 August 2018 at 17:40:11 UTC, ketmar wrote:
vit wrote:
Hello, is in phobos some function which convert float/double
to string and is pure @nogc and nothrow?
i don't think that you can make it `pure`, but you certainly
can make it `nothrow`, `@nogc` and ctfe-able. it's
Hi Dlang community!
I've stumbled on an interesting issue with allocators. It seems
that we can't get disposed of arrays with const or immutable
data. Consider example below:
Link: https://run.dlang.io/is/frnQI8
import std.stdio;
import std.range;
import
vit wrote:
Hello, is in phobos some function which convert float/double to string
and is pure @nogc and nothrow?
i don't think that you can make it `pure`, but you certainly can make it
`nothrow`, `@nogc` and ctfe-able. it's dangerous to go alone! take this[0].
[0]
On 8/8/18 1:08 PM, vit wrote:
Hello, is in phobos some function which convert float/double to string
and is pure @nogc and nothrow?
Not one that I can see. formattedWrite doesn't seem to be pure.
-Steve
Hello, is in phobos some function which convert float/double to
string and is pure @nogc and nothrow?
On Monday, 6 August 2018 at 14:27:01 UTC, Timoses wrote:
On Thursday, 2 August 2018 at 20:35:57 UTC, Steven
Schveighoffer wrote:
Looking at the AST, it appears that toImpl doesn't recognize
what inout(iface) is:
toImpl!(string, inout(iface))
{
@system string toImpl(ref inout(iface)
On 8/7/18 10:28 PM, Nicholas Wilson wrote:
On Wednesday, 8 August 2018 at 01:33:26 UTC, Steven Schveighoffer wrote:
On 8/7/18 9:20 PM, Nicholas Wilson wrote:
the first overload is
ptrdiff_t countUntil(alias pred = "a == b", R, Rs...)(R haystack, Rs
needles)
if (isForwardRange!R
&& Rs.length
On Wednesday, 8 August 2018 at 13:13:24 UTC, aliak wrote:
Go here https://run.dlang.io/is/tJ4vXm and click on the AST
button :) It shows you what the code turns in to after all the
semantic passes.
Yeah... no... I'm aware of this cool thing ))
I thought you have a hidden source of
On Wednesday, 8 August 2018 at 12:58:24 UTC, Alex wrote:
On Wednesday, 8 August 2018 at 11:58:50 UTC, aliak wrote:
Found this out while just looking at lowerings.
How do you "look at lowerings"? Is there a list, I'm not aware
of? ;)
Go here https://run.dlang.io/is/tJ4vXm and click on the
On Wednesday, 8 August 2018 at 12:57:43 UTC, learnfirst1 wrote:
Why this is a error ?
```
struct S {
bool v;
string x;
}
S* add(A...)(ref A a) {
__gshared s = S(a);
return
}
void main(){
auto p = add(true);
}
```
test.d(9): Error: variable _param_0
On Wednesday, 8 August 2018 at 12:57:43 UTC, learnfirst1 wrote:
Why this is a error ?
this code example can explain what I am try to do here:
struct M {
int i;
S*[100] s;
}
struct S {
M* mp;
bool x;
}
S* add(A...)(ref A a) {
__gshared s = S(a);
Why this is a error ?
```
struct S {
bool v;
string x;
}
S* add(A...)(ref A a) {
__gshared s = S(a);
return
}
void main(){
auto p = add(true);
}
```
test.d(9): Error: variable _param_0 cannot be read at compile time
test.d(14): Error: template instance
On Wednesday, 8 August 2018 at 11:58:50 UTC, aliak wrote:
Found this out while just looking at lowerings.
How do you "look at lowerings"? Is there a list, I'm not aware
of? ;)
On Wednesday, August 8, 2018 5:58:50 AM MDT aliak via Digitalmars-d-learn
wrote:
> Found this out while just looking at lowerings. Wondering if
> anyone knows the semantics involved here and where they are
> documented?
It's particularly useful when dealing with stuff like C functions that
Found this out while just looking at lowerings. Wondering if
anyone knows the semantics involved here and where they are
documented?
And, is there anyway to do it with multiple variables?
I.e.
if (int a = 0, int b = 0) {
// ...
}
Cheers,
- Ali
On Wednesday, August 8, 2018 2:15:16 AM MDT Hakan Aras via Digitalmars-d-
learn wrote:
> Given this:
>
> struct Num
> {
> this(int a) {}
> }
>
> Is there any reason why this works:
>
> Num n = 5;
>
> but this doesnt:
>
> Num funk()
> {
> return 5;
> }
>
>
> I understand that I can
On Wednesday, 8 August 2018 at 08:44:03 UTC, Alex wrote:
return typeof(return)(5);
Ah thanks, I was wondering if something like that exists. Still
though, that's 16 extra characters that dont need to be there.
On Wednesday, 8 August 2018 at 08:15:16 UTC, Hakan Aras wrote:
Given this:
struct Num
{
this(int a) {}
}
Is there any reason why this works:
Num n = 5;
but this doesnt:
Num funk()
{
return 5;
}
I understand that I can construct it explicitely, but that gets
annoying quickly,
Given this:
struct Num
{
this(int a) {}
}
Is there any reason why this works:
Num n = 5;
but this doesnt:
Num funk()
{
return 5;
}
I understand that I can construct it explicitely, but that gets
annoying quickly, especially with templates.
24 matches
Mail list logo