On Monday, February 25, 2019 5:07:54 PM MST Victor Porton via Digitalmars-d-
learn wrote:
> I want to create a string mixin based on a supplementary variable
> (name2 below):
>
> Let we have something like:
>
> mixin template X(string name) {
>immutable string name2 = '_' ~ name;
>
On Monday, February 25, 2019 5:47:47 AM MST Simen Kjærås via Digitalmars-d-
learn wrote:
> On Monday, 25 February 2019 at 12:37:31 UTC, Vladimirs Nordholm
>
> wrote:
> > Hello.
> >
> > I wish to sort an array by calling a template function on a
> > struct. In essence I want to do
> >
> >
On Sunday, February 24, 2019 7:49:36 PM MST James Blachly via Digitalmars-d-
learn wrote:
> Any ideas why DMD2 cannot inline this, but LDC2 has no problem doing so
> -- or suggestions for what I can do to make DMD2 inline it?
The unfortunate reality of the matter is that dmd's inliner is very
On Sunday, February 24, 2019 5:42:32 AM MST Dennis via Digitalmars-d-learn
wrote:
> On Sunday, 24 February 2019 at 10:53:09 UTC, aliak wrote:
> > But the following code is very recoverable and I don't see how
>
> > it's unsafe to continue executing:
> There is no guarantee that a final switch
On Friday, February 15, 2019 3:06:34 AM MST Kagamin via Digitalmars-d-learn
wrote:
> Union is just a pretty cast, type system guarantees don't hold
> for it.
Well, technically, what's supposed to be the case is that when you cast, the
type system guarantees still hold but it's up to the
On Thursday, February 14, 2019 11:59:31 PM MST Stefan Koch via Digitalmars-
d-learn wrote:
> On Thursday, 14 February 2019 at 23:55:18 UTC, SimonN wrote:
> > std.typecons.Rebindable!(immutable A) is implemented as:
> > private union {
> >
> > immutable(A) original;
> > A
On Tuesday, February 12, 2019 4:45:43 AM MST Jacob Carlborg via Digitalmars-
d-learn wrote:
> On 2019-02-10 18:20, Jonathan M Davis wrote:
> > I use (g)vim, which I would expect to show anything like trailing
> > newlines. It usually shows everything, including rendering control
> > characters and
On Monday, February 11, 2019 3:23:25 AM MST Seb via Digitalmars-d-learn
wrote:
> On Monday, 11 February 2019 at 09:29:13 UTC, Jonathan M Davis
>
> wrote:
> > On Sunday, February 10, 2019 1:04:29 PM MST Per Nordlöw via
> >
> > Digitalmars-d- learn wrote:
> >> [...]
> >
> > A quick grep of Phobos
On Sunday, February 10, 2019 1:04:29 PM MST Per Nordlöw via Digitalmars-d-
learn wrote:
> Is there a way to query if the -dip1000 flag has been passed to
> the compiler? I need it for enabling certain DIP-1000 escape
> analysis tests only when -dip1000 has been passed.
>
> For instance
>
>
On Sunday, February 10, 2019 5:19:02 PM MST kdevel via Digitalmars-d-learn
wrote:
> I am trying to get this code compiled:
>
> ```TemplateStore.d
> module TemplateStore;
> import std.path;
> import std.conv;
> import std.file;
>
> immutable string[string] template_map;
>
> static this ()
> {
>
On Sunday, February 10, 2019 2:06:50 AM MST Cym13 via Digitalmars-d-learn
wrote:
> On Sunday, 10 February 2019 at 02:12:43 UTC, Jonathan M Davis
>
> wrote:
> > On Saturday, February 9, 2019 2:19:27 PM MST Victor Porton via
> >
> > Digitalmars- d-learn wrote:
> >> ISO C++ specifies that the C++
On Saturday, February 9, 2019 2:19:27 PM MST Victor Porton via Digitalmars-
d-learn wrote:
> ISO C++ specifies that the C++ file must end with a newline.
>
> Should D file end with newline, too?
No, there is no need to end D files with a newline. I would guess that the
vast majority of D files
On Friday, February 8, 2019 4:27:44 AM MST Eduard Staniloiu via Digitalmars-
d-learn wrote:
> On Friday, 8 February 2019 at 06:55:15 UTC, Jerry wrote:
> > On Friday, 8 February 2019 at 04:51:08 UTC, Sudhi wrote:
> >> On Friday, 8 February 2019 at 04:30:23 UTC, Arun
> >>
> >> Chandrasekaran wrote:
On Sunday, February 3, 2019 2:41:48 AM MST Ron Tarrant via Digitalmars-d-
learn wrote:
> On Saturday, 2 February 2019 at 19:40:25 UTC, Andre Pany wrote:
> > https://rosettacode.org/wiki/Singleton#D
>
> Do you know if this is for a current version of D? The compiler
> is choking on the import
On Monday, January 28, 2019 10:41:55 PM MST Meta via Digitalmars-d-learn
wrote:
> On Monday, 28 January 2019 at 22:17:56 UTC, Steven Schveighoffer
>
> wrote:
> > On 1/28/19 3:28 PM, Jonathan Levi wrote:
> >> On Sunday, 27 January 2019 at 09:31:46 UTC, bauss wrote:
> >>> On Sunday, 27 January 2019
On Wednesday, January 23, 2019 8:19:06 AM MST Jacob Shtokolov via
Digitalmars-d-learn wrote:
> Hi,
>
> I'm trying to check whether it's possible to implement Python's
> SQLAlchemy-like query syntax in D, but I get stuck a bit.
>
> Here is a simple example of what I want to achieve:
>
> ```
> auto
On Wednesday, January 23, 2019 5:42:55 AM MST FrankLike via Digitalmars-d-
learn wrote:
> On Wednesday, 23 January 2019 at 10:44:51 UTC, Jonathan M Davis
>
> wrote:
> > On Tuesday, January 22, 2019 2:49:00 PM MST bauss via
> > Digitalmars-d-learn wrote:
> >
> > toUTFz is the generic solution.
On Tuesday, January 22, 2019 2:49:00 PM MST bauss via Digitalmars-d-learn
wrote:
> On Tuesday, 22 January 2019 at 19:14:43 UTC, Jonathan M Davis
>
> wrote:
> > On Tuesday, January 22, 2019 12:05:32 PM MST Stefan Koch via
> >
> > Digitalmars-d- learn wrote:
> >> On Tuesday, 22 January 2019 at
On Tuesday, January 22, 2019 12:05:32 PM MST Stefan Koch via Digitalmars-d-
learn wrote:
> On Tuesday, 22 January 2019 at 16:47:45 UTC, FrankLike wrote:
> > On Tuesday, 22 January 2019 at 16:18:17 UTC, Adam D. Ruppe
> >
> > wrote:
> >> Use "mystring"w, notice the w after the closing quote.
> >
> >
On Monday, January 21, 2019 10:08:23 AM MST Johan Engelen via Digitalmars-d-
learn wrote:
> On Saturday, 19 January 2019 at 17:45:41 UTC, Patrick Schluter
>
> wrote:
> > Afaict NULL pointer derefernecing must fault for D to be
> > "usable". At least all code is written with that assumption.
>
>
On Saturday, January 19, 2019 10:45:41 AM MST Patrick Schluter via
Digitalmars-d-learn wrote:
> On Saturday, 19 January 2019 at 12:54:28 UTC, rikki cattermole
>
> wrote:
> > On 20/01/2019 1:38 AM, Edgar Vivar wrote:
> >> Hi,
> >>
> >> I have a project aiming to old 68K processor. While I don't
>
On Friday, January 18, 2019 8:34:22 AM MST Michael via Digitalmars-d-learn
wrote:
> On Friday, 18 January 2019 at 13:29:29 UTC, Adam D. Ruppe wrote:
> > On Friday, 18 January 2019 at 12:27:17 UTC, Michael wrote:
> >> This, to be, looks like quite the explicit conversion, no?
> >
> > Yeah, I
On Friday, January 18, 2019 8:08:47 AM MST Kagamin via Digitalmars-d-learn
wrote:
> On Friday, 18 January 2019 at 00:08:00 UTC, 1001Days wrote:
> > It works, but I have two questions regarding its efficacy: is
> > it viable in the long run, and is it now possible to use
> > delegates without the
On Thursday, January 17, 2019 1:21:41 AM MST Dukc via Digitalmars-d-learn
wrote:
> On Thursday, 17 January 2019 at 02:27:20 UTC, Neia Neutuladh
>
> wrote:
> > 1. Make a wrapper class. Now you can store Object[], or you can
> > make a
> > base class or base interface and use that.
> > 2. Use
On Friday, January 4, 2019 4:50:30 AM MST Jacob Shtokolov via Digitalmars-d-
learn wrote:
> On Friday, 4 January 2019 at 11:41:59 UTC, Simen Kjærås wrote:
> > The thing is, compile-time tests like static if and static
> > assert can only test values that are known at compile-time, and
> > are for
On Thursday, January 3, 2019 3:28:35 AM MST Nordlöw via Digitalmars-d-learn
wrote:
> How does DIP 1000 treat the lifetime scoped class parameters and
> containers of classes?
scope isn't transitive, and putting an object inside a container would be
escaping it, which would violate scope. So, you
On Tuesday, December 25, 2018 7:27:39 AM MST Per Nordlöw via Digitalmars-d-
learn wrote:
> On Tuesday, 25 December 2018 at 00:32:55 UTC, Paul Backus wrote:
> > No, because equality comparison between classes lowers to
> > `object.opEquals` [1], which takes both parameters as `Object`.
>
> This is
On Wednesday, December 19, 2018 1:19:42 AM MST rikki cattermole via
Digitalmars-d-learn wrote:
> On 19/12/2018 7:11 PM, Jonathan M Davis wrote:
> > Really? I would have thought that that would be a pretty obvious
> > optimization (especially if inlining is enabled).
>
> Assembly doesn't lie.
I'm
On Tuesday, December 18, 2018 9:20:11 AM MST berni via Digitalmars-d-learn
wrote:
> On Tuesday, 18 December 2018 at 14:32:29 UTC, Adam D. Ruppe wrote:
> > CTFE is used if and only if it MUST be used by context. That's
> > a runtime function, so no ctfe.
> >
> > Do something like:
> >
> > int[4]
On Tuesday, December 18, 2018 5:42:12 AM MST rikki cattermole via
Digitalmars-d-learn wrote:
> On 19/12/2018 1:34 AM, Per Nordlöw wrote:
> > On Tuesday, 18 December 2018 at 10:42:51 UTC, Jonathan M Davis wrote:
> >> Unfortunately, D does not currently have a way to do that. Only
> >> functions
On Tuesday, December 18, 2018 3:14:50 AM MST Per Nordlöw via Digitalmars-d-
learn wrote:
> What's the preferred way of creating a temporary @trusted scope
> without writing a separate function?
>
> Similar to Rust's
>
> unsafe { /* unsafe stuff here */ }
Unfortunately, D does not currently have
On Sunday, December 16, 2018 12:53:43 PM MST Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 12/15/18 5:14 PM, Jonathan M Davis wrote:
> > On Saturday, December 15, 2018 10:27:36 AM MST Neia Neutuladh via
> >
> > Digitalmars-d-learn wrote:
> >> On Sat, 15 Dec 2018 17:19:05 +, Timoses
On Saturday, December 15, 2018 10:27:36 AM MST Neia Neutuladh via
Digitalmars-d-learn wrote:
> On Sat, 15 Dec 2018 17:19:05 +, Timoses wrote:
> > Running `dub test` will output:
> > Running ./unit-test-library writeln: unittest All unit tests have been
> > run successfully.
> >
> > Why is the
On Thursday, December 13, 2018 6:56:33 PM MST Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 12/13/18 7:16 PM, Michelle Long wrote:
> > I've noticed the compiler is not throwing up errors and warnings like it
> > used to:
> >
> > I thought D required breaks for cases? Seems it doesn't
On Tuesday, December 11, 2018 2:11:49 PM MST H. S. Teoh via Digitalmars-d-
learn wrote:
> On Tue, Dec 11, 2018 at 09:02:41PM +, bauss via Digitalmars-d-learn
wrote:
> > On Tuesday, 11 December 2018 at 18:10:48 UTC, H. S. Teoh wrote:
> [...]
>
> > > Autodecoding raises its ugly head again. :-/
On Friday, December 7, 2018 8:46:11 PM MST Adam D. Ruppe via Digitalmars-d-
learn wrote:
> On Saturday, 8 December 2018 at 03:37:56 UTC, Murilo wrote:
> > Hi guys, I have created an array of strings with "string[12] ps
>
> string[12] isn't a range, but string[] is.
>
> Try passing `ps[]` to the
On Friday, December 7, 2018 2:42:33 PM MST Samir via Digitalmars-d-learn
wrote:
> Ok. Upon further investigation, I think I see what is going on.
> Most of the repos I am skimming are for this year's Advent of
> Code. They structure their repo with an `app.d` file which does
> contain a `main`
On Friday, December 7, 2018 2:02:59 PM MST Samir via Digitalmars-d-learn
wrote:
> Is it possible to write and execute a D program without a main
> function?
>
> Most of my programs will start with some `import` statements,
> followed by any functions and then ending with the `main`
> function
On Tuesday, December 4, 2018 3:17:04 PM MST jmh530 via Digitalmars-d-learn
wrote:
> I've noticed that I can use int like a constructor, as in:
> int x = int(1);
> but I can't do the same thing with slices
> int[] y = int[]([1, 2]);
>
> Is there something I'm missing here or is this a
On Monday, December 3, 2018 1:07:24 PM MST Goksan via Digitalmars-d-learn
wrote:
> Are there any differences between these 2 methods of copying
> elements?
>
> double[] array = [ 1, 20, 2, 30, 7, 11 ];
>
> // Non dup
> double[6] bracket_syntax_dup = array;
> bracket_syntax_dup[] = array;
>
On Friday, November 30, 2018 2:43:41 AM MST welkam via Digitalmars-d-learn
wrote:
> On Friday, 30 November 2018 at 04:47:26 UTC, Andrew Pennebaker
>
> wrote:
> > gcc is currently required for dmd on FreeBSD, as dmd links to
> > libstdc++.
>
> Parts of dmd are still written in C++ but most of it
On Saturday, November 24, 2018 10:41:56 PM MST H. S. Teoh via Digitalmars-d-
learn wrote:
> On Sat, Nov 24, 2018 at 05:48:16PM +, Stanislav Blinov via
Digitalmars-d-learn wrote:
> > On Saturday, 24 November 2018 at 17:43:35 UTC, Jonathan M Davis wrote:
> > > I'm still inclined to think though
On Saturday, November 24, 2018 9:28:47 AM MST Stanislav Blinov via
Digitalmars-d-learn wrote:
> On Saturday, 24 November 2018 at 07:00:31 UTC, Jonathan M Davis
>
> wrote:
> > [not legal]
> >
> > enum Foo
> > {
> >
> > a,
> > b,
> > version(linux) c = 42,
> > else version(Windows)
On Friday, November 23, 2018 11:22:24 PM MST Neia Neutuladh via Digitalmars-
d-learn wrote:
> On Fri, 23 Nov 2018 21:43:01 -0700, Jonathan M Davis wrote:
> > A solution like that might work reasonably well, but you still
> > have the problem of what to do when a symbol is documented in multiple
>
On Friday, November 23, 2018 11:13:24 AM MST H. S. Teoh via Digitalmars-d-
learn wrote:
> All in all, though, the fact that we're complaining about extra seconds
> in compilation times still does show just how fast D compilation can be.
> In the old days, compiling large C++ codebases usually
On Friday, November 23, 2018 7:55:04 PM MST H. S. Teoh via Digitalmars-d-
learn wrote:
> Adam does have a very good point about showing all alternatives to docs,
> though. Arguably, that's what ddoc *should* do. If the programmer
> wrote a ddoc comment in the code, it probably should be
On Friday, November 23, 2018 2:47:51 PM MST Tony via Digitalmars-d-learn
wrote:
> In std.compiler there is this code:
>
> /// Which vendor produced this compiler.
> version(StdDdoc) Vendor vendor;
> else version(DigitalMars) Vendor vendor = Vendor.digitalMars;
> else
On Wednesday, November 21, 2018 3:24:06 PM MST Johan Engelen via
Digitalmars-d-learn wrote:
> On Wednesday, 21 November 2018 at 07:47:14 UTC, Jonathan M Davis
>
> wrote:
> > IMHO, requiring something in the spec like "it must segfault
> > when dereferencing null" as has been suggested before is
>
On Tuesday, November 20, 2018 11:04:08 AM MST Johan Engelen via Digitalmars-
d-learn wrote:
> On Tuesday, 20 November 2018 at 03:38:14 UTC, Jonathan M Davis
>
> wrote:
> > For @safe to function properly, dereferencing null _must_ be
> > guaranteed to be memory safe, and for dmd it is, since it
On Tuesday, November 20, 2018 8:38:40 AM MST Kagamin via Digitalmars-d-learn
wrote:
> On Monday, 19 November 2018 at 21:23:31 UTC, Jordi Gutiérrez
>
> Hermoso wrote:
> > When I was first playing with D, I managed to create a segfault
> > by doing `SomeClass c;` and then trying do something with
On Monday, November 19, 2018 5:30:00 PM MST Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 11/19/18 7:21 PM, Jordi Gutiérrez Hermoso wrote:
> > On Monday, 19 November 2018 at 21:52:47 UTC, Steven Schveighoffer wrote:
> >> A null pointer dereference is an immediate error, and it's also a
On Saturday, November 17, 2018 11:09:51 PM MST Carl Sturtivant via
Digitalmars-d-learn wrote:
> On Thursday, 15 November 2018 at 19:01:45 UTC, Ali Çehreli wrote:
> > On 11/15/2018 09:14 AM, Carl Sturtivant wrote:
> > > opDispatch is special in that it allows for functions to be
> >
> > added to a
On Wednesday, November 14, 2018 2:54:27 AM MST realhet via Digitalmars-d-
learn wrote:
> Hi,
>
> Just a little weird thing I noticed and don't know why it is:
>
> I have a FilePath struct and I wanted to make it work with the
> "~" operator and an additional string.
>
> So I've created a global
On Saturday, November 10, 2018 7:51:36 PM MST Adam D. Ruppe via Digitalmars-
d-learn wrote:
> On Saturday, 10 November 2018 at 23:29:12 UTC, Jonathan M Davis
>
> wrote:
> > The fact that they got added to ddoc just further degrades it
> > as a proper, macro-based markup language.
>
> The backticks
On Saturday, November 10, 2018 6:53:14 AM MST Kagamin via Digitalmars-d-
learn wrote:
> On Friday, 9 November 2018 at 09:11:37 UTC, Jonathan M Davis
>
> wrote:
> > No, I didn't. I just used underscores, which has been used with
> > plain text for emphasis for decades. Supporting markdown, would
>
On Friday, November 9, 2018 5:22:27 AM MST Vinay Sajip via Digitalmars-d-
learn wrote:
> On Friday, 9 November 2018 at 11:24:42 UTC, Jonathan M Davis
>
> wrote:
> > decode and decodeFront are for converting a UTF code unit to a
> > Unicode code point. So, you're taking UTF-8 code unit (char),
> >
On Friday, November 9, 2018 3:45:49 AM MST Vinay Sajip via Digitalmars-d-
learn wrote:
> On Friday, 9 November 2018 at 10:26:46 UTC, Dennis wrote:
> > On Friday, 9 November 2018 at 09:47:32 UTC, Vinay Sajip wrote:
> >> std.utf.decodeFront(Flag useReplacementDchar =
> >> No.useReplacementDchar,
On Friday, November 9, 2018 1:27:44 AM MST Kagamin via Digitalmars-d-learn
wrote:
> On Friday, 9 November 2018 at 06:42:37 UTC, Jonathan M Davis
>
> wrote:
> > Honestly, having markdown in messages being typical would be
> > _really_ annoying for those of us not using the web interface,
> >
On Thursday, November 8, 2018 7:25:45 PM MST Neia Neutuladh via Digitalmars-
d-learn wrote:
> It's not a forum. It's a newsgroup that happens to have a web interface.
> Newsgroups are text-only. So bbcode is out, html is out, but interpreting
> markdown might be reasonable. But nobody's done that
On Thursday, November 8, 2018 2:34:38 PM MST H. S. Teoh via Digitalmars-d-
learn wrote:
> On Thu, Nov 08, 2018 at 01:28:47PM -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> > On Thursday, November 8, 2018 10:55:45 AM MST Stanislav Blinov via
> >
> > Digi
On Thursday, November 8, 2018 10:55:45 AM MST Stanislav Blinov via
Digitalmars-d-learn wrote:
> On Thursday, 8 November 2018 at 16:13:55 UTC, Mike Parker wrote:
> > On Thursday, 8 November 2018 at 15:50:38 UTC, helxi wrote:
> >> Although it's pretty frustrating, isn't it? Now not only I
> >> have
On Thursday, November 8, 2018 2:34:34 AM MST Michelle Long via Digitalmars-
d-learn wrote:
> Obviously, but that is not the case I mentioned. You can assume
> that I know how scopes work. No need to assume everyone that
> shows two cases that you have to bring up an unrelated case as a
> potential
On Thursday, November 8, 2018 2:15:43 AM MST Codifies via Digitalmars-d-learn
wrote:
> On Thursday, 8 November 2018 at 06:01:57 UTC, Jonathan M Davis
>
> wrote:
> > On Wednesday, November 7, 2018 10:45:07 PM MST Jonathan M Davis
> >
> > via Digitalmars-d-learn wrote:
&
On Wednesday, November 7, 2018 10:50:29 PM MST Michelle Long via
Digitalmars-d-learn wrote:
> On Thursday, 8 November 2018 at 02:22:42 UTC, Jonathan M Davis
>
> wrote:
> > On Wednesday, November 7, 2018 1:03:47 PM MST Michelle Long via
> >
> > Digitalmars- d-learn wrote:
> >> Don't let their
On Wednesday, November 7, 2018 10:45:07 PM MST Jonathan M Davis via
Digitalmars-d-learn wrote:
> On Wednesday, November 7, 2018 9:28:19 PM MST Codifies via Digitalmars-d-
>
> learn wrote:
> > I noticed that opOpAsign allows you to return a value...
> >
> > this means I
On Wednesday, November 7, 2018 9:28:19 PM MST Codifies via Digitalmars-d-
learn wrote:
> I noticed that opOpAsign allows you to return a value...
>
> this means I can do this (return a node from my list class when
> adding a new node)
> ```
> anode = alist ~=
> ```
> to me this looks a little
On Wednesday, November 7, 2018 1:03:47 PM MST Michelle Long via Digitalmars-
d-learn wrote:
> Don't let their psychobabble fool you. They are wrong and you
> were right from the start.
...
> Case A:
> {
> if (true) goto X;
> int x;
> }
> X:
>
>
> Case B:
> {
> if (true) goto X;
>
On Monday, November 5, 2018 7:55:46 PM MST MatheusBN via Digitalmars-d-learn
wrote:
> On Tuesday, 6 November 2018 at 01:55:04 UTC, Jonathan M Davis
>
> wrote:
> >> And I found a bit strange that in such code, since "x" is
> >> never used, why it isn't skipped.
> >
> > It's skipped right over. The
On Monday, November 5, 2018 5:33:56 PM MST MatheusBN via Digitalmars-d-learn
wrote:
> On Tuesday, 6 November 2018 at 00:14:26 UTC, Jonathan M Davis
>
> wrote:
> > On Monday, November 5, 2018 4:54:59 PM MST MatheusBN via
> >
> > Digitalmars-d-learn wrote:
> >> Hi,
> >>
> >> I posted this in
On Monday, November 5, 2018 4:54:59 PM MST MatheusBN via Digitalmars-d-learn
wrote:
> Hi,
>
> I posted this in another thread but without any response.
>
> This code:
>
> void main(){
> goto Q;
> int x;
> Q:
> writeln("a");
> }
>
> Gives me this error: "source_file.d(4):
On Saturday, November 3, 2018 3:03:16 PM MDT Venkat via Digitalmars-d-learn
wrote:
> while (1)
> {
> FLAGS f;
> switch (*p)
> {
> case 'U':
> case 'u':
> f = FLAGS.unsigned;
> goto
On Tuesday, October 30, 2018 2:18:15 AM MDT Laurent Tréguier via
Digitalmars-d-learn wrote:
> On Monday, 29 October 2018 at 21:50:32 UTC, aliak wrote:
> > Hi, so if you have this piece of code:
> >
> > struct C {
> >
> > void f() {
> >
> > string[] others;
> > const string[] restArgs;
>
On Sunday, October 28, 2018 12:56:10 PM MDT ikod via Digitalmars-d-learn
wrote:
> On Sunday, 28 October 2018 at 18:00:06 UTC, Stanislav Blinov
>
> wrote:
> > On Sunday, 28 October 2018 at 12:38:12 UTC, ikod wrote:
> >> and object.opEquals(a,b) do not inherits safety from class C
> >> properties,
On Sunday, October 28, 2018 6:38:12 AM MDT ikod via Digitalmars-d-learn
wrote:
> Hello
>
> How to make this code to compile? My goal is safe(not @trusted)
> longFunction().
>
>
> ---
> class C
> {
> override bool opEquals(Object o) const @safe
> {
> return true;
> }
> }
>
On Sunday, October 28, 2018 12:17:41 PM MDT Neia Neutuladh via Digitalmars-
d-learn wrote:
> On Sun, 28 Oct 2018 18:00:06 +, Stanislav Blinov wrote:
> > On Sunday, 28 October 2018 at 12:38:12 UTC, ikod wrote:
> >> and object.opEquals(a,b) do not inherits safety from class C
> >> properties,
On Thursday, October 18, 2018 4:50:18 AM MDT Paolo Invernizzi via
Digitalmars-d-learn wrote:
> There's a rational behind the fact that there's not a 'shared'
> version of notify/wait method in Condition?
>
> Thanks,
> Paolo
The original author of the stuff in core.sync didn't want to update it
On Saturday, October 13, 2018 6:52:05 PM MDT Steven Schveighoffer via
Digitalmars-d-learn wrote:
> You can't quick-sort a list. You can merge sort it, and it's O(nlgn).
>
> I'll work on getting a sort routine into Phobos for it, but I don't know
> what the appropriate location for it is, as a
On Wednesday, October 10, 2018 4:26:40 PM MDT Chris Katko via Digitalmars-d-
learn wrote:
> On Wednesday, 10 October 2018 at 16:00:42 UTC, Steven
>
> Schveighoffer wrote:
> > On 10/10/18 9:22 AM, Chris Katko wrote:
> >> int[][] data =
> >>
> >> [
> >> [1, 0, 1, 0, 0],
> >>
On Thursday, October 4, 2018 5:44:55 AM MDT drug via Digitalmars-d-learn
wrote:
> I was incorrect with description of the problem. The problem is that
> there is no simple way to distinct types and symbols if symbols are
> private. Because private symbol is not accessible you can not get any
>
On Tuesday, October 2, 2018 3:59:28 AM MDT bauss via Digitalmars-d-learn
wrote:
> On Tuesday, 2 October 2018 at 04:13:01 UTC, Joe wrote:
> > There appears to be a problem with the example at
> >
> > https://tour.dlang.org/tour/en/gems/unittesting
> >
> > If compiled with -unittest, the resulting
On Tuesday, October 2, 2018 6:09:53 AM MDT Vinod K Chandran via Digitalmars-
d-learn wrote:
> On Tuesday, 2 October 2018 at 11:49:06 UTC, Jonathan M Davis
>
> wrote:
> > Why do you have a function for that? All you need to do is use
> > the append operator. e.g.
> >
> > x ~= value;
> >
> > -
On Tuesday, October 2, 2018 5:40:18 AM MDT Vinod K Chandran via Digitalmars-
d-learn wrote:
> Hi all,
> I have a function and i want to convert this into a template so
> that i can use this function for more than one data type.
> This is my function.
> ```D
> void ArrayAdd( ref int[] x, int value)
On Thursday, September 27, 2018 6:16:13 AM MDT Atila Neves via Digitalmars-
d-learn wrote:
> On Tuesday, 25 September 2018 at 14:13:50 UTC, Jacob Carlborg
>
> wrote:
> > On Tuesday, 25 September 2018 at 12:05:21 UTC, Jonathan M Davis
> >
> > wrote:
> >> If you use -betterC, then it's trivial,
On Thursday, September 27, 2018 2:44:25 AM MDT Chad Joan via Digitalmars-d-
learn wrote:
> The spec seems to have the homogeneous cases covered: classes
> with classes or structs with structs. What I'm more worried
> about is stuff like when you have a class compared to a struct or
> builtin
On Thursday, September 27, 2018 1:41:23 AM MDT Chad Joan via Digitalmars-d-
learn wrote:
> On Thursday, 27 September 2018 at 05:12:06 UTC, Jonathan M Davis
> This is also reminding me of how it's always bugged me that there
> isn't a way to operator overload opEquals with a static method
> (or
On Wednesday, September 26, 2018 10:20:58 PM MDT Chad Joan via Digitalmars-
d-learn wrote:
> On Wednesday, 26 September 2018 at 23:32:36 UTC, Jonathan M Davis
>
> wrote:
> > On Wednesday, September 26, 2018 3:24:07 PM MDT Adam D. Ruppe
> >
> > via Digitalmars-d-learn wrote:
> >> Object.factory
On Wednesday, September 26, 2018 3:24:07 PM MDT Adam D. Ruppe via
Digitalmars-d-learn wrote:
> Object.factory kinda sux and I'd actually like to remove it
> (among other people). There's no plan to actually do that, but
> still, just on principle I want to turn people away.
While there may not
On Tuesday, September 25, 2018 5:03:11 AM MDT John Burton via Digitalmars-d-
learn wrote:
> I need to write a library to statically link into a c program.
> Can I write this library in D?
> Will I be able to use proper D abilities like gc? Obviously the
> public interface will need to be basic c
On Tuesday, September 18, 2018 7:39:40 AM MDT Atila Neves via Digitalmars-d-
learn wrote:
> On Monday, 17 September 2018 at 19:13:06 UTC, Jonathan M Davis
>
> wrote:
> > On Monday, September 17, 2018 7:43:21 AM MDT Kagamin via
> >
> > Digitalmars-d-learn wrote:
> >> try dpp
On Monday, September 17, 2018 7:43:21 AM MDT Kagamin via Digitalmars-d-learn
wrote:
> try dpp https://github.com/atilaneves/dpp
Since according to Mike's post, it's C++ code, dpp wouldn't help, because it
currently only supports C and not C++.
- Jonathan M Davis
On Saturday, September 15, 2018 11:44:05 AM MDT Jan via Digitalmars-d-learn
wrote:
> On Thursday, 13 September 2018 at 11:08:30 UTC, Jonathan M Davis
>
> wrote:
> > [...]
>
> Thanks for clarifying Jonathan :)
> But aren't the variables considered rvalues then?
No. variables are _always_ lvalues.
On Saturday, September 15, 2018 8:45:55 AM MDT Vladimir Panteleev via
Digitalmars-d-learn wrote:
> On Friday, 14 September 2018 at 21:16:31 UTC, Jonathan M Davis
>
> wrote:
> > Yeah, though if you write cross-platform applications or
> > libraries (and ideally, most applications and libraries
On Friday, September 14, 2018 11:39:48 PM MDT berni via Digitalmars-d-learn
wrote:
> On Saturday, 15 September 2018 at 03:25:38 UTC, Paul Backus wrote:
> > On Friday, 14 September 2018 at 20:43:45 UTC, SrMordred wrote:
> >> What you want is std.range.chunks
> >>
> >>
> >> auto a =
On Friday, September 14, 2018 2:52:42 PM MDT H. S. Teoh via Digitalmars-d-
learn wrote:
> On Fri, Sep 14, 2018 at 07:05:35PM +, Basile B. via Digitalmars-d-
learn wrote:
> > On Friday, 14 September 2018 at 17:59:38 UTC, Josphe Brigmo wrote:
> > > Seems to break dirEntries when trying to deal
On Thursday, September 13, 2018 4:04:58 AM MDT Jan via Digitalmars-d-learn
wrote:
> Many thanks Adam and Steve! Works like a charm! :D
> I presumed classes are lvalues. I shouldn't make things more
> complicated than they are ;-)
Well, the variables _are_ lvalues. It's just that they're
On Wednesday, September 12, 2018 9:42:19 PM MDT James Blachly via
Digitalmars-d-learn wrote:
> Neia is right that I tried to cast as in the second case ( but
> without UFCS -- reserve( cast(int[]), N); ). As an aside, what
> is going on behind the scenes with the compiler when casting away
> a
On Wednesday, September 12, 2018 5:41:16 PM MDT James Blachly via
Digitalmars-d-learn wrote:
> When I add the "shared" attribute to an array, I am no longer
> able to call reserve because the template won't instantiate:
>
> Error: template object.reserve cannot deduce function from
> argument
On Sunday, September 9, 2018 8:30:12 AM MDT Saurabh Das via Digitalmars-d-
learn wrote:
> Thank you for explaining all this.
>
> It is frustrating because the behaviour is very counterintuitive.
>
> I will use a workaround for now.
Ranges are fantastic, and the basic concept is solid, but a
On Sunday, September 9, 2018 2:49:56 AM MDT rikki cattermole via
Digitalmars-d-learn wrote:
> On 09/09/2018 8:41 PM, Christian Mayer wrote:
> > On Sunday, 9 September 2018 at 08:14:41 UTC, rikki cattermole wrote:
> >> Are you aware that a string is just an alias of immutable(char)[]?
> >
> > Yes,
On Thursday, September 6, 2018 1:05:03 PM MDT Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 9/6/18 2:52 PM, Jonathan M Davis wrote:
> > On Thursday, September 6, 2018 12:21:24 PM MDT Steven Schveighoffer via
> >
> > Digitalmars-d-learn wrote:
> >> On 9/6/18 12:55 PM, Jonathan M Davis
301 - 400 of 1832 matches
Mail list logo