On Sunday, 12 March 2023 at 00:54:53 UTC, zjh wrote:
On Saturday, 11 March 2023 at 19:56:09 UTC, 0xEAB wrote:
If you desire to use other encodings, how about using ubyte +
ubyte[]?
There is no example.
To read binary data from a file and dump it into another, you do:
```d
import std.file
On Friday, 10 March 2023 at 07:16:32 UTC, zjh wrote:
`D language` is too unfriendly for Chinese users!
You can't even write `gbk` files.
D’s char + string types are Unicode.
To quote the tour, “In D, *all* strings are Unicode strings”.
If you desire to use other encodings, how about using
Is it just me, or does this happen for someone else, too?
Init a fresh DUB project and create a file (e.g. `lib.d`) with
the following content:
```d
unittest {
string x = "module oh.dear.dub.what.are.you.doing;";
}
```
Then run `dub test`:
```
On Sunday, 13 November 2022 at 19:36:48 UTC, Dennis wrote:
Can you please provide a full example? I'm missing the
definitions of _headers, hstring, values
```d
/++
“HTTP message string” – short-hand for `const(char)[]``.
$(SIDEBAR
Not sure about the name.
Would have
```d
struct Foo { /* … */
hstring[] getHeader(LowerCaseToken name) scope return
{
return _headers[name].values;
}
hstring[] getHeader(hstring name)() scope return
{
enum token = LowerCaseToken.makeConverted(name);
return this.getHeader(token); // line
Apparently there a difference between:
- ```d
Message withBody(Body body_) return scope { /* … */ }
```
- ```d
Message withBody(Body body_) scope return { /* … */ }
```
```
Deprecation: returning `this._body` escapes a reference to
parameter `this`
perhaps change the `return
```d
@safe:
void main()
{
import std.stdio : writeln;
writeln(ubyte(4).toHexDigit);
}
ubyte toHexDigit(ubyte decimal) pure nothrow @nogc
{
if (decimal < 10)
return (decimal + ubyte('0'));
if (decimal < 16)
return (decimal - ubyte(10) + ubyte('A'));
return
On Saturday, 21 May 2022 at 23:38:18 UTC, rikki cattermole wrote:
[…]
I grabbed a copy of ldc2-1.24.0-linux-aarch64, it has rdmd.
Something is messed up with that package if it does not include
it (assuming it hasn't be split out into a tools package).
iirc Debian & derivates do not package
On Saturday, 3 October 2020 at 07:54:58 UTC, Martin wrote:
On Friday, 2 October 2020 at 09:46:09 UTC, Denis Feklushkin
wrote:
Because standard implementation worse?
What do you mean with "worse"?
It's said to be pretty slow…
Are unittests that are marked @safe actually checked for safety?
https://github.com/dlang/phobos/blob/v2.093.1/std/file.d#L4937
How comes this unittest is @safe when `dirEntries` appears to be
@system?
Example I:
https://run.dlang.io/is/Vf0STw
Error: @safe function onlineapp.listdir
On Friday, 6 September 2019 at 15:09:22 UTC, Max Samukha wrote:
Consider the following two modules:
What compiler version are you using?
On Wednesday, 31 July 2019 at 06:30:03 UTC, BoQsc wrote:
On Wednesday, 31 July 2019 at 05:56:46 UTC, BoQsc wrote:
what causes the Internal Server Error.
Internal Server Error might as well appear when D language
syntax is not correct.
Maybe you want to use some wrapper around rdmd that
On Wednesday, 31 July 2019 at 06:30:03 UTC, BoQsc wrote:
This can be solved by using single quotes in the argument
content places
#!/usr/bin/env rdmd
import std.stdio;
void main()
{
writeln("Content-type: text/html");
writeln("");
writeln("CGI D
Example");
}
Does the job but is a
On Sunday, 7 July 2019 at 16:51:57 UTC, 0xEAB wrote:
Why does this `static foreach` lead to hidden usage of operator
Further notes by Dan (aka "Wild"):
I added some small printfs to the compiler, http://ix.io/1NWM
It seems like it lowers it into something weird
Why does this `static foreach` lead to hidden usage of operator
`~=` calls in some cases?
static foreach(i; 0 .. cnt)
onlineapp.d(9): Error: cannot use operator ~= in @nogc delegate
onlineapp.xv!(myUDA("/")).__funcliteral2.__lambda1
import std.traits;
private @safe pure nothrow @nogc
On Saturday, 12 January 2019 at 12:10:25 UTC, Droggl wrote:
2. Is there a way to get a certain git-version (eg. commit or
maybe even just "latest") for a package in dub?
JSON: "nice-curses": "~master"
SDL: dependency "nice-curses" version="~master"
3. How is everyone in general using curses
On Friday, 11 January 2019 at 18:40:08 UTC, Enjoys Math wrote:
You will have to be more specific. I don't see dub.json
anywhere within Coedit IDE.
are you using DUB or not?
On Friday, 11 January 2019 at 18:27:37 UTC, Enjoys Math wrote:
Dude, that doesn't work either. lol
If you're using DUB, add the dependency manually to your project:
"dependencies": {"pegged": "~>0.4.4"}
On Friday, 11 January 2019 at 17:35:40 UTC, Enjoys Math wrote:
Thanks, I downloaded Coedit, but it's not working with pegged
(using the library manager dub button)
According to your post in [0], it didn't work because you had a
typo in `pegged`.
Maybe correct it and try again :)
- Elias
On Friday, 11 January 2019 at 13:51:04 UTC, JN wrote:
On Friday, 11 January 2019 at 11:15:05 UTC, Mike James wrote:
Check out the origin :-)
https://forum.dlang.org/thread/hl8345$2b1q$1...@digitalmars.com?page=1
I guess something like iterReverse, reverseIter, backIterator
would be too
On Sunday, 30 December 2018 at 18:55:10 UTC, Ali Çehreli wrote:
On 12/30/2018 05:05 AM, 0xEAB wrote:
>> interface FooAdapter
>> {
>> FooBundle!(Handle) createSome(Handle)();
>> }
Function templates cannot be virtual functions. One reason is
the compiler cannot know how large the virtual
void main()
{
StaticThingy.register(new SomeAdapter());
StaticThingy.createSome!Dummy();
}
interface FooAdapter
{
FooBundle!(Handle) createSome(Handle)();
}
private class SomeAdapter : FooAdapter
{
Bundle createSome()
{
auto w = new Dummy();
auto c = new
On Wednesday, 15 August 2018 at 18:27:56 UTC, Steven
Schveighoffer wrote:
PR: https://github.com/dlang/phobos/pull/
-Steve
Thank you for looking into this one.
Regards,
Elias
On Wednesday, 15 August 2018 at 15:13:50 UTC, Kagamin wrote:
It's a bug:
Is it a known one?
core.exception.AssertError@/src/phobos/std/container/array.d(1667): Using out
of bounds indexes on an Array
Should this code[1] really try to access something out of bounds
and assert?
Also: shouldn't this assertion[2] be perhaps inside
`version(D_NoBoundsChecks){} else { ... }` block?
On Friday, 6 July 2018 at 23:54:35 UTC, SrMordred wrote:
Well, since its VS 2017 installer, eventually I hit all the
components needed to install it properly. Now its working.
Thanks 0xEAB for the tip about the Windows SDK too :)
No problem :)
On Friday, 6 July 2018 at 03:48:04 UTC, SrMordred wrote:
Well I just installed the VS 2017 to try the ldc and get
(maybe) the same error.
You didn't forget to install the Windows SDK with it, did you?
On Friday, 6 July 2018 at 17:32:09 UTC, SrMordred wrote:
On Friday, 6 July 2018 at 10:55:47 UTC, Rainer Schuetze wrote:
On 06/07/2018 05:48, SrMordred wrote:
[...]
The problem is that the Digital Mars linker is called but the
Microsoft linker is run, because they share the same name
What's the correct way to copy a `File` into another one in D?
If `LockingTextReader` wasn't undocumented, I'd have gone for
that approach:
import std.algorithm.mutation : copy;
import std.stdio : File, LockingTextReader;
void main()
{
auto a = File("a.txt", "r");
auto b =
On Wednesday, 5 July 2017 at 19:13:21 UTC, Jolly James wrote:
On Wednesday, 5 July 2017 at 19:01:06 UTC, Jonathan M Davis
wrote:
On Wednesday, July 05, 2017 18:50:32 Jolly James via
Digitalmars-d-learn wrote:
On Wednesday, 5 July 2017 at 18:46:38 UTC, Jolly James wrote:
> [...]
I have changed
30 matches
Mail list logo