On Monday, 11 September 2023 at 22:08:54 UTC, Christian Köstlin
wrote:
On 09.09.23 17:44, Vino wrote:
Hi All,
Request your help on how to convert the output of
std.process.pipeProcess to hash string
```
auto test(in Redirect redirect=Redirect.stdout |
Redirect.stderr) {
import std
On Mon, Sep 11, 2023 at 10:39:00PM +, Salih Dincer via Digitalmars-d-learn
wrote:
> On Monday, 11 September 2023 at 22:13:25 UTC, H. S. Teoh wrote:
> >
> > Because sometimes I want a specific type.
> >
>
> it's possible...
>
> ```d
> alias ST = Options;
> void specificType(ST option = ST()
On Monday, 11 September 2023 at 19:59:37 UTC, ryuukk_ wrote:
I would love to be able to use C style designated
initialization everywhere too..
Recent version of D added named arguments so you can do
something like:
```D
void someFunction(Options option = Options(silenceErrors:
false))
`
On Monday, 11 September 2023 at 22:13:25 UTC, H. S. Teoh wrote:
Because sometimes I want a specific type.
it's possible...
```d
alias ST = Options;
void specificType(ST option = ST())
{
if(option)
{
assert(false);
} else
assert(true);
}
void main()
{
specificType(); // No er
On Mon, Sep 11, 2023 at 10:05:11PM +, Salih Dincer via Digitalmars-d-learn
wrote:
> On Monday, 11 September 2023 at 20:17:09 UTC, H. S. Teoh wrote:
> >
> > Someone should seriously come up with a way of eliminating the
> > repeated type name in default parameters.
>
> Why not allow it to be
On 09.09.23 17:44, Vino wrote:
Hi All,
Request your help on how to convert the output of
std.process.pipeProcess to hash string
```
auto test(in Redirect redirect=Redirect.stdout | Redirect.stderr) {
import std.process;
import std.digest.crc;
import std.stdio: writeln;
On Monday, 11 September 2023 at 20:17:09 UTC, H. S. Teoh wrote:
Someone should seriously come up with a way of eliminating the
repeated type name in default parameters.
Why not allow it to be flexible enough by using a template
parameter?
```d
enum Options : bool
{
silenceErrorsOff, sile
On Mon, Sep 11, 2023 at 07:59:37PM +, ryuukk_ via Digitalmars-d-learn wrote:
[...]
> Recent version of D added named arguments so you can do something
> like:
>
> ```D
> void someFunction(Options option = Options(silenceErrors: false))
> ```
>
> I don't like the useless repeating "option opti
On Monday, 11 September 2023 at 17:51:04 UTC, BoQsc wrote:
https://docarchives.dlang.io/v2.073.0/spec/struct.html#struct-literal
I would like to set function's default struct for a function in
a way that it would be visible for the reader to see what
options are set. Something like `Options op
On Monday, 11 September 2023 at 17:51:04 UTC, BoQsc wrote:
Here is an example of what I would hope for to work but it
surely does not work:
If I were you I would use enum, look at my code:
```d
enum Options
{
silenceErrors = false
}
void someFunction (Options option = Options.silenceError
https://docarchives.dlang.io/v2.073.0/spec/struct.html#struct-literal
I would like to set function's default struct for a function in a
way that it would be visible for the reader to see what options
are set. Something like `Options option = {silenceErrors: false}`
Here is an example of what
11 matches
Mail list logo