On Friday, 8 March 2019 at 11:42:11 UTC, Simon wrote:
Thanks, this works flawlessly. Out of interest: what is the
"enum" doing there? I had the exact same behaviour in a
function before, that I only called at compile-time, so why did
it complain then? Can I somehow tell the compiler that a
fun
On Friday, 8 March 2019 at 09:24:25 UTC, Vasyl Teliman wrote:
I've tried to use Mallocator in BetterC but it seems it's not
available there:
https://run.dlang.io/is/pp3HDq
This produces a linker error.
I'm wondering why Mallocator is not available in this mode (it
would be intuitive to assum
On Friday, 8 March 2019 at 09:24:25 UTC, Vasyl Teliman wrote:
I've tried to use Mallocator in BetterC but it seems it's not
available there:
https://run.dlang.io/is/pp3HDq
This produces a linker error.
I'm wondering why Mallocator is not available in this mode (it
would be intuitive to assum
On Friday, 8 March 2019 at 09:24:25 UTC, Vasyl Teliman wrote:
I've tried to use Mallocator in BetterC but it seems it's not
available there:
https://run.dlang.io/is/pp3HDq
This produces a linker error.
I'm wondering why Mallocator is not available in this mode (it
would be intuitive to assum
On Friday, 8 March 2019 at 09:24:25 UTC, Vasyl Teliman wrote:
Also I would to know what parts of Phobos are available there
(e.g. std.traits, std.typecons...).
There is no clear rule on which phobos packages work and which
don't. It all depends on what underlying features the phobos
package u
On Saturday, 9 March 2019 at 12:42:34 UTC, Sebastiaan Koppe wrote:
There might also be the option to use @nogc exceptions (dip
1008), but I am not sure.
That won't work as the implementation on DIP1008 cheats the type
system but doesn't actually work, i.e. the exceptions are still
CG allocate
On Friday, 8 March 2019 at 09:24:25 UTC, Vasyl Teliman wrote:
I've tried to use Mallocator in BetterC but it seems it's not
available there:
https://run.dlang.io/is/pp3HDq
This produces a linker error.
I'm wondering why Mallocator is not available in this mode (it
would be intuitive to assum
Hi,
Recently, I was trying to solve some funny coding challenges
(https://www.techgig.com).
The questions were really simple, but I found it interesting
because the website allows to use D.
One of the task was to take a string from STDIN and detect its
type.
There were a few options: Float,
Is it possible to get Dub to output import headers for compiled D
files?
On Saturday, 9 March 2019 at 18:11:09 UTC, Jacob Shtokolov wrote:w
One of the task was to take a string from STDIN and detect its
type.
The way I'd do this is a very simple loop:
enum Type { String, Float, Int }
if(str.length && str[0] == '-') {
str = str[1 .. $];
}
Type type = str.length ?
On Saturday, 9 March 2019 at 18:39:29 UTC, bitwise wrote:
Is it possible to get Dub to output import headers for compiled
D files?
I found this, which almost works:
"dflags": [ "-H", "-Hdimport", "-op" ]
The only problem is that Dub runs *above* the source directory,
resulting in all my impo
Hello everyone! I've encountered the problem which I already
encountered before. Unfortunately, I had no time in the previous
time to report and to talk about it. So I decided to play making
my own "malloc" function in pure D (betterC) at this time. And I
encountered the issue one more time. `t
On Saturday, 9 March 2019 at 19:08:22 UTC, bitwise wrote:
On Saturday, 9 March 2019 at 18:39:29 UTC, bitwise wrote:
Is it possible to get Dub to output import headers for
compiled D files?
I found this, which almost works:
"dflags": [ "-H", "-Hdimport", "-op" ]
The only problem is that Dub r
On Saturday, 9 March 2019 at 17:14:37 UTC, 9il wrote:
It was fixed to be used in BetterC. If it still does not work
you can open an issue and ping me (@9il).
That is awesome. I suppose support for betterC is only from v3
upwards?
On Saturday, 9 March 2019 at 19:18:38 UTC, ANtlord wrote:
Hello everyone! I've encountered the problem which I already
encountered before. Unfortunately, I had no time in the
previous time to report and to talk about it. So I decided to
play making my own "malloc" function in pure D (betterC) a
On Saturday, 9 March 2019 at 20:04:53 UTC, Paul Backus wrote:
struct S
{
bool isThisNull() { return &this is null; }
}
void main()
{
import.std.stdio;
S* p = null;
writeln((*p).isThisNull); // true
}
Interactive version: https://run.dlang.io/is/fgT2rS
Anyway, thank you! I did
On Saturday, 9 March 2019 at 20:04:53 UTC, Paul Backus wrote:
You can end up with a null `this` reference if you dereference
a null pointer to a struct and then call a method on the
result. For example:
I can but my reference is not null before calling. Take a look at
the line of code [0]
On 03/09/2019 12:10 PM, ANtlord wrote:
On Saturday, 9 March 2019 at 20:04:53 UTC, Paul Backus wrote:
You can end up with a null `this` reference if you dereference a null
pointer to a struct and then call a method on the result. For example:
I can but my reference is not null before callin
On Saturday, 9 March 2019 at 21:00:51 UTC, Ali Çehreli wrote:
I haven't run the code but which pointer is null? Try adding
I mean `this` by "this" word. You can see that `this` is null if
you run gdb and before that line make `p/x this` [0]
this check as well:
auto node = this.list.getFisrtF
On Saturday, 9 March 2019 at 19:40:27 UTC, Sebastiaan Koppe wrote:
On Saturday, 9 March 2019 at 17:14:37 UTC, 9il wrote:
It was fixed to be used in BetterC. If it still does not work
you can open an issue and ping me (@9il).
That is awesome. I suppose support for betterC is only from v3
upwar
20 matches
Mail list logo