On Tuesday, 15 September 2020 at 02:23:31 UTC, Paul Backus wrote:
On Tuesday, 15 September 2020 at 01:49:13 UTC, James Blachly
wrote:
I wish to write a function including ∂x and ∂y (these are
trivial to type with appropriate keyboard shortcuts - alt+d on
Mac), but without a unicode byte order m
On Mon, Sep 14, 2020 at 09:49:13PM -0400, James Blachly via Digitalmars-d-learn
wrote:
> I wish to write a function including ∂x and ∂y (these are trivial to
> type with appropriate keyboard shortcuts - alt+d on Mac), but without
> a unicode byte order mark at the beginning of the file, the lexer
On Tuesday, 15 September 2020 at 01:49:13 UTC, James Blachly
wrote:
I wish to write a function including ∂x and ∂y (these are
trivial to type with appropriate keyboard shortcuts - alt+d on
Mac), but without a unicode byte order mark at the beginning of
the file, the lexer rejects the tokens.
I wish to write a function including ∂x and ∂y (these are trivial to
type with appropriate keyboard shortcuts - alt+d on Mac), but without a
unicode byte order mark at the beginning of the file, the lexer rejects
the tokens.
It is not apparently easy to insert such marks (AFAICT no common tool
On Monday, 14 September 2020 at 18:58:44 UTC, 60rntogo wrote:
On Monday, 14 September 2020 at 17:11:59 UTC, k2aj wrote:
AFAIK the only way to have default ref arguments is to use a
global variable:
---
extern(C++) struct Foo
{
int x;
}
immutable foo1 = Foo(1);
extern(C++) void fun(const ref F
On Monday, 14 September 2020 at 17:11:59 UTC, k2aj wrote:
AFAIK the only way to have default ref arguments is to use a
global variable:
---
extern(C++) struct Foo
{
int x;
}
immutable foo1 = Foo(1);
extern(C++) void fun(const ref Foo foo = foo1);
---
Thanks. This appears to work, but feels l
On Monday, 14 September 2020 at 12:44:34 UTC, 60rntogo wrote:
I'm trying to use a C++ library that has a function declared
like this:
---
struct Foo
{
int x;
};
void fun(const Foo& foo = Foo(1));
---
I have translated this to a D declaration:
---
struct Foo
{
int x;
}
extern(C++) void f
On Monday, 14 September 2020 at 16:44:14 UTC, Adam D. Ruppe wrote:
This is a common mistake with people coming from C++. A D class
is more like a Java class - it is automatically a reference.
So your class Bob here in D would actually be represented as
`Bob*` in C++.
Thus when you define `B
On Monday, 14 September 2020 at 16:29:11 UTC, Fitz wrote:
I expect the following code below to create 10 items with 10
different addresses, instead they all have the same address?
You are taking the address of the local variable holding
reference, not the reference itself.
class Bob {
}
Bo
I expect the following code below to create 10 items with 10
different addresses, instead they all have the same address?
import std.stdio;
class Bob {
}
void main()
{
for (auto i = 0; i < 10; i++) {
auto pBob = bobFactory();
writefln("bob @ %x\n", pBob);
}
}
Bob *bobF
On Monday, 14 September 2020 at 09:50:16 UTC, Christoph wrote:
Hi Ilya,
On Sunday, 13 September 2020 at 19:29:31 UTC, 9il wrote:
[...]
I have tested it with dmd and ldc and called them just with
$ dub build --compiler=ldc(dmd)
with no more configurations in the dub.json file.
[...]
On Mond
On Monday, 14 September 2020 at 12:44:34 UTC, 60rntogo wrote:
---
struct Foo
{
int x;
}
extern(C++) void fun(const ref Foo foo = Foo(1));
---
I suppose this should have been:
---
extern(C++):
struct Foo
{
int x;
}
void fun(const ref Foo foo = Foo(1));
---
Not that it changes the questi
I'm trying to use a C++ library that has a function declared like
this:
---
struct Foo
{
int x;
};
void fun(const Foo& foo = Foo(1));
---
I have translated this to a D declaration:
---
struct Foo
{
int x;
}
extern(C++) void fun(const ref Foo foo = Foo(1));
---
This yields an error: "Foo
On Monday, 14 September 2020 at 09:08:01 UTC, Seb wrote:
You likely want to get involved / raise your support here:
https://github.com/dlang/phobos/pull/7600
Oh this is great, thank you!
On 9/14/20 2:25 AM, Simen Kjærås wrote:
On Monday, 14 September 2020 at 03:48:51 UTC, Steven Schveighoffer wrote:
Consider the enum:
enum Foo { a, b }
Foo.a.stringof => "a"
enum x = Foo.a;
x.stringof => "cast(Foo)0"
Is there another way I can take an enum value that's known at compile
time (
Hi Ilya,
On Sunday, 13 September 2020 at 19:29:31 UTC, 9il wrote:
More details are required. What compiler and command line has
been used?
I have tested it with dmd and ldc and called them just with
$ dub build --compiler=ldc(dmd)
with no more configurations in the dub.json file.
I have compa
On Monday, 14 September 2020 at 07:49:31 UTC, Andrej Mitrovic
wrote:
-
import std.range;
import std.stdio;
void main ()
{
auto range = sequence!((a, n) => n);
// works, but the chunks are all the same length
auto rngs = range.chunks(4);
writeln(rngs[0]);
writeln(rngs[1])
-
import std.range;
import std.stdio;
void main ()
{
auto range = sequence!((a, n) => n);
// works, but the chunks are all the same length
auto rngs = range.chunks(4);
writeln(rngs[0]);
writeln(rngs[1]);
writeln(rngs[2]);
// want this
auto ranges = range.???(
18 matches
Mail list logo