Passing lots of C flas to the D compilers and DUB

2021-05-25 Thread data pulverizer via Digitalmars-d-learn
Hi, A [previous post](https://forum.dlang.org/post/hxlhyalzqmzzzihdj...@forum.dlang.org) shows how to link individual C flags with `-L`, but is there a convenient way of linking lots of C flags? I've tried variations of ``` dmd `pkg-config --libs libR` `pkg-config --cflags libR` main.d dmd `p

Re: is there a way to output formatted text following the locale settings ?

2021-05-25 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 26 May 2021 at 00:18:29 UTC, someone wrote: Thanks for your reply, but no, let me clarify: I do not want 123\`456\`789 or whatever else custom delimiter. I just want to output what is already set in the LC_ALL locale environment variable which in my case results in 123,456,789

Re: how to specify a default configuration in a library's dub.json? (i.e if the use doesn't not have subConfigurations)

2021-05-25 Thread mw via Digitalmars-d-learn
On Wednesday, 26 May 2021 at 00:25:17 UTC, Mike Parker wrote: On Wednesday, 26 May 2021 at 00:19:23 UTC, mw wrote: Hi, I just did a build fix, and added two configurations to thrift's dub.json (whose "targetType": "library") https://github.com/apache/thrift/pull/2397/files I want to know

Re: how to specify a default configuration in a library's dub.json? (i.e if the use doesn't not have subConfigurations)

2021-05-25 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 26 May 2021 at 00:19:23 UTC, mw wrote: Hi, I just did a build fix, and added two configurations to thrift's dub.json (whose "targetType": "library") https://github.com/apache/thrift/pull/2397/files I want to know how to specify a default configuration in the library's dub.js

how to specify a default configuration in a library's dub.json? (i.e if the use doesn't not have subConfigurations)

2021-05-25 Thread mw via Digitalmars-d-learn
Hi, I just did a build fix, and added two configurations to thrift's dub.json (whose "targetType": "library") https://github.com/apache/thrift/pull/2397/files I want to know how to specify a default configuration in the library's dub.json? (i.e if the use doesn't not have subConfiguration

Re: is there a way to output formatted text following the locale settings ?

2021-05-25 Thread someone via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 23:41:39 UTC, Paul Backus wrote: From [the documentation of `formattedWrite`][1]: Separator Inserts the separator symbols ',' every X digits, from right to left, into numeric values to increase readability. The fractional part of floating point values inserts t

Re: where do I find the complete phobos function list names ?

2021-05-25 Thread someone via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 23:46:50 UTC, Paul Backus wrote: If you really want this, your best bet is probably to run a source-code indexer like `ctags` on the Phobos source tree, and do some scripting to transform the results into something usable in your Vim plugin. Something like that cam

Re: where do I find the complete phobos function list names ?

2021-05-25 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 22:05:16 UTC, someone wrote: I was unsuccessfully searching the site for them in the form of a master index to begin with. I need them, in plain text, in order to add them to a VIM custom syntax highlight plugin I already made which I am already using but is lacking

Re: is there a way to output formatted text following the locale settings ?

2021-05-25 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 22:37:25 UTC, someone wrote: writeln(format("%`d", intAmount)); /// please, note the backtick instead of , From [the documentation of `formattedWrite`][1]: Separator Inserts the separator symbols ',' every X digits, from right to left, into numeric values

is there a way to output formatted text following the locale settings ?

2021-05-25 Thread someone via Digitalmars-d-learn
The following works as expected but the format string will end hard-coded: import std.stdio; import std.format; void main ( ) { int intAmount = 1234567; writeln(format("%,d", intAmount)); /// eg: 1,234,567 } I tried something like: import std.stdio; import std.format; import core

where do I find the complete phobos function list names ?

2021-05-25 Thread someone via Digitalmars-d-learn
I was unsuccessfully searching the site for them in the form of a master index to begin with. I need them, in plain text, in order to add them to a VIM custom syntax highlight plugin I already made which I am already using but is lacking phobos support. Can anyone point me to the right place

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread evilrat via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 18:12:27 UTC, Gavin Ray wrote: On Tuesday, 25 May 2021 at 18:03:00 UTC, evilrat wrote: That last one with someInt is what I warned about. D ctor messed up class layout, in this simple case where class data isn't used it almost works, but will be practically unusable

Re: coreutils with D trials, wc, binary vs well formed utf

2021-05-25 Thread btiffin via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 18:03:29 UTC, Imperatorn wrote: Nice that you're also hopeful about the future for D ☀️ I also think slow steady growth is the best. We just need to focus and D will be great 🍀 D is already great. It just needs to take over (a larger chunk of) the world. ;-) Now

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 17:52:14 UTC, Gavin Ray wrote: void takesADerived(Derived derived); extern class Derived : Base1, Base2 Like I said in chat, these are NOT the same thing. The C++ Derived is a *sibling* class, not a parent, child, nor binding to the D Derived. All your attemp

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 18:12:27 UTC, Gavin Ray wrote: Would this fix it, or is it just not super viable to hack around C++ multiple inheritance in D? You can do anything you want with structs, raw memory, and casting, so it is viable, if you have a strong interest for this. But if you ar

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread Gavin Ray via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 18:03:00 UTC, evilrat wrote: That last one with someInt is what I warned about. D ctor messed up class layout, in this simple case where class data isn't used it almost works, but will be practically unusable in real scenarios. Ah =/ You have this in your code examp

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread Gavin Ray via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 11:38:03 UTC, evilrat wrote: I did some basic testing with code above, it seems class layout is recursively linear at least on Windows, and D follows C++ rules close enough, at least it works if one comments out all but the first base, and the rest can be hand crafted

Re: coreutils with D trials, wc, binary vs well formed utf

2021-05-25 Thread Imperatorn via Digitalmars-d-learn
On Monday, 24 May 2021 at 16:58:33 UTC, btiffin wrote: Hello, New here. A little background. Old guy, program for both work and recreation, GNU maintainer for the GnuCOBOL package; written in C, compiles COBOL via C intermediates. Fell into the role of maintainer mainly due to being a docum

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread evilrat via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 17:52:14 UTC, Gavin Ray wrote: ```d void main() { Derived dlangDerived = new Derived(123); printf("[D] Derived.Base1::getSomething() = %d \n", dlangDerived.getSomething()); printf("[D] Derived.Base2::getOtherThing() = %d \n", dlangDerived.getOtherThing()); pr

Template and alloca?

2021-05-25 Thread Ola Fosheim Grostad via Digitalmars-d-learn
Is it possible to use a template to write a "function" that provides initialized stack allocated memory (alloca)? Maybe I would have to use mixin?

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread Gavin Ray via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 06:02:55 UTC, evilrat wrote: Anyway all this stuff requires thorough research & testing as such ABI tinkering is very easy to mess up and very hard to debug, for example if you mess up the order(functions layout) it can land on another final method call that seemingly

Re: dmd error in wsl2

2021-05-25 Thread bharathyes via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 16:15:55 UTC, mw wrote: I think `powershell` is a Windows thing, which caused the path finding trouble. Your better in a Linux shell e.g. `wsl -u root`. Can you directly use a console from debian? e.g start by clicking the app with the icon of Ubuntu. I am usin

Re: dmd error in wsl2

2021-05-25 Thread bharathyes via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 15:59:21 UTC, MoonlightSentinel wrote: On Tuesday, 25 May 2021 at 15:54:31 UTC, bharathyes wrote: I wrote the basic code: You have a typo in your code, `std.studio` instead of `std.stdio`. Thanks. I spent more than half hour searching for this error but never fi

Re: dmd error in wsl2

2021-05-25 Thread mw via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 15:54:31 UTC, bharathyes wrote: I am facing an issue compiling an hello world program using dmd v2.096.1 running on WSL2 debian. I wrote the basic code: ```d void main() { import std.studio; string name ; write("What is your name?"); readf("%s\n", &na

Re: dmd error in wsl2

2021-05-25 Thread MoonlightSentinel via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 15:54:31 UTC, bharathyes wrote: I wrote the basic code: You have a typo in your code, `std.studio` instead of `std.stdio`.

dmd error in wsl2

2021-05-25 Thread bharathyes via Digitalmars-d-learn
I am facing an issue compiling an hello world program using dmd v2.096.1 running on WSL2 debian. I wrote the basic code: ```d void main() { import std.studio; string name ; write("What is your name?"); readf("%s\n", &name); writeln("Hellow ", name); } ``` This throws the fo

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread evilrat via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 08:10:25 UTC, sighoya wrote: On Tuesday, 25 May 2021 at 02:47:19 UTC, Gavin Ray wrote: The below seems to work at least, which is encouraging: Awesome! At least, it becomes problematic with fields in base classes, it would be nice if we could map them to @property

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-25 Thread sighoya via Digitalmars-d-learn
On Tuesday, 25 May 2021 at 02:47:19 UTC, Gavin Ray wrote: The below seems to work at least, which is encouraging: Awesome! At least, it becomes problematic with fields in base classes, it would be nice if we could map them to @property annotated functions in D interfaces.