Re: Line numbers in backtraces (2017)

2017-11-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Thursday, 2 November 2017 at 19:05:46 UTC, Tobias Pankrath wrote: Including Phobos? Your posted backtrace looks to me like templates instantiated within Phobos, so I think you'd need Phobos with debug symbols for those lines. --- int main(string[] argv) { return argv[1].length > 0; } ---

Re: Line numbers in backtraces (2017)

2017-11-01 Thread Moritz Maxeiner via Digitalmars-d-learn
On Wednesday, 1 November 2017 at 06:44:44 UTC, Tobias Pankrath wrote: On Tuesday, 31 October 2017 at 11:21:30 UTC, Moritz Maxeiner wrote: On Tuesday, 31 October 2017 at 11:04:57 UTC, Tobias Pankrath wrote: [...] ??:? pure @safe void std.exception.bailOut!(Exception).bailOut(immutable(char)[],

Re: SublimeLinter-contrib-dmd: dmd feedback as you type

2017-10-31 Thread Moritz Maxeiner via Digitalmars-d-announce
On Tuesday, 31 October 2017 at 16:00:25 UTC, Bastiaan Veelo wrote: [...] Out of curiosity, what other plugins from [2] do you use in Sublime Text? How are they integrating with dub? If that question is open to the general public: None, I hacked my own [1] to suit my exact needs. [1]

Re: SublimeLinter-contrib-dmd: dmd feedback as you type

2017-10-31 Thread Moritz Maxeiner via Digitalmars-d-announce
On Tuesday, 31 October 2017 at 13:32:34 UTC, SrMordred wrote: Thank you , works perfectly! One idea: Integrating with dub. So you don´t have to manually set lib dirs and flags since its all on 'dub.json' already. You can pretty much copy paste from sublide for this [1] (my own D plugin for

Re: Line numbers in backtraces (2017)

2017-10-31 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 11:04:57 UTC, Tobias Pankrath wrote: [...] ??:? pure @safe void std.exception.bailOut!(Exception).bailOut(immutable(char)[], ulong, const(char[])) [0xab5c9566] ??:? pure @safe bool std.exception.enforce!(Exception, bool).enforce(bool, lazy const(char)[],

Re: My first experience as a D Newbie

2017-10-19 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 19 October 2017 at 09:10:04 UTC, Ecstatic Coder wrote: For instance, here I say that I don't agree that the "easy" way to use D is by using FreeBSD instead of Windows. Here is the answer : "I remember those events very differently, so here they are for posterity: That post

Re: My first experience as a D Newbie

2017-10-19 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 19 October 2017 at 08:17:04 UTC, Ecstatic Coder wrote: On Thursday, 19 October 2017 at 07:04:14 UTC, Moritz Maxeiner wrote: On Thursday, 19 October 2017 at 06:32:10 UTC, Ecstatic Coder wrote: [...] OK actually my initial proposal was this one :

Re: My first experience as a D Newbie

2017-10-19 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 19 October 2017 at 06:32:10 UTC, Ecstatic Coder wrote: [...] OK actually my initial proposal was this one : http://forum.dlang.org/post/mailman.6425.1503876081.31550.digitalmars-d-b...@puremagic.com [...] And the definitive answer about that is of course something like "Hey

Re: what means... auto ref Args args?

2017-10-18 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 18 October 2017 at 21:38:41 UTC, Dave Jones wrote: Poking around in the source code for emplace and I noticed... T* emplace(T, Args...)(T* chunk, auto ref Args args) what does the "auto ref" do in this situiation? Cant seem to find any explanation in the docs. It means that

Re: What is the Philosophy of D?

2017-10-16 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 16 October 2017 at 00:25:32 UTC, codephantom wrote: D's overview page says "It doesn't come with an overriding philosophy." Is philosophy not important? I'd like to argue, that the problem of focusing on getting the job done quickly and reliably, does *not* leave behind

DIP 1009 Status ?

2017-10-11 Thread Moritz Maxeiner via Digitalmars-d
As it has been a while since I've seen an update on DIP 1009 I'd like to ask what the current status of it is: Has it been closed for feedback and the second stage (submission to language authors) been initiated (as [1] requires)? [1] https://github.com/dlang/DIPs

Re: Why do I have to cast arguments from int to byte?

2017-10-10 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 10 October 2017 at 19:55:36 UTC, Chirs Forest wrote: I keep having to make casts like the following and it's really rubbing me the wrong way: void foo(T)(T bar){...} byte bar = 9; [...] Why? Because of integer promotion [1], which is inherited from C. [1]

Re: D on quora ...

2017-10-06 Thread Moritz Maxeiner via Digitalmars-d
On Friday, 6 October 2017 at 21:12:58 UTC, Rion wrote: I can make a few simple demos and have D use by default 5 to 10 more memory then the exact same C or C++ program. While D does not actually use it ( its only marked as allocated for the GC ), it does not dispel the notion or feeling of

Re: Default allocator of container plus element type

2017-10-05 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 5 October 2017 at 11:35:30 UTC, Nordlöw wrote: Would it be possible to set up a mapping (either formal or informal) of each typical container (such as array, linked-list etc) plus element type to a suitable default allocator? And perhaps add this to the documentation of

Re: Passing data and ownership to new thread

2017-09-26 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 26 September 2017 at 09:10:41 UTC, James Brister wrote: I'm pretty new to D, but from what I've seen there are two modes of using data across threads: (a) immutable message passing and the new thread copies the data if it needs to be modified, (b) shared, assuming the data will be

Re: Passing data and ownership to new thread

2017-09-26 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 26 September 2017 at 09:10:41 UTC, James Brister wrote: I'm pretty new to D, but from what I've seen there are two modes of using data across threads: (a) immutable message passing and the new thread copies the data if it needs to be modified, (b) shared, assuming the data will be

Re: The case for integer overflow checks?

2017-09-18 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 18 September 2017 at 22:32:28 UTC, Dennis Cote wrote: On Monday, 18 September 2017 at 13:25:55 UTC, Andrei Alexandrescu wrote: For the record, with the help of std.experimental.checkedint, the change that fixes the code would be: malloc(width * height * 4) ==>

Re: scope(exit) and destructor prioity

2017-09-18 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 18 September 2017 at 20:55:21 UTC, Sasszem wrote: If I write "auto a = new De()", then it calls the scope first, no matter where I place it. Because with `new` a) your struct object is located on the heap (and referred to by pointer - `De*`) instead of the stack (which means no

Re: My friend can't install DMD 2.076.0 after he deleted contents of C:\D

2017-09-18 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 17 September 2017 at 05:33:12 UTC, rikki cattermole wrote: Skip Revo-Uninstaller, no idea why you'd ever use such trial software. Anyway what you want is CCleaner, standard software that all Windows installs should have on hand.

Re: OpIndex/OpIndexAssign strange order of execution

2017-09-18 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 18 September 2017 at 15:11:34 UTC, Moritz Maxeiner wrote: gets rewritten to --- t.opIndex("b").opIndexAssign(t["a"].value, "c"); --- Sorry, forgot one level of rewriting: --- t.opIndex("b").opIndexAssign(t.opIndex("a").value, "c"); ---

Re: OpIndex/OpIndexAssign strange order of execution

2017-09-18 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 17 September 2017 at 18:52:39 UTC, SrMordred wrote: struct Test{ [...] } Test t; As described in the spec [1] t["a"] = 100; gets rewritten to --- t.opIndexAssign(100, "a"); --- , while t["b"]["c"] = t["a"].value; gets rewritten to ---

Re: extern(C) enum

2017-09-18 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 18 September 2017 at 02:04:49 UTC, bitwise wrote: The following code will run fine on Windows, but crash on iOS due to the misaligned access: Interesting, does iOS crash such a process intentionally, or is it a side effect? char data[8]; int i = 0x; int* p =

Re: Assertion Error

2017-09-13 Thread Moritz Maxeiner via Digitalmars-d-learn
On Wednesday, 13 September 2017 at 15:12:57 UTC, Vino.B wrote: On Wednesday, 13 September 2017 at 11:03:38 UTC, Moritz Maxeiner wrote: On Wednesday, 13 September 2017 at 07:39:46 UTC, Vino.B wrote: Hi Max, [...] Program Code: [...] foreach (string Fs; parallel(SizeDirlst[0 .. $], 1)) {

Re: Known reasons why D crashes without any message?

2017-09-13 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 13 September 2017 at 10:20:48 UTC, Thorsten Sommer wrote: [...] Besides the unit tests, the main program is now able to startup but crashes after a while without any message at all. No stack trace, no exception, nothing. Obviously, this makes it hard to debug anything...

Re: Assertion Error

2017-09-13 Thread Moritz Maxeiner via Digitalmars-d-learn
On Wednesday, 13 September 2017 at 07:39:46 UTC, Vino.B wrote: On Tuesday, 12 September 2017 at 21:01:26 UTC, Moritz Maxeiner wrote: On Tuesday, 12 September 2017 at 19:44:19 UTC, vino wrote: Hi All, I have a small piece of code which executes perfectly 8 out of 10 times, very rarely it

Re: Assertion Error

2017-09-12 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 19:44:19 UTC, vino wrote: Hi All, I have a small piece of code which executes perfectly 8 out of 10 times, very rarely it throws an assertion error, so is there a way to find which line of code is causing this error. You should be getting the line number as

Re: Adding empty static this() causes exception

2017-09-12 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 19:59:52 UTC, Joseph wrote: On Tuesday, 12 September 2017 at 10:08:11 UTC, Moritz Maxeiner wrote: On Tuesday, 12 September 2017 at 09:11:20 UTC, Joseph wrote: I have two nearly duplicate files I added a static this() to initialize some static members of an

Re: Adding empty static this() causes exception

2017-09-12 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 09:11:20 UTC, Joseph wrote: I have two nearly duplicate files I added a static this() to initialize some static members of an interface. On one file when I add an empty static this() it crashes while the other one does not. The exception that happens is

Re: Ranges seem awkward to work with

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote: Is this is a common beginner issue? I remember using an earlier version of D some long time ago and I don't remember seeing this concept. D's ranges can take getting used to, so if you haven't already, these two articles are

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 11 September 2017 at 22:38:21 UTC, Walter Bright wrote: If an address is taken to a TLS object, any relocations and adjustments are made at the time the pointer is generated, not when the pointer is dereferenced. Could you elaborate on that explanation more? The way I thought

Re: LDC 1.4.0

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-announce
On Monday, 11 September 2017 at 23:32:55 UTC, kinke wrote: Hi everyone, on behalf of the LDC team, I'm glad to announce LDC 1.4.0. The highlights of version 1.4 in a nutshell: * Based on D 2.074.1. [...] Fantastic news, thanks for your work!

Re: D on devdocs

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-announce
On Monday, 11 September 2017 at 03:23:47 UTC, ANtlord wrote: Hello. I'm not sure that you know, but documentation of D language has become to devdocs.io. It is web service provides offline documentation. We've got a useful tool for documentation viewing and reading. The next step is an

Re: betterC and struct destructors

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 11 September 2017 at 10:18:41 UTC, Oleg B wrote: Hello. I try using destructor in betterC code and it's work if outer function doesn't return value (void). Code in `scope (exit)` works as same (if func is void all is ok). In documentation I found

Re: -betterC and extern(C++) classes

2017-09-10 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 10 September 2017 at 15:08:50 UTC, Yuxuan Shui wrote: By the way, can we dynamic_cast extern(C++) classes in C++? It doesn't work for me OOTB with dmd 2.075, at least (though I may be missing something): --- classes.d --- import core.memory; extern(C++) class Parent { char

Re: -betterC and extern(C++) classes

2017-09-10 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 10 September 2017 at 15:12:12 UTC, Yuxuan Shui wrote: On Sunday, 10 September 2017 at 14:42:42 UTC, Moritz Maxeiner wrote: On Sunday, 10 September 2017 at 14:04:20 UTC, rikki cattermole wrote: On 10/09/2017 2:19 PM, Moritz Maxeiner wrote: If TypeInfo for extern(C++) classes is

Re: -betterC and extern(C++) classes

2017-09-10 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 10 September 2017 at 14:04:20 UTC, rikki cattermole wrote: On 10/09/2017 2:19 PM, Moritz Maxeiner wrote: If TypeInfo for extern(C++) classes is removed, couldn't final extern(C++) classes without base class and which don't implement any interfaces omit the vtable so that the

Re: -betterC and extern(C++) classes

2017-09-10 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 10 September 2017 at 09:31:55 UTC, Walter Bright wrote: On 9/10/2017 1:40 AM, Yuxuan Shui wrote: I was experimenting with -betterC and found out that C++ classes doesn't work. Because the resulting object file needs a symbol "_D14TypeInfo_Class6__vtblZ" which is in druntime. I

Re: Testing whether static foreach is available

2017-09-10 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 10 September 2017 at 01:49:42 UTC, Mike Parker wrote: On Saturday, 9 September 2017 at 16:53:19 UTC, jmh530 wrote: version(DLANGSEMVER >= 2.076.0) { //include static foreach code. } but we can't do conditionals in version blocks, so you'd need a static if. Alternately, we'd

Re: Can attributes trigger functionality?

2017-09-05 Thread Moritz Maxeiner via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 02:43:20 UTC, Psychological Cleanup wrote: I'm having to create a lot of boiler plate code that creates "events" and corresponding properties(getter and setter). I'm curious if I can simplify this without a string mixin. If I create my own attribute like

Re: C `restrict` keyword in D

2017-09-05 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 5 September 2017 at 18:32:34 UTC, Johan Engelen wrote: On Monday, 4 September 2017 at 21:23:50 UTC, Moritz Maxeiner wrote: On Monday, 4 September 2017 at 17:58:41 UTC, Johan Engelen wrote: (The spec requires crashing on null dereferencing, but this spec bit is ignored by DMD and

Re: C `restrict` keyword in D

2017-09-04 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 4 September 2017 at 17:58:41 UTC, Johan Engelen wrote: On Monday, 4 September 2017 at 09:47:12 UTC, Moritz Maxeiner wrote: On Monday, 4 September 2017 at 09:15:30 UTC, ag0aep6g wrote: On 09/04/2017 06:10 AM, Moritz Maxeiner wrote: Indeed, but it also means that - other than null

Re: C `restrict` keyword in D

2017-09-04 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 4 September 2017 at 10:24:48 UTC, ag0aep6g wrote: On 09/04/2017 11:47 AM, Moritz Maxeiner wrote: Still, though, this is surprising to me, because this means taking the address of a parameter passed by reference (which is in your case is typed as an existing int) can be null. Is

Re: C `restrict` keyword in D

2017-09-04 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 4 September 2017 at 09:15:30 UTC, ag0aep6g wrote: On 09/04/2017 06:10 AM, Moritz Maxeiner wrote: Indeed, but it also means that - other than null dereferencing - pointer issues can by made into reference issues my dereferencing a pointer and passing that into a function that takes

Re: C `restrict` keyword in D

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 4 September 2017 at 02:43:48 UTC, Uknown wrote: On Sunday, 3 September 2017 at 16:55:51 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 15:39:58 UTC, Uknown wrote: On Sunday, 3 September 2017 at 12:59:25 UTC, Moritz Maxeiner wrote: [...] The main issue I see is that

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 4 September 2017 at 03:08:50 UTC, EntangledQuanta wrote: On Monday, 4 September 2017 at 01:50:48 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 23:25:47 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 3 September 2017 at 23:25:47 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2

Re: C `restrict` keyword in D

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 3 September 2017 at 15:39:58 UTC, Uknown wrote: On Sunday, 3 September 2017 at 12:59:25 UTC, Moritz Maxeiner wrote: [...] The main issue I see is that pointers/references can change at runtime, so I don't think a static analysis in the compiler can cover this in general (which, I

Re: C++ / Why Iterators Got It All Wrong

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 3 September 2017 at 14:19:19 UTC, Ilya Yaroshenko wrote: On Sunday, 3 September 2017 at 12:35:16 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 09:24:03 UTC, Ilya Yaroshenko wrote: On Sunday, 3 September 2017 at 02:43:51 UTC, Moritz Maxeiner wrote: On Sunday, 3 September

Re: C `restrict` keyword in D

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 3 September 2017 at 06:11:10 UTC, Uknown wrote: On Sunday, 3 September 2017 at 03:49:21 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 03:04:58 UTC, Uknown wrote: [...] void foo(ref RCArray!int arr, ref int val) @safe { { auto copy = arr; //arr's (and copy's)

Re: C++ / Why Iterators Got It All Wrong

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 3 September 2017 at 08:37:36 UTC, Robert M. Münch wrote: On 2017-09-02 21:27:58 +, Moritz Maxeiner said: Thanks for your post about Rebol, I didn't know it before. As said, the official Rebol-2 version is a dead-end. Even our main product is still based on it :-) 15 years old

Re: C++ / Why Iterators Got It All Wrong

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 3 September 2017 at 09:24:03 UTC, Ilya Yaroshenko wrote: On Sunday, 3 September 2017 at 02:43:51 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 02:08:20 UTC, Ilya Yaroshenko wrote: On Tuesday, 29 August 2017 at 12:50:08 UTC, Robert M. Münch wrote: Maybe of interest:

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 23:12:35 UTC, EntangledQuanta wrote: [...] The contexts being independent of each other doesn't change that we would still

Re: C `restrict` keyword in D

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 3 September 2017 at 03:04:58 UTC, Uknown wrote: [...] void foo(ref RCArray!int arr, ref int val) @safe { { auto copy = arr; //arr's (and copy's) reference counts are both 2 arr = RCArray!int([]); // There is another owner, so arr //

Re: C++ / Why Iterators Got It All Wrong

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 3 September 2017 at 02:08:20 UTC, Ilya Yaroshenko wrote: On Tuesday, 29 August 2017 at 12:50:08 UTC, Robert M. Münch wrote: Maybe of interest: https://www.think-cell.com/en/career/talks/iterators/#1 I haven't read everything, so not sure if it worth to take a look. Iterators has

Re: Bug in D!!!

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 23:12:35 UTC, EntangledQuanta wrote: On Saturday, 2 September 2017 at 21:19:31 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 00:00:43 UTC, EntangledQuanta wrote: On Friday, 1 September 2017 at 23:25:04 UTC, Jesse Phillips wrote: I've love being

Re: nested module problem

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 23:02:18 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 21:56:15 UTC, Jean-Louis Leroy wrote: [...] Hmmm I see...I was thinking of spinning the runtime part of my openmethods library into its own module (like here

Re: nested module problem

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 21:56:15 UTC, Jean-Louis Leroy wrote: [...] Hmmm I see...I was thinking of spinning the runtime part of my openmethods library into its own module (like here https://github.com/jll63/openmethods.d/tree/split-runtime/source/openmethods) but it looks like a bad

Re: nested module problem

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 21:24:19 UTC, Jean-Louis Leroy wrote: On Saturday, 2 September 2017 at 20:48:22 UTC, Moritz Maxeiner wrote: So the compiler wants you to import it by the name it has inferred for you (The fix being either specifying the module name in foo/bar.d as `module

Re: C++ / Why Iterators Got It All Wrong

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d
On Saturday, 2 September 2017 at 20:17:40 UTC, Robert M. Münch wrote: On 2017-08-31 07:13:55 +, drug said: Interesting. How is it comparable with iterators and ranges ideas? Well, see: http://www.rebol.com/docs/core23/rebolcore-6.html#section-6 Thanks for your post about Rebol, I

Re: Bug in D!!!

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 00:00:43 UTC, EntangledQuanta wrote: On Friday, 1 September 2017 at 23:25:04 UTC, Jesse Phillips wrote: I've love being able to inherit and override generic functions in C#. Unfortunately C# doesn't use templates and I hit so many other issues where Generics

Re: nested module problem

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 20:03:48 UTC, Jean-Louis Leroy wrote: So I have: jll@ORAC:~/dev/d/tests/modules$ tree . ├── foo │   └── bar.d └── foo.d foo.d contains: import foo.bar; bar.d is empty. This means bar.d's module name will be inferred by the compiler [1], which will ignore

Re: string to character code hex string

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 20:02:37 UTC, bitwise wrote: On Saturday, 2 September 2017 at 18:28:02 UTC, Moritz Maxeiner wrote: In UTF8: --- utfmangle.d --- void fun_ༀ() {} pragma(msg, fun_ༀ.mangleof); --- --- $ dmd -c utfmangle.d _D6mangle7fun_ༀFZv --- Only universal

Re: Using closure causes GC allocation

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 18:59:30 UTC, Vino.B wrote: On Saturday, 2 September 2017 at 18:32:55 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 18:08:19 UTC, vino.b wrote: On Saturday, 2 September 2017 at 18:02:06 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017

Re: Using closure causes GC allocation

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 18:08:19 UTC, vino.b wrote: On Saturday, 2 September 2017 at 18:02:06 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 17:43:08 UTC, Vino.B wrote: [...] Line 25 happens because of `[a.name]`. You request a new array: the memory for this has to be

Re: string to character code hex string

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 18:07:51 UTC, bitwise wrote: On Saturday, 2 September 2017 at 17:45:30 UTC, Moritz Maxeiner wrote: If this (unnecessary waste) is of concern to you (and from the fact that you used ret.reserve I assume it is), then the easy fix is to use `sformat` instead of

Re: Using closure causes GC allocation

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 17:43:08 UTC, Vino.B wrote: Hi All, Request your help on how to solve the issue in the below code as when i execute the program with -vgc it state as below: NewTD.d(21): vgc: using closure causes GC allocation NewTD.d(25): vgc: array literal may cause GC

Re: string to character code hex string

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 16:23:57 UTC, bitwise wrote: On Saturday, 2 September 2017 at 15:53:25 UTC, bitwise wrote: [...] This seems to work well enough. string toAsciiHex(string str) { import std.array : appender; auto ret = appender!string(null); ret.reserve(str.length

Re: gcd with doubles

2017-09-01 Thread Moritz Maxeiner via Digitalmars-d-learn
On Friday, 1 September 2017 at 09:33:08 UTC, Alex wrote: On Sunday, 27 August 2017 at 23:13:24 UTC, Moritz Maxeiner wrote: On Sunday, 27 August 2017 at 19:47:59 UTC, Alex wrote: [...] To expand on the earlier workaround: You can also adapt a floating point to string algorithm in order to

Re: Editor recommendations for new users.

2017-08-31 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 31 August 2017 at 23:20:52 UTC, Jerry wrote: On Wednesday, 30 August 2017 at 22:42:40 UTC, Moritz Maxeiner wrote: On Wednesday, 30 August 2017 at 21:30:44 UTC, Jerry wrote: The install requirement is arbitrary, and why 20MB? It just seems like you are trying to advertise that

Re: Symbols missing, unmangle!

2017-08-31 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 31 August 2017 at 14:51:59 UTC, Mike Wey wrote: On 30-08-17 23:51, Moritz Maxeiner wrote: 2) Try to get demangling of D symbols into upstream of the currently common linkers (GNU linker, gold, lld, etc.) The GNU linker and gold support demangling D symbols, so if you are on

Re: Output range with custom string type

2017-08-31 Thread Moritz Maxeiner via Digitalmars-d-learn
On Thursday, 31 August 2017 at 07:06:26 UTC, Jacob Carlborg wrote: On 2017-08-29 19:35, Moritz Maxeiner wrote: void put(T t) {     if (!store)     {     // Allocate only once for "small" vectors     store = alloc.makeArray!T(8);     if (!store)

Re: Editor recommendations for new users.

2017-08-30 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 30 August 2017 at 21:30:44 UTC, Jerry wrote: On Sunday, 27 August 2017 at 18:08:52 UTC, Moritz Maxeiner wrote: The requirements are rather vague, you can interpret it in a number of ways. The sensible interpretation imho is "as low an install footprint as possible while still

Re: Symbols missing, unmangle!

2017-08-30 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 30 August 2017 at 20:23:18 UTC, Johnson Jones wrote: It would be nice if, when symbols are missing, they are unmangled! Error 42: Symbol Undefined _D12mMunchhousin12iMunchhousin11__T4GoTsZ4GoMFS12mMunchhousin18__T10MunchhousinTsZ10sMunchhousinfE12mMunchhousin9eGoffZv (void

Re: DIP 1009--Improve Contract Usability--Formal Review

2017-08-30 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 30 August 2017 at 14:05:40 UTC, Mark wrote: [...] int abs(int x) out(_ >= 0) { return x>0 ? x : -x; } The ambiguity issue of having two results in one scope [1] applies. [1] http://forum.dlang.org/post/oihbot$134s$1...@digitalmars.com

Re: Output range with custom string type

2017-08-29 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 09:59:30 UTC, Jacob Carlborg wrote: [...] But if I keep the range internal, can't I just do the allocation inside the range and only use "formattedWrite"? Instead of using both formattedWrite and sformat and go through the data twice. Then of course the final

Re: Editor recommendations for new users.

2017-08-29 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 29 August 2017 at 14:05:13 UTC, Ryion wrote: On Monday, 28 August 2017 at 21:17:19 UTC, Moritz Maxeiner wrote: Why "again"? You've not stated so before AFAICT. Regardless, I disagree that discussing the validity of recommendations in a thread specifically made to gather such

Re: Accessing outer class attribute from inner struct

2017-08-29 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 07:59:40 UTC, Andre Pany wrote: On Monday, 28 August 2017 at 23:12:40 UTC, Moritz Maxeiner wrote: In both cases S doesn't inherently how about C, which means a solution using default initialization is not feasible, as S.init can't know about any particular

Re: C callbacks getting a value of 0! Bug in D?

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 02:47:34 UTC, Johnson Jones wrote: [...] Seems only long and ulong are issues. With respect to the currently major platforms you can reasonable expect software to run on, yes. Just don't try to use D on something with e.g. 32 bit C shorts unless you bind to it

Re: D Tour is down

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 28 August 2017 at 23:57:01 UTC, Mengu wrote: On Monday, 28 August 2017 at 17:16:59 UTC, Mengu wrote: On Monday, 28 August 2017 at 08:19:10 UTC, Petar Kirov [ZombineDev] wrote: On Monday, 28 August 2017 at 07:52:00 UTC, Joakim wrote: On Monday, 28 August 2017 at 07:44:48 UTC,

Re: C callbacks getting a value of 0! Bug in D?

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 01:34:40 UTC, Johnson Jones wrote: [...] produces 4 on both x86 and x64. So, I'm not sure how you are getting 8. There are different 64bit data models [1] and it seems your platform uses LLP64, which uses 32bit longs. Am I correct in assuming you're on

Re: Accessing outer class attribute from inner struct

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 28 August 2017 at 22:47:12 UTC, Andre Pany wrote: On Monday, 28 August 2017 at 22:28:18 UTC, Moritz Maxeiner wrote: On Monday, 28 August 2017 at 21:52:58 UTC, Andre Pany wrote: [...] To make my question short:) If ColumnsArray is a class I can access the attribute "reference" but

Re: C callbacks getting a value of 0! Bug in D?

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 28 August 2017 at 22:21:18 UTC, Johnson Jones wrote: On Monday, 28 August 2017 at 21:35:27 UTC, Steven Schveighoffer wrote: On 8/27/17 10:17 PM, Johnson Jones wrote: [...] For C/C++ interaction, always use c_... types if they are available. The idea is both that they will be

Re: Accessing outer class attribute from inner struct

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 28 August 2017 at 21:52:58 UTC, Andre Pany wrote: [...] To make my question short:) If ColumnsArray is a class I can access the attribute "reference" but not if it is a struct. I would rather prefer a struct, but with a struct it seems I cannot access "reference". How can I

Re: Output range with custom string type

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 28 August 2017 at 14:27:19 UTC, Jacob Carlborg wrote: I'm working on some code that sanitizes and converts values of different types to strings. I thought it would be a good idea to wrap the sanitized string in a struct to have some type safety. Ideally it should not be possible to

Re: Editor recommendations for new users.

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 28 August 2017 at 20:48:44 UTC, Ryion wrote: On Sunday, 27 August 2017 at 18:08:52 UTC, Moritz Maxeiner wrote: It's nearly ten times the size, so yeah, it is relative to Textadept. You can say the same thing in comparison with vim which is only a 2MB install size, 20MB in

Re: gcd with doubles

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 27 August 2017 at 19:47:59 UTC, Alex wrote: [..] Is there a workaround, maybe? To expand on the earlier workaround: You can also adapt a floating point to string algorithm in order to dynamically determine an upper bound on the number of after decimal point digits required. Below

Re: gcd with doubles

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 27 August 2017 at 19:47:59 UTC, Alex wrote: Hi, all. Can anybody explain to me why void main() { import std.numeric; assert(gcd(0.5,32) == 0.5); assert(gcd(0.2,32) == 0.2); } fails on the second assert? I'm aware, that calculating gcd on doubles is not so

Re: Promoting TutorialsPoint's D tutorial

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 20:13:35 UTC, Ecstatic Coder wrote: Following what you said, I've just looked at both Github accounts, and I can clearly see that it's much above my skill set to merge the content of both D-based websites so that the main page of the Dlang website looks exactly

Re: Promoting TutorialsPoint's D tutorial

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 19:29:03 UTC, Ryion wrote: On Sunday, 27 August 2017 at 18:51:00 UTC, Moritz Maxeiner wrote: Thanks, but as I pointed out, the website's design is of no interest to me personally. As I said, you aren't going to change my interests (and I'm reasonable convinced

Re: Editor recommendations for new users.

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 18:14:07 UTC, Adam D. Ruppe wrote: On Sunday, 27 August 2017 at 18:08:52 UTC, Moritz Maxeiner wrote: Indeed, but that's only the raw executable, not the full package (which includes things like syntax highlighting), which adds another 26MB. But, yes, Textadept and

Re: Promoting TutorialsPoint's D tutorial

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 18:07:27 UTC, Ecstatic Coder wrote: I've already received enough "No, not interested" answers till now to the same proposal to think that this will be ok this time. Add my voice to that corpus - I honestly don't care what the website looks like. Ok, message

Re: Editor recommendations for new users.

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 16:22:44 UTC, Jerry wrote: On Sunday, 27 August 2017 at 15:17:51 UTC, Moritz Maxeiner wrote: On Sunday, 27 August 2017 at 13:15:41 UTC, Ryion wrote: On Sunday, 27 August 2017 at 10:05:29 UTC, Nicholas Wilson wrote: The following are a must: no large install

Re: Editor recommendations for new users.

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 13:15:41 UTC, Ryion wrote: On Sunday, 27 August 2017 at 10:05:29 UTC, Nicholas Wilson wrote: The following are a must: no large install footprint Visual Studio Code seems to be what you need. [...] Relative low memory footprint for the functionality (

Re: Promoting TutorialsPoint's D tutorial

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 13:12:22 UTC, Ecstatic Coder wrote: I agree, but here it's not a local modification I've done to a D library that I want to push so that other people can use it too. It's a change to the main landing page of the dlang.org website, which is by definition global

Re: Confusion over enforce and assert - both are compiled out in release mode

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 27 August 2017 at 10:46:53 UTC, Andrew Chapman wrote: [...] Oh interesting. Does DUB support passing through the --enable-contracts flag to ldc? Also, if this is an ldc specific thing it's probably not a good idea i'd imagine, since in the future one may want to use a GDC, or

Re: Promoting TutorialsPoint's D tutorial

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 11:50:18 UTC, Ecstatic Coder wrote: On Sunday, 27 August 2017 at 11:36:57 UTC, Moritz Maxeiner wrote: On Sunday, 27 August 2017 at 11:26:58 UTC, Ecstatic Coder wrote: [...] Just add the 4 examples I suggested, and you have a brand-new beginner-friendly website

Re: Promoting TutorialsPoint's D tutorial

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 11:26:58 UTC, Ecstatic Coder wrote: [...] Just add the 4 examples I suggested, and you have a brand-new beginner-friendly website without changing anything else to the website canvas. If you want a change in D's web presence submit a PR to [1] or one of [2] as

Re: Editor recommendations for new users.

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d
On Sunday, 27 August 2017 at 10:05:29 UTC, Nicholas Wilson wrote: So I will be doing a workshop on programming for the biology department at my university and I was wondering what would best suit the users. The following are a must: support windows & mac ( the more consistent between the

Re: Confusion over enforce and assert - both are compiled out in release mode

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 27 August 2017 at 10:46:53 UTC, Andrew Chapman wrote: On Sunday, 27 August 2017 at 10:37:50 UTC, Moritz Maxeiner wrote: [...] Oh interesting. Does DUB support passing through the --enable-contracts flag to ldc? Sure, using platform specific build settings [1] such as

Re: Confusion over enforce and assert - both are compiled out in release mode

2017-08-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 27 August 2017 at 10:17:47 UTC, Andrew Chapman wrote: On Sunday, 27 August 2017 at 10:08:15 UTC, ag0aep6g wrote: On 08/27/2017 12:02 PM, Andrew Chapman wrote: However, I am finding that BOTH enforce and assert are compiled out by dmd and ldc in release mode. Is there a standard

  1   2   3   4   5   6   >