Re: Debugging D code with GDB

2021-12-02 Thread Eduard Staniloiu via Digitalmars-d-learn
On Tuesday, 30 November 2021 at 09:01:38 UTC, Iain Buclaw wrote: On Monday, 29 November 2021 at 14:48:21 UTC, Luís Ferreira wrote: [...] Indeed, gdb assumes calling convention is same as default for target (actually its been years since I last looked, but are calling conventions tags in

Debugging D code with GDB

2021-11-27 Thread Eduard Staniloiu via Digitalmars-d-debugger
I've started a thread on this problem on #Learn: https://forum.dlang.org/post/nmbmvzymsawzywpbt...@forum.dlang.org Your (the Debuggers community) input would be much appreciated. I'm referring the original post on the forum, as I'm hoping to keep all the answers in one place. This will help

Debugging D code with GDB

2021-11-27 Thread Eduard Staniloiu via Digitalmars-d-learn
Hello, I'm trying to use `gdb` to debug D binaries, but I'm having trouble accessing the methods of a struct or class. It seems that `gdb` doesn't see them. Given the following simple example ``` // test.d struct S { int x; void myPrint() { writefln("x is %s\n", x); } } void

Re: The Winners of the Last Two Prizes and Q & A Videos

2021-11-23 Thread Eduard Staniloiu via Digitalmars-d-announce
On Sunday, 21 November 2021 at 20:48:30 UTC, Mike Parker wrote: […] Thank you everyone for an amazing dconf and for your talks. Looking forward to next year! Thank you Mike for MC-ing and for taking care of all the aspects surrounding the event. Thanks the DLF for the prizes!

Re: opOpAssign of AA: defined behavior?

2020-06-23 Thread Eduard Staniloiu via Digitalmars-d-learn
On Tuesday, 23 June 2020 at 09:15:57 UTC, WebFreak001 wrote: [...] it will give me a range violation at runtime and not init it for me at all. There is `aa.require("a", Foo.init) += 4;` now which solves this, but I would prefer having the small simple syntax well defined for all types

Re: Telegram group for DLang

2019-09-10 Thread Eduard Staniloiu via Digitalmars-d-announce
On Tuesday, 10 September 2019 at 19:56:20 UTC, Ernesto Castellotti wrote: On Monday, 9 September 2019 at 20:26:48 UTC, matheus wrote: On Thursday, 5 September 2019 at 08:13:14 UTC, Ernesto Castellotti wrote: I created a group on Telegram for DLang users, currently it is composed of about 10

Re: Do I understand std.experimental.allocator composition correctly?

2019-08-27 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 26 August 2019 at 01:06:55 UTC, James Blachly wrote: The documentation for std.experimental.allocator is a little dense and I wanted to make sure I am understanding composition correctly. [...] Yes, you are correct. Edi

Re: Exercism, call for mentors

2019-08-21 Thread Eduard Staniloiu via Digitalmars-d-learn
On Tuesday, 20 August 2019 at 09:40:06 UTC, Björn Lindström wrote: Hello, I've recently decided to pick up D, and have started doing some exercises on https://exercism.io/ (a non-profit programming exercise platform), which I think is an excellent way to pick up the basics in a new language.

Re: Why in Phobos is empty() sometimes const and sometimes not

2019-07-29 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 29 July 2019 at 17:32:58 UTC, Matt wrote: I've noticed that for some ranges in Phobos empty is marked const (e.g. iota) but for other ranges (e.g. multiwayMerge) it is not const. Is there a reason why? Isn't empty guaranteed not to alter the data of the range and so should be const?

Building GDC with auto-generated header files

2019-07-29 Thread Eduard Staniloiu via Digitalmars-d-learn
Cheers, everybody I'm working on this as part of my GSoC project [0]. I'm working on building gdc with the auto-generated `frontend.h` [1], but I'm having some issues There are functions in dmd that don't have an `extern (C)` or `extern (C++)` but they are used by gdc (are exposed in `.h`

Re: UPB D Summer School

2019-07-18 Thread Eduard Staniloiu via Digitalmars-d-announce
On Wednesday, 17 July 2019 at 18:35:21 UTC, Meta wrote: On Wednesday, 17 July 2019 at 13:56:38 UTC, RazvanN wrote: [...] That's awesome! Did the students earn actual credit hours for this bootcamp, or was it more interest-based? The summer school was interest-based. There are quite a few

Re: UPB D Summer School

2019-07-18 Thread Eduard Staniloiu via Digitalmars-d-announce
On Wednesday, 17 July 2019 at 16:36:56 UTC, M.M. wrote: On Wednesday, 17 July 2019 at 13:56:38 UTC, RazvanN wrote: Hello, Edi and myself are glad to announce that the first edition of the D Summer School that we organized for the students at the University Politehnica of Bucharest has just

Zero length arrays in D

2019-02-18 Thread Eduard Staniloiu via Digitalmars-d-learn
Hello According to the spec[0], D supports zero length arrays [1]. I have given this a shot at https://run.dlang.io/is/PwbPxJ Attempting to use the zero-length array results in a compiler error `a.contents[2]` -> Error: array index 2 is out of bounds (*a).contents[0 .. 0] The way I've

Re: Is it possible to modify shared struct array in a function.

2019-02-08 Thread Eduard Staniloiu via Digitalmars-d-learn
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 Friday, 8 February 2019 at 04:13:39 UTC, Sudhi wrote: [...] Works fine for me with DMD64 D Compiler

Re: std.container.rbtree as Interval Tree?

2019-02-07 Thread Eduard Staniloiu via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 19:12:43 UTC, James Blachly wrote: However, even when allowing (pseudo)duplicates, this means the distinct intervals with same start but different end coordinates are not deterministically placed/sorted within the tree, because they are not sortable with the

Re: std.container.rbtree as Interval Tree?

2019-02-05 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 4 February 2019 at 22:54:01 UTC, James Blachly wrote: I tried to implement an interval tree backed by std.container.rbtree today and fell flat. A standard way to make an interval tree is to make an augmented tree; I supposed since rbtree was a generic container and because I could

Re: __traits for checking if a type is dynamic array (slice)

2018-11-26 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 26 November 2018 at 09:28:37 UTC, Basile B. wrote: On Monday, 26 November 2018 at 09:04:25 UTC, Per Nordlöw wrote: Why is there no - __traits(isArray, T) alongside - __traits(isStaticArray, T) and - __traits(isAssociativeArray, T) when dmd already has `ENUMTY.Tarray` alongside -

Re: Making external types available to mixins

2018-11-22 Thread Eduard Staniloiu via Digitalmars-d-learn
On Sunday, 18 November 2018 at 11:29:51 UTC, John Chapman wrote: On Saturday, 17 November 2018 at 21:11:38 UTC, Adam D. Ruppe wrote: On Saturday, 17 November 2018 at 17:58:54 UTC, John Chapman wrote: Has anyone had a similar need and come up with a solution? You might be able to just pass it

Re: Built-in array opSliceAssign

2018-10-30 Thread Eduard Staniloiu via Digitalmars-d-learn
On Thursday, 25 October 2018 at 21:00:46 UTC, Adam D. Ruppe wrote: On Thursday, 25 October 2018 at 19:56:18 UTC, Stanislav Blinov wrote: The current behavior of the compiler is quite the opposite of those "same as" above. Yeah, I guess I am maybe selectively reading the spec in light of the

Re: Built-in array opSliceAssign

2018-10-25 Thread Eduard Staniloiu via Digitalmars-d-learn
On Thursday, 25 October 2018 at 12:55:38 UTC, Adam D. Ruppe wrote: On Thursday, 25 October 2018 at 12:25:37 UTC, Eduard Staniloiu wrote: IMHO, this is a bug. The code should lower to calls to opAssing for types that define opAssign. The spec doesn't exactly say it uses memset, but it does

Re: Built-in array opSliceAssign

2018-10-25 Thread Eduard Staniloiu via Digitalmars-d-learn
On Thursday, 25 October 2018 at 13:01:06 UTC, Eduard Staniloiu wrote: On Thursday, 25 October 2018 at 12:38:44 UTC, Paul Backus wrote: On Thursday, 25 October 2018 at 12:25:37 UTC, Eduard Staniloiu wrote: As I wrote in the comments above, I was expecting `a[] = b[]` to iterate the slices and

Re: Built-in array opSliceAssign

2018-10-25 Thread Eduard Staniloiu via Digitalmars-d-learn
On Thursday, 25 October 2018 at 12:38:44 UTC, Paul Backus wrote: On Thursday, 25 October 2018 at 12:25:37 UTC, Eduard Staniloiu wrote: As I wrote in the comments above, I was expecting `a[] = b[]` to iterate the slices and assign the elements of b into a. What really happens is a memcpy: as

Built-in array opSliceAssign

2018-10-25 Thread Eduard Staniloiu via Digitalmars-d-learn
Hello, everyone! I have a question regarding the expected behaviour of the built-in array's opSliceAssign. Given the following code: ``` import std.stdio; struct A { int x; ref A opAssign(A rhs) { writefln("slice_bug.opAssign: begin"); return this; } }

Ideas for students' summer projects

2018-05-22 Thread Eduard Staniloiu via Digitalmars-d
Hello, everyone! We, at UPB, have initiated D's participation to ROSEdu Summer of Code, see http://soc.rosedu.org/2018/. I will be mentoring a student over the summer and I was wondering if you have any suggestions for a project. If there is a library or feature that you would like just

Re: NoCopy for overriding @disable this(this)

2018-04-15 Thread Eduard Staniloiu via Digitalmars-d
On Thursday, 12 April 2018 at 17:09:22 UTC, Shachar Shemesh wrote: On 12/04/18 18:42, Uknown wrote: On Thursday, 12 April 2018 at 12:16:53 UTC, Shachar Shemesh wrote: [...] The problem seems to be that cast is happening at compile time, as opposed to run time, as you might have already

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-10 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 9 April 2018 at 14:51:24 UTC, Per Nordlöw wrote: On Monday, 9 April 2018 at 13:51:47 UTC, Steven Schveighoffer wrote: Well, you know the type, because make returned it no? The contract is, you call obj = make!X(args), then you have to call dispose(obj), where obj is of the type X.

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-07 Thread Eduard Staniloiu via Digitalmars-d-learn
On Friday, 6 April 2018 at 21:49:37 UTC, Per Nordlöw wrote: On Tuesday, 3 April 2018 at 09:14:28 UTC, Eduard Staniloiu wrote: So, say `reg` is your allocator, your workflow would be auto obj = reg.make!Type(args); /* do stuff */ reg.dispose(obj); // If Type has a __dtor, it will call

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-03 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 2 April 2018 at 21:32:47 UTC, Steven Schveighoffer wrote: On 4/2/18 5:16 PM, Per Nordlöw wrote: On Monday, 2 April 2018 at 20:43:01 UTC, Alexandru Jercaianu wrote: I am not completely sure how to solve this, but maybe we can find some clues here [1]. It seems like we should use

Re: Constructor qualifiers; bug or expected behavior?

2018-04-02 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 2 April 2018 at 10:26:32 UTC, RazvanN wrote: Hi all, Let's say we have this code: struct B { int a; this(int a) immutable { this.a = 7; } this(int a) { this.a = 10; } } void main() { B a = immutable B(2); writeln(a.a); a.a =

Re: Postblit constructor

2018-03-02 Thread Eduard Staniloiu via Digitalmars-d-learn
On Wednesday, 28 February 2018 at 18:27:49 UTC, Jiyan wrote: On Wednesday, 28 February 2018 at 18:23:04 UTC, Jiyan wrote: Hey, i thought i had understood postblit, but in my Code the following is happening (simplified): struct C { this(this){/*Do sth*/} list!C; void opAssign(const C c) {

Re: Cannot make my shared PureMallocator callable in pure functions

2018-02-17 Thread Eduard Staniloiu via Digitalmars-d-learn
On Saturday, 17 February 2018 at 12:33:25 UTC, Nordlöw wrote: I'm struggling with making https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d callable in pure functions such as here https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d#L84 Shouldn't a

Re: Class allocators

2017-11-12 Thread Eduard Staniloiu via Digitalmars-d-learn
On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote: Have anybody used allocators to construct class instances? I might be wrong, but I think you are looking for std.experimental.allocator.make [0] [0] - https://dlang.org/phobos/std_experimental_allocator.html#make

Re: Phobos' Windows Makefile

2017-10-12 Thread Eduard Staniloiu via Digitalmars-d
On Thursday, 12 October 2017 at 07:17:15 UTC, Jacob Carlborg wrote: On 2017-10-11 21:57, Eduard Staniloiu wrote: Hello, I've hit the following problem on this PR [0]: The Windows 32bit build fails with the error: "more than 32767 symbols in object file" [1]. After taking a look in

Re: Assert and undefined behavior

2017-10-11 Thread Eduard Staniloiu via Digitalmars-d-learn
On Wednesday, 11 October 2017 at 09:39:04 UTC, user1234 wrote: On Wednesday, 11 October 2017 at 09:27:49 UTC, John Burton wrote: [...] I therefore feel like I ought to not use assert and should instead validate my assumptions with an if statement and a throw or exit or something. Yes,

Phobos' Windows Makefile

2017-10-11 Thread Eduard Staniloiu via Digitalmars-d
Hello, I've hit the following problem on this PR [0]: The Windows 32bit build fails with the error: "more than 32767 symbols in object file" [1]. After taking a look in `win32.mak`, I've seen that we are bundling multiple source files into a single object (which is the issue here), instead

Re: [OT] vim tip with column limits

2017-10-11 Thread Eduard Staniloiu via Digitalmars-d
On Monday, 9 October 2017 at 13:38:18 UTC, lithium iodate wrote: On Monday, 9 October 2017 at 00:24:02 UTC, Jonathan M Davis wrote: […] Thanks for the tip! You might also want to use automatic word wrapping [0] for 120 chars. Cheers, Eduard [0] -

Re: How do I filter out data from mongodb in D-code

2017-10-10 Thread Eduard Staniloiu via Digitalmars-d
On Tuesday, 10 October 2017 at 09:43:10 UTC, Anders S wrote: Hi, I'm working on a middleware application that reads array of data from a POSIX pipe and insert data into the db if any position in the array has changed. This is where my problem lays, in order not to duplicate data I want to

Re: Deprecation message of library functions should state the replacement function

2017-10-10 Thread Eduard Staniloiu via Digitalmars-d
On Tuesday, 10 October 2017 at 13:56:36 UTC, Seb wrote: On Tuesday, 10 October 2017 at 12:57:36 UTC, bauss wrote: On Tuesday, 10 October 2017 at 11:48:48 UTC, Eduard Staniloiu wrote: Hi guys, I've just build druntime on Windows and we are displaying the following deprecation message:

Deprecation message of library functions should state the replacement function

2017-10-10 Thread Eduard Staniloiu via Digitalmars-d
Hi guys, I've just build druntime on Windows and we are displaying the following deprecation message: src\core\sys\windows\odbcinst.d(157): Deprecation: function core.sys.windows.odbcinst.SQLInstallTranslatorW is deprecated. I believe that we should also state with what should the

Re: Why would an initialised struct pointer field be null in the struct's destructor?

2017-05-21 Thread Eduard Staniloiu via Digitalmars-d-learn
On Saturday, 20 May 2017 at 10:48:54 UTC, Gary Willoughby wrote: Looks like you would want to use emplace [0] here. public this(int n) { this._data = (cast(Foo*) calloc(n, Foo.sizeof))[0 .. n]; foreach(ref element; this._data) {

Re: Missing functionality in std.process?

2017-01-06 Thread Eduard Staniloiu via Digitalmars-d-learn
On Friday, 14 October 2016 at 16:33:51 UTC, Andre Pany wrote: What I miss is s.th. to get the child Pids of a parent Pid. Again I can use OS dependent functionality to retrieve the processIDs of the children, but how to convert these processIDs to Pids for usage with kill/wait functions? On

Re: Installing ldc breaks gdc

2016-12-13 Thread Eduard Staniloiu via Digitalmars-d
On Friday, 9 December 2016 at 17:53:30 UTC, Matthias Klumpp wrote: Hi! This issue should be fixed since LDC 1:1.1.0-2, which Xenial doesn't have. Ideally, fetch a newer version from Debian or a PPA to solve this issue. Cheers, Matthias Hi! Thank you for your answer. For future

Re: Installing ldc breaks gdc

2016-12-10 Thread Eduard Staniloiu via Digitalmars-d
On Friday, 9 December 2016 at 17:34:35 UTC, Daniel Kozak wrote: On Friday, 9 December 2016 at 17:34:35 UTC, Daniel Kozak wrote: No thats all wrong, dmd a gdc could not use same include directory that is not possible. GDC use /usr/lib/gcc/x86_64-linux-gnu/5/include/d/ Yes and no.. as you

Installing ldc breaks gdc

2016-12-09 Thread Eduard Staniloiu via Digitalmars-d
Hello, everyone. So I have found that installing ldc will break gdc. The setup: I have a VM running a 64bit Ubuntu 16.04, as you can see from the output of uname -a: Linux ubuntu-xenial 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux I have