On Tuesday, 23 May 2023 at 02:58:21 UTC, John Xu wrote:
What is the best way to convert a GBK/GB18030 file contents,
i.e. read via: std.stdio.read(gbkFile).to!string ,
to utf8 encoding ?
I don't think we have any implementation of that encoding yet. If
you decide to make your own, don't
On Saturday, 29 April 2023 at 11:45:24 UTC, Per Nordlöw wrote:
Does anybody know of an autoformatted of SDLang, specifically
for dub.sdl?
just made a small tool for it: https://github.com/Pure-D/sdlfmt
On Wednesday, 12 April 2023 at 12:00:14 UTC, Vino wrote:
Hi All,
Can some point me where i can find examples on how to use
mir-ion YAML
From,
Vino.B
documentation is very sparse, but essentially with mir-ion you
import the different ser/deser packages that you would like to
use. If you
On Tuesday, 28 March 2023 at 05:05:58 UTC, Alexander Zhirov wrote:
On Tuesday, 28 March 2023 at 00:51:43 UTC, Steven Schveighoffer
wrote:
auto uuid = UUID(*cast(ubyte[16]*)youruuiddata.ptr);
```d
ubyte[] arr =
cast(ubyte[])value.attributes["objectGUID"][0].dup;
On Tuesday, 28 March 2023 at 04:22:24 UTC, Richard (Rikki) Andrew
Cattermole wrote:
On 28/03/2023 2:25 PM, ryuukk_ wrote:
On Tuesday, 28 March 2023 at 01:06:50 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Have you tried installing mago?
https://github.com/rainers/mago
There are instructions
On Tuesday, 28 March 2023 at 01:04:19 UTC, ryuukk_ wrote:
I've now waste an entire day trying to figure out what's wrong,
perhaps trusted D for my projects was a bad idea, i now look
like a fool
sorry to hear that, I haven't really been looking to much into
the debugging problems here yet.
I just first time used importC in a prototype project I just
worked on. I used it to just import `libevdev.h` on linux to
register a custom input device / make a simple userspace input
driver.
Now libevdev comes with two header files: libevdev.h and
libevdev-uinput.h
Q1) Since
On Friday, 2 December 2022 at 04:14:37 UTC, kinke wrote:
On Friday, 2 December 2022 at 00:24:44 UTC, WebFreak001 wrote:
I want to use the static initializers (when used with an UDA)
as default values inside my SQL database.
See
On Thursday, 1 December 2022 at 23:02:31 UTC, kinke wrote:
On Thursday, 1 December 2022 at 08:09:05 UTC, WebFreak001 wrote:
[...]
AFAIK, there is no way. Unlike a struct's init symbol, a class'
one doesn't necessarily represent a valid instance state - it's
just the raw payload before
I've got this class definition:
```d
class X
{
this()
{
assert(false);
}
int x = 3;
}
```
due to internal reasons the constructor would fail at compile
time, so I put in an assert(false) here, and I can't add or
change any methods in X.
How do I get `3` if I have
note: all of these functions are prefixed with `scope:`
it seems now when trying to cover scope semantics, @safe/@system
and pure it already becomes quite unmanagable to implement
opApply properly.
Right now this is my solution:
```d
private static enum opApplyImpl = q{
int result;
foreach (string key, ref value; this.table) {
result =
On Monday, 8 August 2022 at 00:23:52 UTC, pascal111 wrote:
On Monday, 8 August 2022 at 00:20:53 UTC, pascal111 wrote:
On Monday, 8 August 2022 at 00:12:07 UTC, Emanuele Torre wrote:
[...]
So, the reason is the toolkit. I guessed D has specific
library for GUI, and with that I judged D as
On Monday, 8 August 2022 at 05:38:31 UTC, rempas wrote:
In the following struct (as an example, not real code):
```
struct TestArray(ulong element_n) {
int[element_n] elements;
this(string type)(ulong number) {
pragma(msg, "The type is: " ~ typeof(type).stringof);
}
}
```
I want to
On Thursday, 21 April 2022 at 12:28:37 UTC, rikki cattermole
wrote:
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.
What would you expect for this code?
```d
struct Something(Types...) {}
enum isSomethingExact(T) = is(T == Something!Types, Types...);
enum isSomething(T) = is(T : Something!Types, Types...);
pragma(msg, isSomethingExact!noreturn);
pragma(msg, isSomething!noreturn);
```
This currently outputs
On Tuesday, 25 January 2022 at 09:48:25 UTC, forkit wrote:
so I'm trying to write (or rather learn how to write) a
'variadic template function', that returns just one of its
variadic parameter, randomly chosen.
But can't get my head around the problem here :-(
.. Error: template
On Tuesday, 25 January 2022 at 12:27:16 UTC, Dennis wrote:
On Tuesday, 25 January 2022 at 12:11:01 UTC, JG wrote:
Any ideas how one can achieve what is written in the subject
line?
```D
void f(T...)(auto ref T args, string file = __FILE__, int line
= __LINE__)
{
writeln(file, ":", line,
On Tuesday, 25 January 2022 at 09:48:25 UTC, forkit wrote:
so I'm trying to write (or rather learn how to write) a
'variadic template function', that returns just one of its
variadic parameter, randomly chosen.
But can't get my head around the problem here :-(
.. Error: template
On Sunday, 2 January 2022 at 17:27:53 UTC, Amit wrote:
Hi!
I would like to print a string in the same format that I would
write it in the code (with quotes and with special characters
escaped). Similar to [Go's %q
format](https://pkg.go.dev/fmt#hdr-Printing). Is there a safe,
built-in way
On Thursday, 23 December 2021 at 08:33:17 UTC, zoujiaqing wrote:
C++ Code:
```cpp
std::tuple DoIt()
{
return {false, 0, 0, "Hello"};
}
auto [r1, r2, r3, r4] = DoIt();
if (r1 == false)
```
D Code:
```D
Tuple!(bool, int, int, string) DoIt()
{
return [false, 1, 1, "Hello"];
}
auto
On Wednesday, 22 December 2021 at 20:14:01 UTC, Dr Machine Code
wrote:
it differ from assert because it contains the expression, file
and line information. See this
https://stackoverflow.com/questions/14420857/check-expect-example-in-racket
what's the closest thing we have in D? can we make it
On Wednesday, 15 December 2021 at 11:36:41 UTC, Manfred Nowak
wrote:
On Tuesday, 14 December 2021 at 08:28:01 UTC, WebFreak001 wrote:
[...]
Alternatively, remove the template `()` from your `struct
Header`
What is the semantic sense of a template having no parameters?
Although the
On Tuesday, 14 December 2021 at 08:44:02 UTC, rumbu wrote:
I am trying to understand why in this two different cases
(Simple and Complex), the compiler behaviour is different.
```d
struct SimpleStruct { int x;}
struct ComplexStruct { int[] x; }
void main()
{
SimpleStruct[] buf1;
On Tuesday, 14 December 2021 at 08:12:04 UTC, zoujiaqing wrote:
My code:
```D
module http.HttpRequest;
import std.container;
import std.array : Appender;
struct HttpRequest
{
struct Header()
{
Appender!string name;
Appender!string value;
}
string method;
On Monday, 13 December 2021 at 22:43:14 UTC, forkit wrote:
[...]
//char* w = cast(char*)str; // nope. a pointer to a string
constant is
// (supposed to be) immutable,
so expect undefined behaviour.
note:
//char* w = cast(char*)str.toStringz; // also
On Monday, 13 December 2021 at 11:09:18 UTC, drug wrote:
On 13.12.2021 13:49, forkit wrote:
On Monday, 13 December 2021 at 09:49:05 UTC, forkit wrote:
char* w = cast(char*)str.toStringz; // this seems to be the
solution
class has ended ;-)
That's because `str` is initialized by a
On Monday, 15 November 2021 at 19:24:56 UTC, Sebastiaan Koppe
wrote:
On Monday, 15 November 2021 at 15:56:57 UTC, WebFreak001 wrote:
is this currently possible or maybe possible with DIP1000?
Yes it is. But besides `-dip1000` and `@safe`, it requires the
use of a pointer:
```D
@safe:
I have an API with some struct like a file reader. I want to add
byChunks-like functionality to it, so I'm trying to implement it
with a helper struct that implements opApply. I have disabled
copying the file reader struct because it cleans up the resources
once it goes out of scope, however
On Monday, 1 November 2021 at 16:16:12 UTC, Arsium wrote:
On Monday, 1 November 2021 at 16:02:20 UTC, Paul Backus wrote:
On Monday, 1 November 2021 at 16:00:05 UTC, Arsium wrote:
Hello,
Currently, I'm working to implement myself WinAPI functions.
However, I could not find anything matching
On Friday, 22 October 2021 at 11:42:34 UTC, greenbyte wrote:
Hi, all!
I use the hunt-entity library to work with MySQL. I get the
hunt.Exceptions.TimeoutException: "Timeout in 30 secs" when
trying to connect. I configured MySQL and ran the code from the
instructions
On Wednesday, 13 October 2021 at 02:03:30 UTC, rikki cattermole
wrote:
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
On Sunday, 3 October 2021 at 22:27:20 UTC, Tim wrote:
On Sunday, 3 October 2021 at 22:26:15 UTC, Imperatorn wrote:
On Sunday, 3 October 2021 at 22:21:45 UTC, Tim wrote:
[...]
You don't say which operating system you are using.
I usually use Visual D which works great imo.
If I use vscode I
On Wednesday, 29 September 2021 at 04:24:13 UTC, Chris Piker
wrote:
Hi D
I'm to give a presentation to a combined NASA/ESA group in a
few hours and would like to include a copy of the D "rocket"
logo when mentioning new server side tools that I've written in
D. Is such use of this
On Saturday, 4 September 2021 at 15:41:51 UTC, eXodiquas wrote:
Hello everyone,
I created a small little D program that reads in a string from
the command line and shuffles the letters of the nouns a bit
around. This is pretty straight forward, but what I see now
happening is a bit strange,
On Wednesday, 25 August 2021 at 15:30:57 UTC, Steven
Schveighoffer wrote:
[...]
Another approach is to let the compiler deal with the error
handling and not muddy your return type. Swift does something
similar, where it rewrites the throw/catch into a standard
return and doesn't do actual
On Wednesday, 25 August 2021 at 14:52:34 UTC, Steven
Schveighoffer wrote:
On 8/25/21 10:42 AM, Steven Schveighoffer wrote:
I think it's possible to work with some mechanics that aren't
necessarily desirable. Something like:
One has to weigh how much this is preferred to actual exception
On Wednesday, 25 August 2021 at 14:42:07 UTC, Steven
Schveighoffer wrote:
On 8/25/21 10:22 AM, Paul Backus wrote:
On Wednesday, 25 August 2021 at 14:04:54 UTC, WebFreak001
wrote:
[...]
Probably the only principled way to make this work would be to
define some kind of "concept"/structural
On Monday, 23 August 2021 at 17:59:44 UTC, Mahdi wrote:
I made this video for people asking how to configure Dlang in
Emacs environment:) :
https://peertube.linuxrocks.online/w/62pWpmw2r4Se1XvmYiWm75
cool, I think you might wanna post this in General or Announce
instead so more people see
On Wednesday, 25 August 2021 at 14:22:26 UTC, Paul Backus wrote:
On Wednesday, 25 August 2021 at 14:04:54 UTC, WebFreak001 wrote:
[...]
Probably the only principled way to make this work would be to
define some kind of "concept"/structural interface that's
recognized by the compiler to mean
Would it be possible to extend `scope(exit)` and `scope(success)`
to trigger properly for functions returning `Expected!T` as
defined in the
[expectations](https://code.dlang.org/packages/expectations) and
[expected](https://code.dlang.org/packages/expected) DUB
libraries?
For example is it
On Friday, 20 August 2021 at 17:39:29 UTC, JG wrote:
On Friday, 20 August 2021 at 10:50:12 UTC, WebFreak001 wrote:
On Wednesday, 18 August 2021 at 19:51:00 UTC, JG wrote:
[...]
There might be incompatibilities with how openssl is used and
the installed openssl version or config.
If you
On Wednesday, 18 August 2021 at 19:51:00 UTC, JG wrote:
Hi,
We are intermittently getting the following error:
Accept TLS connection: server
OpenSSL error at ../ssl/record/rec_layer_s3.c:1543:
error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert
certificate unknown (SSL alert number 46)
On Friday, 30 July 2021 at 23:48:41 UTC, solidstate1991 wrote:
I'm doing some audio-related work, and one thing I need is to
unregister from (and maybe later temporarily re-register to)
the GC, since it would cause some issues, and it would be nice
if I still could use the GC during disk
On Friday, 30 July 2021 at 06:00:41 UTC, dangbinghoo wrote:
hi, is there any D compiler option or other method to view the
final template instantiation but not compiled (in asm or
binary) code?
if there's a way, it might be very usefull for newbies like me
to learn and understand the the
On Tuesday, 29 June 2021 at 16:25:09 UTC, vnr wrote:
Hello
I have a bit of a problem that seems simple enough, but I can't
find an answer to my questions. On my website, I have two
textareas that the user can write on. When the user reloads the
page or closes it and then reopens it, the
On Tuesday, 29 June 2021 at 19:05:43 UTC, WebFreak001 wrote:
[...]
I should add that this is a convenience feature for users and you
should avoid setting this unless it absolutely doesn't make sense
that stuff is prefilled for the user.
It's there to keep input in case you accidentally
On Thursday, 17 June 2021 at 16:26:57 UTC, JG wrote:
[...]
Thanks, this works. I would have thought this would be a common
enough use case to have support in diet. Anyone else wanted
this?
Opened an issue here:
https://github.com/rejectedsoftware/diet-ng/issues/91
On Thursday, 17 June 2021 at 08:23:54 UTC, JG wrote:
Suppose I have an array of attributes and values v is there any
way to apply these attributes to a tag?
So that something like
tag(#{v[0]0]}=#{v[0][1]},...})
becomes
where v[0][0]="attribute0" and v[0][1]="value0"?
I think there is
On Sunday, 13 June 2021 at 12:46:29 UTC, Financial Wiz wrote:
What are some of the best Financial Libraries for D? I would
like to be able to aggregate as much accurate information as
possible.
Thanks.
if you want a type-safe money handling type, try
https://code.dlang.org/packages/money
On Thursday, 3 June 2021 at 00:39:04 UTC, vacuum_tube wrote:
I've been trying to make a struct for CSV parsing and
manipulating. The code was as follows:
```
struct CSVData(bool HeaderFromFirstLine)
{
char[][] header = [];
char[][][] rest = [];
```
[...]
additionally to the
On Monday, 26 April 2021 at 18:45:08 UTC, Christian Köstlin wrote:
Does anybody use serve-d with emacs (lsp-mode or eglot)?
I would love to see the configuration!
Kind regards,
Christian
if you configure it yourself, feel free to share the
configuration and maybe PR it to serve-d repo.
On Thursday, 8 April 2021 at 03:57:23 UTC, Brad wrote:
I am trying to take an array and convert it to a string. I
know that Split will let me easily go the other way. I
searched for the converse of Split but have not been able to
locate it. I can think of two brute force methods of doing
On Tuesday, 30 March 2021 at 19:02:09 UTC, novice2 wrote:
[...]
Strange syntax.
Behavour exactly what i want, but this code not works for me :(
enum Xobj : void*;
Xobj var; //DMD Error: enum test7.Xobj forward reference of
Xobj.init
You can add a custom init value if you want to allow
On Tuesday, 30 March 2021 at 13:28:55 UTC, novice3 wrote:
Hello.
When i adapt C code, i see new type creation:
typedef void* Xobj;
Or code like this:
struct _Xobj;
typedef struct _Xobj *Xobj;
I want create derived type in D, found std.typecons.Typedef
template, and write:
alias
On Monday, 16 November 2020 at 01:38:10 UTC, data pulverizer
wrote:
Hi All,
On VS Code "D Language utility extension pack", I notice that
if I open a random D file, on the bottom left of the IDE, a
message says "D: workspace/(0.0%): starting up...". It stays at
0.0% and doesn't go away and
On Tuesday, 6 October 2020 at 22:18:39 UTC, Alaindevos wrote:
I have a large table consisting of two columns.One with
words.Another with frequencies. I want to sort them efficiently
according to the names or frequency.
For this I need an efficient sort function where I can plugin
my proper
On Thursday, 1 October 2020 at 08:24:42 UTC, ab wrote:
On Thursday, 1 October 2020 at 06:32:23 UTC, Robert M. Münch
wrote:
3. Vibe can't handle GET & POST on the same URL...
we solved this one as well: fortunately (and: of course) vibe
can handle this.
what lead us to believe otherwise,
On Thursday, 24 September 2020 at 11:15:11 UTC, ddcovery wrote:
[...]
Example: I tried with a global function
Dot!R dt(alias fun, T, R)(Dot!T t){
auto f = cast(R function(T)) unaryFun!fun;
return t.dot!R(f);
}
[...]
the problem is the template can't automatically determine the
type "R".
On Saturday, 19 September 2020 at 08:26:36 UTC, Imperatorn wrote:
What are some good examples of pretty large/medium size, good
structured repos in D? I'm looking for examples to learn from
Thanks!
I would include vibe.d in there of course!
https://github.com/vibe-d/vibe.d
Some legacy
On Thursday, 17 September 2020 at 18:29:12 UTC, bauss wrote:
Does vibe.d not work properly with ex. mp4 files?
I have a consistent issues that it will only play part of video
files in the browser.
As if it won't "stream" the rest of the video.
Is that a problem with vibe.d or is it some
On Thursday, 17 September 2020 at 16:00:33 UTC, wjoe wrote:
I found this [1] but unfortunately the post this refers to is a
dead link and the content, unfortunately, didn't tell me
anything that I didn't already find in the docs.
What I can get from the form is the form fields with content,
On Thursday, 3 September 2020 at 08:22:25 UTC, glis-glis wrote:
Hi,
I have a few modules for parsing different file formats and a
folder with d-scripts using these parsers to perform
manipulations, extract information, ...
Until now, I just added
#!/usr/bin/env rdmd
to the d-scripts and
On Wednesday, 2 September 2020 at 07:01:48 UTC, Shaleen Chhabra
wrote:
Hi,
The libmir libraries can be found here:
https://github.com/libmir
I wish to use mir-algorithm and numir so that i can directly
use .npy format from python and perform the required analysis.
I checked out latest
On Tuesday, 1 September 2020 at 02:08:54 UTC, JG wrote:
[...]
Here is some fun with operator overloading and pointers, but I
don't really like it because it seems unsafe:
import std;
auto _(T...)(return ref T refs) @safe {
static struct Assigner(Ptrs...) {
@disable this(this);
On Thursday, 13 August 2020 at 07:52:07 UTC, novice3 wrote:
Hello.
I don't use dub.
I use Windows and *.d file association to compile small apps by
dmd with "-i -unittest -g" switches.
Now i update dmd, and found, that apps compiled with
"-unittest" not runs main().
How i can restore old
On Wednesday, 12 August 2020 at 21:11:54 UTC, Daniel Kozak wrote:
[...]
Unfortunately, I think vibe-d is dead. With every release it is
worse than before and it seems there is almost no activity. So
D really need new champion here maybe hunt will be next
champion.
Can you give an example
On Thursday, 6 August 2020 at 07:19:37 UTC, WebFreak001 wrote:
[...]
In line 11 in my example code this makes a better, safer if than
`if (s.length)`:
if (s.length && s[$ - 1] == '\n') s = s[0 .. $ - 1];
Note that I only need to do this because of the readln API, it
would be much safer and
On Wednesday, 5 August 2020 at 17:39:36 UTC, Mike Surette wrote:
In my efforts to learn D I am writing some code to read files
in different UTF encodings with the aim of having them end up
as UTF-8 internally. As a start I have the following code:
import std.stdio;
import std.file;
void
On Tuesday, 28 July 2020 at 04:40:33 UTC, Cecil Ward wrote:
I found an earlier post somewhere about work someone has done
on physical units such as kg, volts and so forth.
It would be very good to catch bugs such as
volts_t v = input_current;
[...]
This is easily done and uses enums:
On Tuesday, 21 July 2020 at 12:00:03 UTC, bioinfornatics wrote:
Dear,
I would like to use OpenCL in D. Thus I try to use DerelictCL.
But I fail to use it I encounter this error message:
--
/opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/derelict/opencl/constants.di(835):
On Wednesday, 22 July 2020 at 04:33:20 UTC, James Gray wrote:
Is there a better way to achieve behaviour similar to
rangeFuncIf
below? f gives a contrived example of when one might want this.
g is
how one might try and achieve the same with std.range.choose.
import std.stdio;
import std.range
On Thursday, 16 July 2020 at 13:54:56 UTC, aberba wrote:
On Thursday, 16 July 2020 at 13:41:31 UTC, aberba wrote:
On Thursday, 16 July 2020 at 09:47:02 UTC, WebFreak001 wrote:
[...]
Since its based on WikiMedia, searched an came up with this
[1] to embed in iframe
1.
On Wednesday, 15 July 2020 at 07:36:49 UTC, Vitalii wrote:
Many thanks!
I have now deprecated the old wiki page and linked to a new one
with more examples: https://wiki.dlang.org/Logging_mechanisms
Is there a way to integrate some kind of "run this source code"
button into the D wiki using run.dlang.io?
If there isn't, it would be nice to add this kind of thing as
plugin with the possibility of also including the editor so you
never need to leave the wiki. (like on the D Tour)
On Wednesday, 15 July 2020 at 11:25:34 UTC, aberba wrote:
On Wednesday, 15 July 2020 at 07:01:34 UTC, WebFreak001 wrote:
On Tuesday, 14 July 2020 at 20:37:53 UTC, Marcone wrote:
[...]
Additionally to the other answers telling you how to fix it,
it's important to know why it happens in the
On Wednesday, 15 July 2020 at 07:07:55 UTC, Vitalii wrote:
Hello everyone!
I try to compile this recipe with dmd (2.089.0), ldc2 (1.18.0):
https://wiki.dlang.org/Using_string_mixins_for_logging
but get the same error:
mixin_log.d(64): Error: basic type expected, not __FUNCTION__
On Tuesday, 14 July 2020 at 20:37:53 UTC, Marcone wrote:
import std: isUpper, writeln;
void main(){
writeln(isUpper('A'));
}
Why I get this error? How can I use isUpper()?
Additionally to the other answers telling you how to fix it, it's
important to know why it happens in the first
On Sunday, 12 July 2020 at 16:36:09 UTC, Per Nordlöw wrote:
The line
dflags "-linker=gold" platform="linux-ldc" # use GNU gold linker
in dub.sdl
enables me to change linker for LDC.
Is it possible to choose a specific linker for DMD aswell in a
similar way?
I only find the flag `-L` that
I have the following code:
double[string] foo;
foo["a"] += 1;
how is the opOpAssign on the AA defined? Is it defined to set the
value to the value to the right of the opOpAssign if it isn't set
for primitives or does it add the given value onto T.init?
Doing
foo["b"]++;
gives
On Saturday, 6 June 2020 at 08:06:02 UTC, Luis wrote:
On Friday, 5 June 2020 at 18:13:52 UTC, WebFreak001 wrote:
[...]
It isn't working correctly on my case :
I get this error :
Performing "unittest" build using dmd for x86_64.
ddiv ~sparseSet: building configuration "unittest"...
On Friday, 5 June 2020 at 17:03:40 UTC, Luis wrote:
So I actually managed to "debug" my unittests but It requires
that I run previsuly "dub test" on console, so the executable
is update. As I understand, I need to setup a task to be
prelaunched by debug to generate the unittest executable, but
On Friday, 29 May 2020 at 09:04:30 UTC, WebFreak001 wrote:
[...]
I realized it may be useful to have a much more complete example,
so replace the while (true) loop in my first code with this to
get much more information dumped:
while (true)
{
On Wednesday, 27 May 2020 at 14:16:56 UTC, BoQsc wrote:
I always wanted to know if there is any proven example on how
to interface with USB devices by using Windows operating
system. Any explanations, snippets in relation to topic would
help.
What I expect:
Being able to detect if a new USB
On Wednesday, 27 May 2020 at 17:33:33 UTC, Vinod K Chandran wrote:
Hi all,
Assume that i have an enum like this.
enum TestEnum {
Received = 1,
Started ,
Finished ,
Sent
}
I am saving this enum values as string in database. So, when i
retrieve them from the database, how can i
On Tuesday, 26 May 2020 at 13:36:34 UTC, Виталий Фадеев wrote:
[...]
I want this feature in D!
I think you are rather looking for tuples:
void opAssign(Args...)(Tuple!Args args)
{
foreach( a; args )
{
_layouts ~= a;
}
On Sunday, 24 May 2020 at 12:37:20 UTC, ag0aep6g wrote:
On 24.05.20 14:29, bauss wrote:
Dang, that sucks there is no proper way and I would say that's
a big flaw of D.
Because what I need it for is for some data serialization but
if the value is an empty array then it should be present and
On Monday, 18 May 2020 at 13:44:15 UTC, Martin Tschierschke wrote:
Hi,
I have to find a certain line in a file, with a text containing
umlauts.
How do you do this?
The following was not working:
foreach(i,line; file){
if(line=="My text with ö oe, ä ae or ü"){
writeln("found it at
On Thursday, 14 May 2020 at 09:49:15 UTC, wjoe wrote:
Is there an easy way to print an int in hexadecimal, octal or
binary representation ?
The documentation on pragma(msg, ...) and a quick web search
didn't provide an answer.
for simple hex/binary/etc printing use
import std.conv;
On Wednesday, 6 May 2020 at 19:51:01 UTC, bauss wrote:
How do you exactly do that?
Like if I have two dates as std.datetime.DateTime
How will I get the months or years between the two dates?
I was surprised to learn that Duration does not support them
and only has weeks, days etc. but not
On Wednesday, 6 May 2020 at 10:57:59 UTC, learner wrote:
On Tuesday, 5 May 2020 at 19:24:41 UTC, WebFreak001 wrote:
On Tuesday, 5 May 2020 at 18:41:50 UTC, learner wrote:
Good morning,
Trying to do this:
```
bool foo(string s) nothrow { return s.all!isDigit; }
```
I realised that the
On Wednesday, 6 May 2020 at 07:42:44 UTC, data pulverizer wrote:
On Wednesday, 6 May 2020 at 07:27:19 UTC, data pulverizer wrote:
On Wednesday, 6 May 2020 at 06:54:07 UTC, drug wrote:
Thing are really interesting. So there is a space to improve
performance in 2.5 times :-)
Yes, `array` is
On Tuesday, 5 May 2020 at 18:41:50 UTC, learner wrote:
Good morning,
Trying to do this:
```
bool foo(string s) nothrow { return s.all!isDigit; }
```
I realised that the conversion from char to dchar could throw.
I need to validate and operate over ascii strings and utf8
strings, possibly in
On Tuesday, 5 May 2020 at 14:15:03 UTC, H. S. Teoh wrote:
On Tue, May 05, 2020 at 01:44:18PM +, WebFreak001 via
Digitalmars-d-learn wrote:
[...]
Whoa, hold your horses right there! What does `pragma(msg,
real.dig);`
output on your machine?
[...]
You are right, probably should have
I was dumping the full PI value on my machine with the highest
precision it could get and got:
$ rdmd --eval='printf("%.70llf\n", PI)'
3.14159265358979323851280895940618620443274267017841339111328125
now this all looks good, but when I tried to print PI_2 I got
$ rdmd
On Tuesday, 28 April 2020 at 14:26:11 UTC, Russel Winder wrote:
On Tue, 2020-04-28 at 14:03 +, WebFreak001 via
Digitalmars-d-learn wrote:
[…]
in this case, try dub upgrade --vverbose and the full
exception message should hopefully show
I have no idea what has changed, but things are now
On Tuesday, 28 April 2020 at 13:44:14 UTC, Russel Winder wrote:
On Tue, 2020-04-28 at 12:04 +, WebFreak001 via
Digitalmars-d-learn wrote:
[...]
I am not sure this gives any further information. :-(
[...]
in this case, try dub upgrade --vverbose and the full exception
message should
On Tuesday, 28 April 2020 at 11:56:26 UTC, Russel Winder wrote:
Hi,
Has anyone seen this before, it has just started happening to
me and is stopping me doing any work on this D project.
|> dub build
Invalid variable: DFLAGS
try running with `dub build -v`
On Friday, 17 April 2020 at 08:40:36 UTC, WebFreak001 wrote:
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
[...]
Use std.algorithm:equal for range compare with approxEqual for
your comparator:
assert(equal!approxEqual(y, [2.5, 2.5].sliced(2)));
simplified:
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
In the code below, I multiply some slice by 5 and then check
whether it equals another slice. This fails for mir's
approxEqual because the two are not the same types (yes, I know
that isClose in std.math works). I was trying to convert
1 - 100 of 168 matches
Mail list logo