On Tuesday, 21 April 2020 at 21:36:57 UTC, Marcone wrote:
When I create a module, for exemple mymodule.d and import im my
main program using "import mymodule" I need add mymodule.d in
DMD command line manually. How can make it automatic?
dmd -i
On 4/21/20 5:24 PM, Jean-Louis Leroy wrote:
I would like to combine them all, e.g.:
alias sst(T) = SS!T.f;
int d = sst(42); // <=> SS!int.f(42)
But it fails like this:
aliasstaticfunction.d(23): Error: template
`aliasstaticfunction.sst` cannot deduce function from argument typ
When I create a module, for exemple mymodule.d and import im my
main program using "import mymodule" I need add mymodule.d in DMD
command line manually. How can make it automatic?
On Tuesday, 21 April 2020 at 16:30:15 UTC, Russel Winder wrote:
On Mon, 2020-04-20 at 20:19 +, aliak via
Digitalmars-d-learn wrote:
[…]
[0]: https://github.com/aliak00/optional
Rust has Option and Result, and most languages are rapidly
introducing at least Option if not Result – and y
I can alias a function template:
T f(T)(T x) { return x; }
alias g = f;
int a = g(42);
I can alias a static function:
struct S
{
static int f(int i) { return i; }
}
alias sf = S.f;
int b = sf(42);
I can alias to a static function in a template instance:
On 2020-04-21 22:10, Steven Schveighoffer wrote:
On 4/21/20 3:47 PM, Faux Amis wrote:
I'm dumbfounded, why does the following code write '35' on DMD32 D
Compiler v2.091.0-dirty?
module magic;
float magic( float f )
{
return f + 35f - f;
}
void main()
{
import std.stdio;
writel
On 4/21/20 3:47 PM, Faux Amis wrote:
I'm dumbfounded, why does the following code write '35' on DMD32 D
Compiler v2.091.0-dirty?
module magic;
float magic( float f )
{
return f + 35f - f;
}
void main()
{
import std.stdio;
writeln( magic(1_000_000_000f) );
}
On run.dlang.io, i
On 4/21/20 2:09 PM, tsbockman wrote:
conversely what is the right way of going the other way:
cast(ZoneNumber)1
to!ZoneNumber(1)
Use `to` except where you can gaurantee that the input value maps to a
valid enum member, because `cast` does not check your work:
writeln(cast(ZoneNumber)17
On 4/21/20 3:00 PM, Russel Winder wrote:
On Tue, 2020-04-21 at 12:59 -0400, Steven Schveighoffer via
Digitalmars-d-learn wrote:
On 4/21/20 12:03 PM, Russel Winder wrote:
Hi,
Given an enum:
enum ZoneNumber {
One = 1,
Two = 2,
}
then which of these is the right way of accessing the
I'm dumbfounded, why does the following code write '35' on DMD32 D
Compiler v2.091.0-dirty?
module magic;
float magic( float f )
{
return f + 35f - f;
}
void main()
{
import std.stdio;
writeln( magic(1_000_000_000f) );
}
On Tue, 2020-04-21 at 18:09 +, tsbockman via Digitalmars-d-learn
wrote:
> On Tuesday, 21 April 2020 at 16:03:20 UTC, Russel Winder wrote:
> > then which of these is the right way of accessing the value?
> >
> > cast(ubyte)ZoneNumber.One
> > to!ubyte(ZoneNumber.One)
>
> Either is acceptable be
On Tuesday, 21 April 2020 at 16:30:15 UTC, Russel Winder wrote:
On Mon, 2020-04-20 at 20:19 +, aliak via
Digitalmars-d-learn wrote:
[…]
[0]: https://github.com/aliak00/optional
Rust has Option and Result, and most languages are rapidly
introducing at least Option if not Result – and y
On Tue, 2020-04-21 at 12:59 -0400, Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 4/21/20 12:03 PM, Russel Winder wrote:
> > Hi,
> >
> > Given an enum:
> >
> > enum ZoneNumber {
> > One = 1,
> > Two = 2,
> > }
> >
> > then which of these is the right way of accessing the valu
On Tuesday, 21 April 2020 at 17:50:03 UTC, Andre Pany wrote:
On Tuesday, 21 April 2020 at 16:14:54 UTC, Selim wrote:
Hi there. I have been using dub for a while now -maybe 12
months- but I haven't been able to figure out if you can build
multiple app.d files with it. Is it possible to use dub r
On Tuesday, 21 April 2020 at 16:03:20 UTC, Russel Winder wrote:
then which of these is the right way of accessing the value?
cast(ubyte)ZoneNumber.One
to!ubyte(ZoneNumber.One)
Either is acceptable because there is no way that this operation
can fail. Using a naked `cast` makes less work for t
On Tuesday, 21 April 2020 at 16:14:54 UTC, Selim wrote:
Hi there. I have been using dub for a while now -maybe 12
months- but I haven't been able to figure out if you can build
multiple app.d files with it. Is it possible to use dub run
command to build multiple executables in one shot?
Maybe
On 4/21/20 12:03 PM, Russel Winder wrote:
Hi,
Given an enum:
enum ZoneNumber {
One = 1,
Two = 2,
}
then which of these is the right way of accessing the value?
cast(ubyte)ZoneNumber.One
to!ubyte(ZoneNumber.One)
I generally do this:
ubyte(ZoneNumber.One)
conversely what is the
On Mon, 2020-04-20 at 20:19 +, aliak via Digitalmars-d-learn wrote:
>
> […]
> [0]: https://github.com/aliak00/optional
Rust has Option and Result, and most languages are rapidly introducing
at least Option if not Result – and yes it is almost certain all this
comes from Haskell.
Is Option i
Hi there. I have been using dub for a while now -maybe 12 months-
but I haven't been able to figure out if you can build multiple
app.d files with it. Is it possible to use dub run command to
build multiple executables in one shot?
Maybe the question is weird, because dub might not be the tool
Hi,
Given an enum:
enum ZoneNumber {
One = 1,
Two = 2,
}
then which of these is the right way of accessing the value?
cast(ubyte)ZoneNumber.One
to!ubyte(ZoneNumber.One)
conversely what is the right way of going the other way:
cast(ZoneNumber)1
to!ZoneNumber(1)
I tried:
enum ZoneNumb
20 matches
Mail list logo