Re: Global version/debug statements in file?

2020-02-12 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 08:44:24 UTC, cc wrote: Is there some way to globally declare version= or debug= statements in a file and have them apply to the entire project being compiled? As the documentation says these only apply to the module scope they exist in, and need to be added

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Dennis via Digitalmars-d-learn
Thanks for your perspective. Just a few things are unclear to me: On Wednesday, 12 February 2020 at 10:39:06 UTC, mark wrote: I don't find the presentation of the member properties and methods very easy to read Can you elaborate a bit on this? The lack of set and B-tree types is

Re: Global version/debug statements in file?

2020-02-12 Thread cc via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 09:28:15 UTC, Simen Kjærås wrote: https://dlang.org/dmd-windows.html#switches specifies that DMD may be passed a file on the command line that contains compiler arguments and switches. This may be freely combined with regular command line arguments if you so

Building for multiple platforms

2020-02-12 Thread Neils via Digitalmars-d-learn
I maintain an open-source project written in D and I use DUB for building and my compiler backend is DMD. My dub.json file is rather simple: https://github.com/neilsf/XC-BASIC/blob/master/dub.json I offer pre-built binaries for Linux x86, Linux x86_64, Windows and Mac OS. I'm only doing

Global version/debug statements in file?

2020-02-12 Thread cc via Digitalmars-d-learn
Is there some way to globally declare version= or debug= statements in a file and have them apply to the entire project being compiled? As the documentation says these only apply to the module scope they exist in, and need to be added to the command line otherwise. It would be a bit easier

A D implementation of the Python difflib module's sequence matcher.

2020-02-12 Thread mark via Digitalmars-d-learn
I've just completed my first D package: http://code.dlang.org/packages/ddiff It is a straight port, so it isn't at all functional-style. I'd be happy and interested if anyone could show me how to replace some/all of the for[each] loops (without reducing performance), or for any other code

Some impressions/notes from a new D programmer

2020-02-12 Thread mark via Digitalmars-d-learn
I've been learning D for a few weeks now. I'm an experienced programmer in other languages (esp. Python, but also Rust and C++). Here're some *early* impressions and notes. D Tour I found the D Tour, esp. "D's Basics" to be very helpful. Each part is short and in most cases understandable.

Re: Is there a std.zip.ZipArchive isDir or isFile method?

2020-02-12 Thread cc via Digitalmars-d-learn
It looks like 004 (octal) is the flag for directories on linux, but it does seem that std.zip is explicitly returning 0 if the file was created on the opposite platform re: Posix vs Windows, which is... odd. @property @nogc nothrow uint fileAttributes() const { version (Posix) {

Re: Building for multiple platforms

2020-02-12 Thread Petar via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 12:46:23 UTC, Petar Kirov [ZombineDev] wrote: On Wednesday, 12 February 2020 at 08:41:25 UTC, Neils wrote: [...] Since your project is already on GitHub, I think the easiest solution would be to use GitHub Actions [1] + setup-dlang action [2] +

Re: Building for multiple platforms

2020-02-12 Thread Petar via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 08:41:25 UTC, Neils wrote: I maintain an open-source project written in D and I use DUB for building and my compiler backend is DMD. My dub.json file is rather simple: https://github.com/neilsf/XC-BASIC/blob/master/dub.json I offer pre-built binaries for

Re: How to get Code.dlang.org to update the package?

2020-02-12 Thread Dukc via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 13:05:00 UTC, Petar Kirov [ZombineDev] wrote: On Wednesday, 12 February 2020 at 12:42:32 UTC, Dukc wrote: I have pushed a new release tag in Github around two weeks ago, and ordered a manual update at DUB, yet DUB has still not aknowledged the new tag. Is

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread mark via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 11:46:02 UTC, Dennis wrote: Thanks for your perspective. Just a few things are unclear to me: On Wednesday, 12 February 2020 at 10:39:06 UTC, mark wrote: I don't find the presentation of the member properties and methods very easy to read Can you elaborate

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 10:39:06 UTC, mark wrote: Library Reference Documentation The Library Reference documentation seems to be a mixed bag. Often I've found a good overview at the start, but then few or no examples in the docs for classes and methods (see e.g.,

Re: How to get Code.dlang.org to update the package?

2020-02-12 Thread Petar via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 12:42:32 UTC, Dukc wrote: I have pushed a new release tag in Github around two weeks ago, and ordered a manual update at DUB, yet DUB has still not aknowledged the new tag. Is there some requirement for the release tag for it to be recognized? Hi Dukc, I'm

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 10:39:06 UTC, mark wrote: Library Reference Documentation Have you seen my fork? http://dpldocs.info/experimental-docs/std.zip.ZipArchive.html for example The documentation doesn't seem that easy to use I generated docs for this too

How to set up multi-dimensional DUB package configuration?

2020-02-12 Thread Dukc via Digitalmars-d-learn
My application has two copyright holders, so I want to be able to specify in the build command whose copyright marks get compiled to the program. D part of the application is built by DUB. DUB configurations would do the trick, but they are already used to define different editions of the

How to get Code.dlang.org to update the package?

2020-02-12 Thread Dukc via Digitalmars-d-learn
I have pushed a new release tag in Github around two weeks ago, and ordered a manual update at DUB, yet DUB has still not aknowledged the new tag. Is there some requirement for the release tag for it to be recognized?

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread user1234 via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 15:28:57 UTC, Anonymouse wrote: Maybe there are some hard design decisions again $HOME/.dub/bin, unsure. It might be difficult to globally pull off if programs expect the binary to be placed in the source tree (for resources). [1]:

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread mark via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 14:15:40 UTC, Adam D. Ruppe wrote: On Wednesday, 12 February 2020 at 10:39:06 UTC, mark wrote: Library Reference Documentation Have you seen my fork? http://dpldocs.info/experimental-docs/std.zip.ZipArchive.html Yours is *much* clearer. However, if you

Re: How to set up multi-dimensional DUB package configuration?

2020-02-12 Thread Dukc via Digitalmars-d-learn
Illustration, I want to choose both an edition and marked copyright holder: ``` configuration "inhouse" { targetType "executable" versions "InhouseEdition" } configuration "salesmen" { targetType "executable" versions "SalesmenEdition" } configuration "internet" { targetType

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Anonymouse via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 13:36:13 UTC, mark wrote: Some cargo packages are applications. If I do 'cargo install someapp' it will be installed in $HOME/.cargo/bin. So by simply adding that to my PATH, I can easily use all installed rust apps. But dub doesn't appear to have an

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 18:20:47 UTC, Adam D. Ruppe wrote: Weird, that's a legit bug in there. I'll fix them. h it isn't a bug i just forgot to update the file! that version i had was over a year old. so that's fixed The search is in the upper right unless you resize the

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Schrom, Brian T via Digitalmars-d-learn
I find it incredibly useful to add a query URL to my browser. In manage search engines, I bind l to https://dpldocs.info/%s Then in the url bar, lapi_that_I_want_to_lookup

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Jan Hönig via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 10:39:06 UTC, mark wrote: I've been learning D for a few weeks now. ... I made exactly the same experience in December.

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 15:52:35 UTC, mark wrote: Yours rolls the two examples into one and doesn't show the Standards or Usage sections. Weird, that's a legit bug in there. I'll fix them. I also think you split into more HTML files which I prefer. OTOH yours doesn't have the

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/12/20 10:52 AM, mark wrote: I also think you split into more HTML files which I prefer. FYI, dlang.org has a secondary version of the docs which splits the documents up more: https://dlang.org/library/index.html I can't find a link to it directly from the main page though... This

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread mark via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 18:20:47 UTC, Adam D. Ruppe wrote: On Wednesday, 12 February 2020 at 15:52:35 UTC, mark wrote: Yours rolls the two examples into one and doesn't show the Standards or Usage sections. Weird, that's a legit bug in there. I'll fix them. I also think you split

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 18:39:36 UTC, Steven Schveighoffer wrote: On 2/12/20 10:52 AM, mark wrote: I also think you split into more HTML files which I prefer. FYI, dlang.org has a secondary version of the docs which splits the documents up more:

Type sequence concatenation / associative array implementation

2020-02-12 Thread Marcel via Digitalmars-d-learn
Hello! I have two questions: 1- How can I concatenate two type sequences? 2- How is the builtin associative array implemented? I think I read somewhere it's implemented like C++'s std::unordered_map but with BSTs instead of DLists for handling collisions: is this correct?

Re: Type sequence concatenation / associative array implementation

2020-02-12 Thread user1234 via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 20:58:49 UTC, Marcel wrote: Hello! I have two questions: 1- How can I concatenate two type sequences? alias Concatenated = AliasSeq!(TList1, TList2); or maybe alias Concatenated = AliasSeq!(TList1[0..$], TList2[0..$]); since I don't remember if they nest

Re: Type sequence concatenation / associative array implementation

2020-02-12 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 12, 2020 at 09:05:22PM +, user1234 via Digitalmars-d-learn wrote: > On Wednesday, 12 February 2020 at 20:58:49 UTC, Marcel wrote: > > Hello! > > I have two questions: > > > > 1- How can I concatenate two type sequences? > > alias Concatenated = AliasSeq!(TList1, TList2); [...]

Re: Type sequence concatenation / associative array implementation

2020-02-12 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 20:58:49 UTC, Marcel wrote: 2- How is the builtin associative array implemented? I think I read somewhere it's implemented like C++'s std::unordered_map but with BSTs instead of DLists for handling collisions: is this correct? It's an open-addressed hash

Overfflow in Assert error messages

2020-02-12 Thread Adnan via Digitalmars-d-learn
I am debugging my simple binary search (I still am): module binary_search; debug { static import std; } int indexOf(T)(const T[] list, const T key) { ulong lo = 0; ulong hi = list.length - 1; while (hi > lo) { const ulong mid = lo + (hi - lo) / 2; if (list[mid]

Unpack Variadic Args?

2020-02-12 Thread Jeff via Digitalmars-d-learn
Hello, Was wondering if there was a simple, efficient way to unpack a variadic template argument. It needs to be efficient at runtime, and hopefully not use too much excessive CTFE. C++ has the "..." operator, is there something equivalent in D? template void g(Args... args) {

writeln() in static import std

2020-02-12 Thread Adnan via Digitalmars-d-learn
How can I reach stdout.writeln() using fully qualified name with static import? I have tried: std.stdio.stdout.writeln() -- fails std.writeln() -- works std.stdout.writeln -- works How does static import with std work?