On Wednesday, 23 March 2022 at 00:51:42 UTC, Era Scarecrow wrote:
On Tuesday, 22 March 2022 at 21:23:43 UTC, H. S. Teoh wrote:
We already have this:
import std.conv : to;
int x;
long y;
y = x.to!long; // equivalent to straight assignment / cast
x =
On Tuesday, 22 March 2022 at 21:23:43 UTC, H. S. Teoh wrote:
On Tue, Mar 22, 2022 at 09:11 PM, Era Scarecrow wrote:
[...]
I'd almost wish D had a more lenient mode and would do
automatic down-casting, then complain if it *would* have
failed to downcast data at runtime.
[...]
We already
On Tue, Mar 22, 2022 at 09:11:00PM +, Era Scarecrow via Digitalmars-d-learn
wrote:
[...]
> I'd almost wish D had a more lenient mode and would do automatic
> down-casting, then complain if it *would* have failed to downcast data
> at runtime.
[...]
We already have this:
import
On Tuesday, 22 March 2022 at 18:47:19 UTC, Ali Çehreli wrote:
On 3/22/22 11:28, Era Scarecrow wrote:
> So when should you use size_t?
I use size_t for anything that is related to count, index, etc.
However, this is a contested topic because size_t is unsigned.
I don't see a problem with
On Tue, Mar 22, 2022 at 05:36:13PM +, IGotD- via Digitalmars-d-learn wrote:
> On Friday, 18 March 2022 at 18:16:51 UTC, Ali Çehreli wrote:
> >
> > The first time I learned about pulling in dependencies terrified me.
[...]
> >
On 3/22/22 11:28, Era Scarecrow wrote:
> So when should you use size_t?
I use size_t for anything that is related to count, index, etc. However,
this is a contested topic because size_t is unsigned. As soon as you use
it in an expression, the whole expression becomes unsigned as well.
On Friday, 18 March 2022 at 23:01:05 UTC, Ali Çehreli wrote:
P.S. On a related note, I used to make the mistake of using
size_t for file offsets as well. That is a mistake because even
on a 32-bit system (or build), file sizes can be larger than
uint.max. So, the correct type is long for
On Friday, 18 March 2022 at 18:16:51 UTC, Ali Çehreli wrote:
The first time I learned about pulling in dependencies
terrified me. (This is the part I realize I am very different
from most other programmers.) I am still terrified that my
dependency system will pull in a tree of code that I
On Tuesday, 22 March 2022 at 14:44:59 UTC, Marcone wrote:
Why is dmd unable to import modules installed by dub using the
import command like it does with the Phobos library? He can't
send these modules to Linker? Needing to be passed to dmd via
command line. I think it could be all automatic.
On Tue, Mar 22, 2022 at 07:09:07AM +, cc via Digitalmars-d-learn wrote:
> Sorry for the fairly lengthy post. I'm wondering if there are any
> suggested good practices in place for calling templated functions
> using the runtime type of an object, e.g. what `typeid(object)`
> returns.
[[...]
On Tuesday, 22 March 2022 at 14:44:59 UTC, Marcone wrote:
Why is dmd unable to import modules installed by dub using the
import command like it does with the Phobos library? He can't
send these modules to Linker? Needing to be passed to dmd via
command line. I think it could be all automatic.
/*
Direct DropBear Dlang Injector.
Created by Marcone (thegrapev...@email.com) in 2019.
*/
import std;
import core.thread;
import core.stdc.stdlib;
// Configuracoes.
string LISTEN_PORT = "127.0.0.1:8088";
string PAYLOAD = "GET / HTTP/1.1\r\nhost: www.bing.com\r\n\r\n";
Why is dmd unable to import modules installed by dub using the
import command like it does with the Phobos library? He can't
send these modules to Linker? Needing to be passed to dmd via
command line. I think it could be all automatic.
On Tuesday, 22 March 2022 at 07:18:00 UTC, cc wrote:
On Sunday, 20 March 2022 at 09:42:44 UTC, Caten wrote:
Hi, I also need a function to "unquote" string, like this:
```d
assert(unquote(`\n`)=="\n");
```
Is there a way to do that?
I rolled my own for that recently:
```d
string dequote(string
On Sunday, 20 March 2022 at 09:42:44 UTC, Caten wrote:
Hi, I also need a function to "unquote" string, like this:
```d
assert(unquote(`\n`)=="\n");
```
Is there a way to do that?
I rolled my own for that recently:
```d
string dequote(string str) @safe pure {
if (str.length < 2)
Sorry for the fairly lengthy post. I'm wondering if there are
any suggested good practices in place for calling templated
functions using the runtime type of an object, e.g. what
`typeid(object)` returns.
Consider the following situation:
```d
class Person {
string name;
int
16 matches
Mail list logo