Re: Beerconf June 2022

2022-06-24 Thread rikki cattermole via Digitalmars-d-announce
In celebration of Matariki (the Māori New Year) of the 24th, and Ethan's birthday, lets start Beerconf! So happy birthday Ethan and remember, today is all about togetherness! https://meet.jit.si/Dlang2022JuneBeerConf https://www.newzealand.com/nz/matariki/

Re: Intellij D Language plugin v1.28.1

2022-06-22 Thread rikki cattermole via Digitalmars-d-announce
Very nice. Only one error in about 30 minute time frame. Significantly down! :D Thanks.

Re: Window created with Windows API is not visible

2022-06-18 Thread rikki cattermole via Digitalmars-d-learn
A white content area, means that you didn't draw something. As long as the border ext. is showing up, you're ok.

Re: Window created with Windows API is not visible

2022-06-18 Thread rikki cattermole via Digitalmars-d-learn
registeredClass.style = 32_769; Don't use an integer like that, stick with bit wise ors. LPCWSTR classname = toUTF16z(name); GC owned memory, that could result in surprises. const LPWSTR windowname = toUTF16z(title); Ditto I'm not sure your window callback procedure is right. For

Re: Intellij D Language plugin v1.28.0

2022-06-07 Thread rikki cattermole via Digitalmars-d-announce
Looking good so far! Been watching keenly on this release, cheers!

Re: How to call a GDI+ function from D ?

2022-06-05 Thread rikki cattermole via Digitalmars-d-learn
Bitmap is a class, not a namespace. The function you want is actually a constructor. https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/include/gdiplus/gdiplusheaders.h#L179

Re: Beerconf May 2022

2022-05-28 Thread rikki cattermole via Digitalmars-d-announce
Adam created the link this time: https://meet.jit.si/Dlang2022MayBeerConf No password

Re: What are (were) the most difficult parts of D?

2022-05-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/05/2022 8:22 AM, Chris Piker wrote: Hey thanks!  I bet LDC is pretty cool, have to look into it sometime. For now at my site just introducing D is a bit radical, don't want to capsize the boat by leaving the gcc toolchain altogether.  I'm willing to help out with GDC work were I can,

Re: What are (were) the most difficult parts of D?

2022-05-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/05/2022 8:05 AM, Chris Piker wrote: Vibe.d is well tested against the frontend. Its part of dmd's test suite. See: https://buildkite.com/dlang/dmd/builds/26775 Thanks, that's handy.  Do you know where the equivalent test suite is for gdc? No idea. I've pinged Iain, because you are

Re: What are (were) the most difficult parts of D?

2022-05-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/05/2022 7:24 AM, Chris Piker wrote:    2. Testing common packages against gdc Why? Mostly because I've put in about 15 hours effort so far trying to get a vibe.d based project to build using gdc, with no success. I'm about to give up and declare either gdc or vibe.d unsuitable for

Re: What are (were) the most difficult parts of D?

2022-05-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/05/2022 6:06 AM, Chris Piker wrote:   1. Supporting gdc development and distribution. Iain's workload should be decreasing now that it is using the up to date frontend. Rather than the older C++ version with backports that he has been maintaining. My understanding is that he is

Re: Install DCD language server on Raspberrry PI4 (aarch64) requires rdmd , command not found.

2022-05-21 Thread rikki cattermole via Digitalmars-d-learn
On 22/05/2022 10:44 AM, Alain De Vos wrote: I want to install the DCD language server on Raspberry PI4. But the dub build for DCD requires rdmd which is not available. Can I compile rdmd from source ? Or install a binary ? [PS: I have ldc 1:1.24.0-2 installed ] I grabbed a copy of

Re: A New Game Written in D

2022-05-18 Thread rikki cattermole via Digitalmars-d-announce
On 19/05/2022 7:03 AM, H. S. Teoh wrote: We keep coming back to this impasse: write barriers. It's high time somebody implemented this in a dmd fork so that we can actually test out more advanced GC designs. No. Not dmd. LDC or GDC. DMD is not suitable for experimentation due to the

Re: A New Game Written in D

2022-05-18 Thread rikki cattermole via Digitalmars-d-announce
On 19/05/2022 5:51 AM, Kenny Shields wrote: Also, I know that D has some sort of interface for allowing custom GC implementations -- has anyone ever made a functional alternative? Something that takes the incremental approach that you mentioned as opposed to the pause and scan method?

Re: Installing DMD on linux via snap

2022-05-18 Thread rikki cattermole via Digitalmars-d-learn
Snap package source: https://github.com/dlang-snaps/dmd.snap/ Hasn't been updated in 3 years.

Re: undefined reference to `const const(char)[] object.Throwable.message()

2022-05-17 Thread rikki cattermole via Digitalmars-d-learn
As far as I know, no D compiler guarantees compatibility between objects built on different version of itself. The change would have been[0]. [0] https://github.com/dlang/druntime/commit/c6762914682d4fa894e2b746bf4bd9ce3ec9f7cb

Re: Beta 2.100.0

2022-05-15 Thread rikki cattermole via Digitalmars-d-announce
Its compiled in statically to Phobos (however this may depend on compiler ext.).

Re: Release D 2.100.0

2022-05-15 Thread rikki cattermole via Digitalmars-d-announce
Very excited for this release! Still waiting on a documentation PR for dub, kinda need to get this merged + deployed since the feature is now live. https://github.com/dlang/dub-docs/pull/43

Re: What are (were) the most difficult parts of D?

2022-05-14 Thread rikki cattermole via Digitalmars-d-learn
On 15/05/2022 4:00 AM, eugene wrote: The more I have studied memory allocators & management strategies memory allocators and GC are different things i've had at some point 'free list' based allocator and it worked ~3 times faster than malloc/free when used for classical linked list

Re: What are (were) the most difficult parts of D?

2022-05-14 Thread rikki cattermole via Digitalmars-d-learn
On 15/05/2022 2:51 AM, eugene wrote: On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. Garbage collection. I am not programming languages theorist at at, but my imression is: * GC came from purely

Re: FTP LS

2022-05-14 Thread rikki cattermole via Digitalmars-d-learn
Phobos curl wrapper may be an option: https://dlang.org/phobos/std_net_curl.html#.FTP

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread rikki cattermole via Digitalmars-d-learn
On 13/05/2022 7:03 PM, MichaelBi wrote: On Friday, 13 May 2022 at 06:43:30 UTC, rikki cattermole wrote: On 13/05/2022 6:23 PM, MichaelBi wrote: render!("index.dt", showData()); There ya go, template arguments are run at compile time. Unh, then how to dynamically generate pages

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread rikki cattermole via Digitalmars-d-learn
On 13/05/2022 6:23 PM, MichaelBi wrote:     render!("index.dt", showData()); There ya go, template arguments are run at compile time.

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread rikki cattermole via Digitalmars-d-learn
Okay that is fine, now we need to see where showData is being called.

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread rikki cattermole via Digitalmars-d-learn
On 13/05/2022 5:52 PM, MichaelBi wrote: struct Camera{ @name("_id") BsonObjectID id; // represented as "_id" in the database string brand; string model; } the structure is mapping of database field structure. how to resolve? That code isn't the cause of your issue (its fine,

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-12 Thread rikki cattermole via Digitalmars-d-learn
On 13/05/2022 5:18 PM, MichaelBi wrote:     i have code here:     auto uri = environment.get("MONGODB_URI");     MongoClient conn = connectMongoDB(uri);     MongoDatabase eqpdb = conn.getDatabase("MbEqpHeroku"); the "MONGODB_URI" showed above already put into heroku's app config

Re: Release: serverino - please destroy it.

2022-05-12 Thread rikki cattermole via Digitalmars-d-announce
On 12/05/2022 11:33 PM, Andrea Fontana wrote: Too bad dub doesn't work with wsl, it sounds like a lost opportunity. Does dmd/rdmd work? Serverino uses std.net.curl just for running its unittests, so maybe that bug is not blocking. It doesn't look like it is dub that is failing. This is a

Re: Library associative array project v0.0.1

2022-05-11 Thread rikki cattermole via Digitalmars-d-announce
On 12/05/2022 4:55 AM, templatedperson wrote: for a good reason, the default is the GC. Good reason or not, people sometimes need to do manual memory management. I usually use the GC and like that we have it, but if you care about performance you gotta drop down to manual managements

Re: Library associative array project v0.0.1

2022-05-11 Thread rikki cattermole via Digitalmars-d-announce
On 12/05/2022 3:54 AM, templatedperson wrote: 2. Look at alternatives to GC for allocation/deallocation. Maybe add `@nogc` overloads that take `std.experimental.allocator`s? That could be the best way to accomplish this. That won't help much. The virtual types are not @nogc, and for a

Re: While loop on global variable optimised away?

2022-05-11 Thread rikki cattermole via Digitalmars-d-learn
Compiler optimizations should not be defined by a programming language specification. This will be on LLVM.

Re: range result in Tuple! and how to convert into assocArray by sort?

2022-05-09 Thread rikki cattermole via Digitalmars-d-learn
If I am understanding the problem correctly, this is a super expensive method for doing something pretty simple. Even if it is a bit more code, this won't require memory allocation which in this case wouldn't be cheap (given how big DNA tends to be). string s = "ACGTACGT"; uint[4] counts;

Re: Release: serverino - please destroy it.

2022-05-08 Thread rikki cattermole via Digitalmars-d-announce
On 09/05/2022 11:44 AM, Ali Çehreli wrote: While we are on topic :) and as I finally understood what generational GC is[1], are there any fundamental issues with D to not use one? This is not a D issue, its an implementation one. We don't have write barriers, that's it. Make them opt-in

Re: GCC 12.1 Released (D v2.100-rc.1)

2022-05-06 Thread rikki cattermole via Digitalmars-d-announce
Well done Iain! We should do a celebration party for both it and 2.100.0 release!

Re: D Language Foundation April Quarterly Meeting and Server Meeting Summaries

2022-05-04 Thread rikki cattermole via Digitalmars-d-announce
For me the bug that is potentially limiting me (design wise) is: https://issues.dlang.org/show_bug.cgi?id=21416 #dbugfix Good stuff moving forward and that tool looks interesting to try out.

Re: Beerconf April 2022

2022-04-29 Thread rikki cattermole via Digitalmars-d-announce
On 30/04/2022 5:22 AM, Adam D Ruppe wrote: On Friday, 29 April 2022 at 17:07:27 UTC, rikki cattermole wrote: Password: `dub4life` I see you are gatekeeping to keep a certain clique out! Lol, given the amount of emotions that has gone into it in recent days I got a little inspired as to

Re: Beerconf April 2022

2022-04-29 Thread rikki cattermole via Digitalmars-d-announce
It is that time of the month, once again! Beerconf. https://meet.jit.si/Dlang2022AprilBeerConf Password: `dub4life` See you all there!

Re: CTFE and BetterC compatibility

2022-04-27 Thread rikki cattermole via Digitalmars-d-learn
This works: ```d struct Data { int[] digits; } int parseDigit(char c) pure { return c - '0'; } Data parse(string str) pure { Data data; if (__ctfe) { size_t used; data.digits.length = str.length; while (str.length != 0) { // Skip

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/04/2022 10:05 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:59:39 UTC, rikki cattermole wrote: Putting an int into a ubyte absolutely should error, that is a lossy conversion and should not be automatic. It's just VRP, here it works in 2.094

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/04/2022 9:55 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:44:56 UTC, rikki cattermole wrote: On 27/04/2022 9:39 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:13:38 UTC, Alexander Zhirov wrote: more build errors If you "dub upgrade" it should work a bit

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/04/2022 9:39 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:13:38 UTC, Alexander Zhirov wrote: more build errors If you "dub upgrade" it should work a bit better. No success in reproducing the bug here. It definitely on your end. void main() { int scale; int*

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
No args added there. https://github.com/AuburnSounds/Dplug/blob/master/graphics/dplug/graphics/pngload.d#L1972 Yup that code certainly looks wrong. Note the casts above it in around: https://github.com/AuburnSounds/Dplug/blob/master/graphics/dplug/graphics/pngload.d#L1956 So yeah upstream

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
To get the commands dub used, use -v. $ dub build -v

Re: Beta 2.100.0

2022-04-22 Thread rikki cattermole via Digitalmars-d-announce
This release is very exciting. Semver versioning, lots of shared library support for dub, @mustuse and lots of deprecations + removals.

Re: unexpected noreturn behavior

2022-04-21 Thread rikki cattermole via Digitalmars-d-learn
Could we add a check for this in DScanner? Otherwise I'm not sure how else we are going to find all of these instances and fix them.

Re: unexpected noreturn behavior

2022-04-21 Thread rikki cattermole via Digitalmars-d-learn
noreturn is the bottom type which can implicitly convert to any type, including void. A value of type noreturn will never be produced and the compiler can optimize such code accordingly. https://dlang.org/spec/type.html#noreturn

Re: Create an associative array with function pointers as the value

2022-04-20 Thread rikki cattermole via Digitalmars-d-learn
On 21/04/2022 2:15 AM, rempas wrote: Unfortunately, this will not work for me as it uses "TypeInfo" and it is not available with "-betterC". Thank you for trying to help regardless! You can't use AA's in -betterC. The implementation is not templated and is in druntime.

Re: one liner to split a string into every n chars?

2022-04-13 Thread rikki cattermole via Digitalmars-d-learn
One way you can do it: import std.range : chunks; import std.algorithm : map; import std.array : array; import std.conv : text; string[] split = "Hello D".chunks(2).map!(v => v.text).array; writeln(split); foreach(val; "Hello D".chunks(2)) { writeln(val.text); }

Re: Why do immutable variables need reference counting?

2022-04-10 Thread rikki cattermole via Digitalmars-d-learn
Storage classes like immutable/const/shared are not tied to any memory management strategy. Nor does it dictate memory lifetime. It only dictates how it can be interacted with when you have a reference to it.

Re: Why do immutable variables need reference counting?

2022-04-10 Thread rikki cattermole via Digitalmars-d-learn
immutable isn't tied to lifetime semantics. It only says that this memory will never be modified by anyone during its lifetime. Anyway, the real problem is with const. Both mutable and immutable become it automatically.

Re: D Language Foundation Monthly Meeting Summary for March 2022

2022-04-04 Thread rikki cattermole via Digitalmars-d-announce
## Razvan ### Reference counting Going through some old DRuntime pull requests, Razvan found several PRs adding reference-counted things (RCArray, RCPointer, etc) from a period when reference counting was a hot topic in the D community. The problem with reference counting in D has been the

Re: Where I download Digital Mars C Preprocessor sppn.exe?

2022-04-02 Thread rikki cattermole via Digitalmars-d-learn
What on earth are you talking about. ImportC is highly experimental and was announced far too soon. If you look at the last release a very large number of the bug fixes were for ImportC specifically. https://dlang.org/changelog/2.099.0.html#bugfix-list

Re: Beerconf March 2022

2022-03-26 Thread rikki cattermole via Digitalmars-d-announce
Hello hello hello! Beerconf is inviting you to a meeting. Join the meeting: https://meet.jit.si/Dlang2022MarchBeerConf Password: `ValueTypeExceptions` **How do I join?** You'll need to have a [compatible browser](https://jitsi.github.io/handbook/docs/user-guide/supported-browsers) to

Re: DIP 1035, "@system Variables", Formal Assessment Has Begun

2022-03-23 Thread rikki cattermole via Digitalmars-d-announce
Changes look good +1

Re: I like dlang but i don't like dub

2022-03-21 Thread rikki cattermole via Digitalmars-d-learn
On 21/03/2022 11:19 PM, Tobias Pankrath wrote: This would be much easier, if there were a `dub provide` (or whatever) that builds all deps for a project, installs them into a given prefix/path and makes them usable from `dub describe` afterwards, so that dub describe works more or less like

Re: freebsd dub linker error

2022-03-17 Thread rikki cattermole via Digitalmars-d-learn
On 18/03/2022 5:56 PM, rikki cattermole wrote: Are you trying to build dub on Android? Android support for ldc is currently broken to due to removal of a linker that is currently required for TLS support. https://github.com/ldc-developers/ldc/issues/3918 My bad I didn't see FreeBSD.

Re: freebsd dub linker error

2022-03-17 Thread rikki cattermole via Digitalmars-d-learn
Are you trying to build dub on Android? Android support for ldc is currently broken to due to removal of a linker that is currently required for TLS support. https://github.com/ldc-developers/ldc/issues/3918

Re: Make shared static this() encoding table compilable

2022-03-14 Thread rikki cattermole via Digitalmars-d-learn
The recommended solution by Unicode is to use Trie tables for Look Up Tables (LUTs). https://en.wikipedia.org/wiki/Trie You can generate these as read only global arrays and are very fast for this.

Re: Beta 2.099.0

2022-02-17 Thread rikki cattermole via Digitalmars-d-announce
There are a few goodies hiding in the nightlies that didn't make it into the beta. Stuff like https://issues.dlang.org/show_bug.cgi?id=18362 And https://dlang.org/changelog/pending.html#actual-dynamiclibrary (which I did :3) This is gonna be a good release I think!

Re: DConf 2022 in London?

2022-02-16 Thread rikki cattermole via Digitalmars-d-announce
On 17/02/2022 6:37 PM, StarCanopy wrote: On Tuesday, 15 February 2022 at 12:22:05 UTC, Mike Parker wrote: [...] I regret not getting into D sooner, when I could have driven to a dconf. There will be plenty of stuff online. Depending on how BeerConf will be scheduled I'm sure we could do

Re: Offline D documentation/tutorial

2022-02-12 Thread rikki cattermole via Digitalmars-d-learn
There are some files available at https://d-apt.sourceforge.io/

Re: DIP 1038--"@mustUse" (formerly "@noDiscard")--Accepted

2022-02-09 Thread rikki cattermole via Digitalmars-d-announce
On 10/02/2022 5:21 AM, Paul Backus wrote: - C (gcc/clang): __attribute__((warn_unused_result)) C23 will also have [[nodiscard]] Not only will it have that on functions, but also support a string too. Unfortunately its looking like we have chosen to diverge from C, and therefore won't be

Re: Beerconf January 2022

2022-01-29 Thread rikki cattermole via Digitalmars-d-announce
BeerConf is among us once again! https://meet.jit.si/Dlang2022JanuaryBeerConf Password: @mustUse

Re: All Community Discord channels are now being bridged to Matrix

2022-01-15 Thread rikki cattermole via Digitalmars-d-announce
On 16/01/2022 12:45 PM, Ali Çehreli wrote: On 1/15/22 10:45, WebFreak001 wrote: > we have now bridged all the Discord rooms to Matrix rooms. What does all that mean? Is that something that only Discord users should understand be interested in? :) Ali This is for Matrix users, so that

Re: DMD now incorporates a disassembler

2022-01-08 Thread rikki cattermole via Digitalmars-d-announce
On 09/01/2022 4:01 PM, Walter Bright wrote: I buried my PDP-11 long ago. Sob. There is a kit for the control panel[0]. Backed by a raspberry pi. I'm pretty keen to eventually buy one and build it. These kits are cool! [0]

Re: First time using Parallel

2021-12-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/12/2021 12:10 AM, max haughton wrote: I would start by removing the use of stdout in your loop kernel - I'm not familiar with what you are calculating, but if you can basically have the (parallel) loop operate from (say) one array directly into another then you can get extremely good

Re: Double bracket "{{" for scoping static foreach is no longer part of D

2021-12-22 Thread rikki cattermole via Digitalmars-d-learn
Seems to be working just fine as of 2.098. ```d import std; void main() { static foreach(Foo; ["Abc", "def"]) {{ string str = Foo; writeln("Hello D ", str, __VERSION__); }} } ``` ``` Hello D Abc2098 Hello D def2098 ``` Anyway, AliasAssign has nothing to do with this.

Re: How to pass a class by (const) reference to C++

2021-12-15 Thread rikki cattermole via Digitalmars-d-learn
On 15/12/2021 11:54 PM, Jan wrote: On Wednesday, 15 December 2021 at 09:36:54 UTC, Jan wrote: Unfortunately it's the "annoying little details" that I immediately bumped into. Just another example: I just learned that linking against C++ DLLs is quite limited. I ran into the issue that

Re: d strings are the bane of my existance

2021-12-05 Thread rikki cattermole via Digitalmars-d-learn
The string is not the problem. ```d string ip_address = "192.168.1.1"; auto x = new InternetAddress(ip_address, 8008); ``` That works. A string in D is an alias for immutable(char)[]. This is defined in druntime (object.d). Immutable does cast to const implicitly, so a string argument to

Re: Classes in D with betterC

2021-11-20 Thread rikki cattermole via Digitalmars-d-announce
On 21/11/2021 3:13 PM, russhy wrote: betterC already is niche on its own, so let's do the move? Except -betterC is not niche at all. It is simply the language with any of the runtime dependencies disabled. No language level changes have to be made for this. Both full D and -betterC should

Re: Beerconf for Dconf

2021-11-20 Thread rikki cattermole via Digitalmars-d-announce
It is 2 hours before DConf starts! I welcome everyone to hope on over to Discord and join our General voice channel while we wait for the action to begin.

Re: Dub says that there is an invalid semVer format, but I don't see how.

2021-11-19 Thread rikki cattermole via Digitalmars-d-learn
Don't use ~> for branches. alpha@DESKTOP-RB97SA4 /tmp/dutils $ dub build Invalid SemVer format: stable.0.0 alpha@DESKTOP-RB97SA4 /tmp/dutils $ nano dub.json alpha@DESKTOP-RB97SA4 /tmp/dutils $ dub build Performing "debug" build using C:\Tools\D\dmd_2.097.2\windows\bin\dmd.exe for

Re: Dub says that there is an invalid semVer format, but I don't see how.

2021-11-10 Thread rikki cattermole via Digitalmars-d-learn
On 11/11/2021 2:13 PM, Ruby The Roobster wrote: Branch ~master: Invalid SemVer format: testing.0.0 Branch ~testing: Invalid SemVer format: testing.0.0 Version 0.1.2: Invalid SemVer format: testing.0.0 testing is a branch. You are using ~>testing for it. To use a branch in the SEMVER is

Re: Crosscompile to Windows

2021-11-08 Thread rikki cattermole via Digitalmars-d-learn
On 09/11/2021 12:44 PM, Luis wrote: It should work with the last version of DMD : https://dlang.org/changelog/2.098.0.html#target It won't. https://github.com/dlang/dub/blob/master/source/dub/compilers/dmd.d#L111

Re: Crosscompile to Windows

2021-11-07 Thread rikki cattermole via Digitalmars-d-learn
On 08/11/2021 11:34 AM, Imperatorn wrote: On Sunday, 7 November 2021 at 22:19:08 UTC, russhy wrote: If i remember correctly, all you have to do is:     dub build --arch=x86_64-pc-windows-msvc --compiler=ldc2 Is this information on dub.pm? If not, we should add it.  This is compiler

Re: Average function using Variadic Functions method

2021-11-02 Thread rikki cattermole via Digitalmars-d-learn
You probably don't want to be using C variadics. Instead try the typed one: float mean(float[] input...) { // you don't want to divide by zero if (input.length == 0) return 0; float temp = 0; // floats and double initialize to NaN by default, not

Re: __cpuid like in C

2021-11-01 Thread rikki cattermole via Digitalmars-d-learn
I think you are wanting this? https://dlang.org/phobos/core_cpuid.html#.processor

Re: tkd does not build anymore after 2.096

2021-10-12 Thread rikki cattermole via Digitalmars-d-learn
The repo itself hasn't been archived as of this writing. So a PR may succeed. But yeah the guy is gone by the looks. If he is willing this could be a possible candidate for moving it to dlang-community although it'll need someone to shepherd it. https://github.com/nomad-software/tkd

Re: Beerconf September 2021

2021-09-27 Thread rikki cattermole via Digitalmars-d-announce
On 27/09/2021 7:05 AM, Brian wrote: What is Beefconf, indeed. Are we getting an additional online meetup this month? :) Considering I was running polls about giving beef to dogs during BeerConf, I'm afraid that it has already passed. But maybe we can do something impromptu on Discord in

Re: Beerconf September 2021

2021-09-23 Thread rikki cattermole via Digitalmars-d-announce
The link will be added closer to the time (its immediately available). From there, just use a compatible web browser.

Re: uint overflow behaviour

2021-09-15 Thread rikki cattermole via Digitalmars-d-learn
https://dlang.org/spec/expression.html#add_expressions "7. If both operands are of integral types and an overflow or underflow occurs in the computation, wrapping will happen. For example, uint.max + 1 == uint.min, uint.min - 1 == uint.max, int.max + 1 == int.min, and int.min - 1 == int.max."

Re: Development of the foundation of a programming language

2021-09-12 Thread rikki cattermole via Digitalmars-d-learn
On 13/09/2021 3:21 PM, leikang wrote: Are there any recommended books or videos to learn about the principles of compilation? What else should I learn besides the principles of compilation? The classic book on compilers that Walter recommends is the dragon book.

Re: DMD compiler - warning of unused variables

2021-08-16 Thread rikki cattermole via Digitalmars-d-learn
No. https://github.com/dlang-community/D-Scanner#implemented-checks

Re: What exactly are the String literrals in D and how they work?

2021-08-15 Thread rikki cattermole via Digitalmars-d-learn
On 15/08/2021 8:11 PM, rempas wrote: Still don't know what "pragma" does but thank you. pragma is a set of commands to the compiler that may be compiler specific. In the case of the msg command, it tells the compiler to output a message to stdout during compilation.

Re: Any UML generators for D code?

2021-08-12 Thread rikki cattermole via Digitalmars-d-learn
On 13/08/2021 9:40 AM, russhy wrote: also this but it's pretty old: https://github.com/rikkimax/Duml It was a neat idea duml of mine, but I wouldn't recommend going down the path of CTFE for this. Best to write a tool using dmd-fe instead.

Re: I do not understand copy constructors

2021-08-12 Thread rikki cattermole via Digitalmars-d-learn
On 12/08/2021 9:36 PM, Learner wrote: It seems that there is no easy way to transition from a postblit to a copy constructor, no? struct Foo { this(ref Foo other) { foreach(i, v; other.tupleof) this.tupleof[i] = v; } @disable

Re: Beta 2.097.2

2021-08-09 Thread rikki cattermole via Digitalmars-d-announce
On 10/08/2021 4:32 AM, Tejas wrote: Just switch to LDC? The discussion on bugzilla seems to conclude that its purely DMD backend problem. While that is a good workaround to issues like this, dmd-be does need to be fixed regardless.

Re: seeking advice: possible new @attribute to mark class' default property to avoid alias this ?

2021-08-07 Thread rikki cattermole via Digitalmars-d-learn
So a field that will automatically be resolved to as part of the behavior of generated toString methods. That really isn't what alias this is used for commonly. I.e. struct ValueReference { private { SomethingElse* impl; } bool isNull() { return impl is

Re: Social chat in the forums

2021-08-01 Thread rikki cattermole via Digitalmars-d-learn
On 02/08/2021 9:19 AM, Brian Tiffin wrote: Question, or suggestion.  In the Community forums, there is General and Announce. Announce is only for announcements. General is used sometimes for OT stuff, like I've congratulated Andrei on the birth of one of his kids (I asked prior). Or some

Re: Two major problems with dub

2021-08-01 Thread rikki cattermole via Digitalmars-d-learn
On 02/08/2021 5:18 AM, Alain De Vos wrote: A simple and small wrapper around for instance the C-library libpq should be part of the language itself and should not pull in more than libpq itself. Just so that we are all using the same terminology. A binding defines the functions and types

Re: GREETINGS FROM iSTANBUL

2021-08-01 Thread rikki cattermole via Digitalmars-d-learn
It appears you are using the wrong lowercase character. https://en.wikipedia.org/wiki/Dotted_and_dotless_I From a quick experiment, it appears std.uni is treating the upper case dotted I's lower case as a grapheme. Which it probably shouldn't be as there is an actual character for that. We

Re: How to put an arbitrary string to clipboard in D?

2021-07-31 Thread rikki cattermole via Digitalmars-d-learn
On 01/08/2021 6:30 AM, tastyminerals wrote: So I thought there may be a way in D to communicate with the system clipboard... No, this requires a windowing library and yes a window to do it (depending on the windowing system and even the desktop environment).

Re: How to put an arbitrary string to clipboard in D?

2021-07-30 Thread rikki cattermole via Digitalmars-d-learn
On 31/07/2021 7:33 AM, tastyminerals wrote: I made a GUI app using tkd library. I am reading the string from one of the app widgets and would like to put it into the clipboard. Does anyone have an idea how to copy a string to the clipboard in D? copyText on a Text widget appears to do what

Re: enum true, or 1

2021-07-21 Thread rikki cattermole via Digitalmars-d-learn
On 22/07/2021 3:44 PM, Brian Tiffin wrote: What is the preferred syntax for simple on/off states?  Did I read that D was moving to strictly 1 and 0 literals instead of true/false on/off yes/no? This is the first time I'm hearing about it, so almost certainly no.

Re: Creating immutable arrays in @safe code

2021-07-17 Thread rikki cattermole via Digitalmars-d-learn
On 18/07/2021 12:56 AM, Dennis wrote: I don't know whether the spec or code is correct. Unless otherwise specified, the code is authoritative.

Re: Module import failing after $ dub add mypackage

2021-07-16 Thread rikki cattermole via Digitalmars-d-learn
On 17/07/2021 3:31 AM, Scotpip wrote: In dub.sdl I see: ```dependency "msgpack-d" version="~>1.0.3"``` In dub.selections.json I see: ``` { "fileVersion": 1, "versions": {     "msgpack-d": "1.0.3" } } ``` Okay, its been added to your dub project. So far so good. When I

Re: Beerconf July 2021

2021-07-16 Thread rikki cattermole via Digitalmars-d-announce
On 16/07/2021 11:45 PM, Iain Buclaw wrote: Just a forewarning, it was brought to my attention last month that for some people, Beerconf would fall on the Sunday/Monday 25-26th for them. Why?  If you're living in Apia, Saturday 24th July would begin on Friday 23rd at 13:00 CEST, while in

Re: Documentation

2021-07-15 Thread rikki cattermole via Digitalmars-d-learn
Different doc generators, same source. DDOC (phobos) and DDOX (library). There is also adrdox[0] whose site does dub libraries also. [0] https://dpldocs.info/

Re: LDC 1.27.0-beta3

2021-07-14 Thread rikki cattermole via Digitalmars-d-announce
Will -fvisibility=public support be upstreamed into dmd? If yes, it might be worth it to get rid of export as a keyword out right in a DIP (as it introduces the possibility of linker errors that would otherwise not need to exist).

Re: Where is "open" in "core.sys.linux.unistd"?

2021-07-09 Thread rikki cattermole via Digitalmars-d-learn
On 10/07/2021 2:51 AM, rempas wrote: The file can be found quickly [here](https://github.com/dlang/druntime/blob/master/src/core/sys/posix/unistd.d) or in your system if you want. Now the question is, why isn't there an "open" function for the equivalent system call? "close", "write", "read"

Re: LWDR (Light Weight D Runtime) v0.3.0

2021-07-09 Thread rikki cattermole via Digitalmars-d-announce
On 10/07/2021 2:30 AM, lili wrote: Why standard D Runtime can not run on MCU? It requires things like threads. Basically it assumes there is a kernel. Anyway, you don't want the regular runtime on a MCU, a MCU is too small in memory to really hold it all and your own logic and any

<    1   2   3   4   5   6   7   8   9   10   >