Re: vibe.d still does not work on FreeBSD.

2024-02-18 Thread Kagamin via Digitalmars-d-learn
Docs say SSL_get0_peer_certificate was added in openssl 3.

Re: length's type.

2024-02-16 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 13 February 2024 at 23:57:12 UTC, Ivan Kazmenko wrote: I do use lengths in arithmetic sometimes, and that leads to silent bugs currently. On the other hand, since going from 16 bits to 32 and then 64, in my user-side programs, I had a flat zero bugs because some length was 2^{31}

Re: length's type.

2024-02-16 Thread Kagamin via Digitalmars-d-learn
On Thursday, 8 February 2024 at 05:56:57 UTC, Kevin Bailey wrote: How many times does the following loop print? I ran into this twice doing the AoC exercises. It would be nice if it Just Worked. ``` import std.stdio; int main() { char[] something = ['a', 'b', 'c']; for (auto i = -1; i <

Re: what was the problem with the old post blit operator already ?

2024-02-15 Thread Kagamin via Digitalmars-d-learn
It was mostly fine, such types are not supposed to be immutable, but recently came an idea of reference counted strings, which need to be immutable for being strings.

New discussion

2024-02-05 Thread Kagamin via Digitalmars-d-learn
You can just post with a new title.

Re: length's type.

2024-01-29 Thread Kagamin via Digitalmars-d-learn
I have an idea to estimate how long strlen takes on an exabyte string.

Re: Accessing array elements with a pointer-to-array

2024-01-25 Thread Kagamin via Digitalmars-d-learn
On Thursday, 25 January 2024 at 20:11:05 UTC, Stephen Tashiro wrote: void main() { ulong [3][2] static_array = [ [0,1,2],[3,4,5] ]; static_array[2][1] = 6; } The static array has length 2, so index 2 is out of bounds, must be 0 or 1.

Re: Error "Outer Function Context is Needed" when class declared in unittest

2024-01-25 Thread Kagamin via Digitalmars-d-learn
Looks like the context is currently passed for nested functions, not for nested classes.

Re: Behaves different on my osx and linux machines

2023-12-27 Thread Kagamin via Digitalmars-d-learn
Maybe you're not supposed to print text while reading?

Re: Behaves different on my osx and linux machines

2023-12-27 Thread Kagamin via Digitalmars-d-learn
Maybe write and read lock each other, try to use puts: ``` bool done = false; while (!done) { puts("1"); auto result = ["echo", "Hello World"].execute; if (result.status != 0) { writeln(2); throw new Exception("echo

Re: Behaves different on my osx and linux machines

2023-12-22 Thread Kagamin via Digitalmars-d-learn
Add more debugging? ``` bool done = false; while (!done) { writeln(1); auto result = ["echo", "Hello World"].execute; if (result.status != 0) { writeln(2); throw new Exception("echo failed"); }

Re: ImportC: Windows.h

2023-12-01 Thread Kagamin via Digitalmars-d-learn
Is GENERIC_WRITE awailable?

Re: ImportC: Windows.h

2023-11-30 Thread Kagamin via Digitalmars-d-learn
You can declare them ``` extern(C) void _InterlockedExchangeAdd(){ assert(false); } ```

Re: DMD: How to compile executable without producing .obj file?

2023-11-09 Thread Kagamin via Digitalmars-d-learn
The .exe is produced by the linker, which works with files: it takes one or more .obj files with program code and links them into and .exe file. I heard ldc has builtin linker or something like that, so hypothetically might be able to link on the fly.

Re: malloc error when trying to assign the returned pointer to a struct field

2023-09-08 Thread Kagamin via Digitalmars-d-learn
On Friday, 8 September 2023 at 13:32:00 UTC, rempas wrote: On Friday, 8 September 2023 at 13:05:47 UTC, evilrat wrote: ```d import core.stdc.stdlib; import core.stdc.stdio; alias u64 = ulong; alias i64 = long; struct Vec(T) { private: T* _ptr = null; // The pointer to the data u64 _cap =

Re: AA vs __gshared

2023-07-28 Thread Kagamin via Digitalmars-d-learn
Your error is using allocating the object with malloc. Since gc doesn't see your AA, the AA is freed and you get UAF.

Re: Is it possible to make an Linux Executable Binary using a Windows Operating System? [compiling and linking]

2023-07-27 Thread Kagamin via Digitalmars-d-learn
You will also need crt1.o, crti.o, crtn.o and libc.a

Re: array index out of bound may not throw exception?

2023-07-27 Thread Kagamin via Digitalmars-d-learn
On Friday, 21 July 2023 at 23:40:44 UTC, mw wrote: Is there a way to let it report on the spot when it happens? On linux if you catch an exception and call abort, the debugger will show you where abort was called, on windows you can call DebugBreak function, the debugger will show where it

Re: AA vs __gshared

2023-07-27 Thread Kagamin via Digitalmars-d-learn
On Friday, 28 July 2023 at 03:54:53 UTC, IchorDev wrote: I was told that using `__gshared` is quite a bit faster at runtime than using `shared`, but I also don't really know anything concrete about `shared` because the spec is so incredibly vague about it. The difference between them is

Re: Print debug data

2023-07-18 Thread Kagamin via Digitalmars-d-learn
Naming is hard.

Re: Compiling to RiscV32

2023-07-12 Thread Kagamin via Digitalmars-d-learn
Maybe the problem is with va_list, try to compile with -mtriple=riscv64-unknown-linux -mcpu=generic-rv64

Re: Compiling to RiscV32

2023-07-11 Thread Kagamin via Digitalmars-d-learn
Probably bug in druntime, v-functions shouldn't have `pragma(printf)`, because they don't have arguments to check.

Re: Compiling to RiscV32

2023-07-10 Thread Kagamin via Digitalmars-d-learn
Worked for me on ldc 1.20 https://forum.dlang.org/post/vuxuftogvszztdrrt...@forum.dlang.org

Re: Compiling to RiscV32

2023-07-10 Thread Kagamin via Digitalmars-d-learn
You try to use C declarations, but they are specific to each C library, and different C libraries have different declarations, so headers can't decide which C library declarations to use. Try -mtriple=riscv32-unknown-linux

Re: Log rotation in std.logger.filelogger

2023-05-22 Thread Kagamin via Digitalmars-d-learn
I suppose you write a custom logger for that or take an already written one from code.dlang.org

Re: Convert binary to UUID from LDAP

2023-03-28 Thread Kagamin via Digitalmars-d-learn
This guid is (int,short,short,byte[8]) in little endian byte order. So if you want to convert it to big endian, you'll need to swap bytes in those int and two shorts. ``` ubyte[] guid=... int* g1=cast(int*)guid.ptr; *g1=bswap(*g1); ```

Re: Convert binary to UUID from LDAP

2023-03-28 Thread Kagamin via Digitalmars-d-learn
This guid is (int,short,short,byte[8]) in little endian byte order. So if you want to convert it to big endian, you'll need to swap bytes in those int and two shorts. ``` ubyte[] guid=... int* g1=cast(int*)guid.ptr; *g1=bswap(*g1); ```

Re: Best way to read/write Chinese (GBK/GB18030) files?

2023-03-22 Thread Kagamin via Digitalmars-d-learn
https://dlang.org/phobos/std_stdio.html#rawWrite

Re: Threads

2023-03-22 Thread Kagamin via Digitalmars-d-learn
static is thread local by default. ``` module main; import app; import core.thread; int main(string[] args) { static shared int result; static shared string[] args_copy; static void app_thread() { App app = new App(); result = app.run(args_copy); }

Re: Best way to read/write Chinese (GBK/GB18030) files?

2023-03-14 Thread Kagamin via Digitalmars-d-learn
On Monday, 13 March 2023 at 00:32:07 UTC, zjh wrote: Thank you for your reply, but is there any way to output `gbk` code to the console? I guess if your console is in gbk encoding, you can just write bytes with stdout.write.

[OT] (Go) Do I read it right?

2023-02-16 Thread Kagamin via Digitalmars-d-learn
https://github.com/dominikh/go-tools/issues/917 How go programmers cope with this feature?

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-14 Thread Kagamin via Digitalmars-d-learn
My point is you know you're just picky.

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-13 Thread Kagamin via Digitalmars-d-learn
On Monday, 13 February 2023 at 08:22:06 UTC, ProtectAndHide wrote: Chris Lattner outlines the reasons for removing it in Swift 3.0 here: https://github.com/apple/swift-evolution/blob/main/proposals/0004-remove-pre-post-inc-decrement.md So your complaint is that you agree with Chris Lattner

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-12 Thread Kagamin via Digitalmars-d-learn
On Friday, 10 February 2023 at 21:52:02 UTC, ProtectAndHide wrote: Well in Swift, there is no problem .. at all. Why is it a problem in D then? (and I mean technically). What about the increment operator `++` ?

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread Kagamin via Digitalmars-d-learn
On Friday, 10 February 2023 at 14:17:25 UTC, Kagamin wrote: Pretty sure you can strip namespaces in any language that has namespaces, C# routinely does it and refers to all types with their nonqualified names. It even has Keys enum:

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread Kagamin via Digitalmars-d-learn
On Monday, 23 January 2023 at 00:36:36 UTC, thebluepandabear wrote: It's not a freedom issue, it's a library-design issue. Some libraries want to incorporate a namespace-like design to force the user to be more 'explicit' with what they want. SFML has a `Keyboard` namespace which has a `Key`

Re: Logging logs in Windows

2023-02-07 Thread Kagamin via Digitalmars-d-learn
On Saturday, 4 February 2023 at 13:31:41 UTC, Alexander Zhirov wrote: I understand that programming under Windows is a shame for a programmer, but is there really no ready-made solution for using the system log in Windows? It would be a logging library like log4j that would have different

Re: How often I should be using const? Is it useless/overrated?

2022-11-22 Thread Kagamin via Digitalmars-d-learn
On Friday, 18 November 2022 at 17:57:25 UTC, H. S. Teoh wrote: You're looking at it the wrong way. The kind of issues having const would solve is like when your function takes parameters x, y, z, and somewhere deep in the function you see the expression `x + y*z`. If x, y, and z are const,

Re: aa.keys, synchronized and shared

2022-11-14 Thread Kagamin via Digitalmars-d-learn
This works for me: ``` synchronized final class SyncAA(K, V) { this(K key, V val) { sharedTable[key]=val; } V opIndex(K key) { return sharedTable[key]; } V opIndexAssign(V value, K key) { return sharedTable[key]=value; } const(K[]) keys() const { return

Re: aa.keys, synchronized and shared

2022-11-11 Thread Kagamin via Digitalmars-d-learn
With allocation: ``` synchronized final class SyncAA(K, V) { V opIndex(K key) { return sharedTable[key]; } V opIndexAssign(V value, K key) { return sharedTable[key]=value; } const(K[]) keys() const { return unsharedTable.keys; } void remove(K key) {

Re: aa.keys, synchronized and shared

2022-11-11 Thread Kagamin via Digitalmars-d-learn
Try this: ``` synchronized final class SyncAA(K, V) { V opIndex(K key) { return sharedTable[key]; } V opIndexAssign(V value, K key) { return sharedTable[key]=value; } const(K[]) keys() const { return unsharedTable.keys; } void remove(K key) { sharedTable.remove(key); }

Re: Make IN Dlang

2022-11-02 Thread Kagamin via Digitalmars-d-learn
Another idea is to separate the script and interpreter then compile them together. ``` --- interp.d --- import script; import ...more stuff ...boilerplate code int main() { interpret(script.All); return 0; } --- script.d --- #! ? module script; import mind; auto All=Task(...); ...more

Re: Make IN Dlang

2022-11-02 Thread Kagamin via Digitalmars-d-learn
But embedded sdl is likely to be dwarfed by the actual code anyway.

Re: Make IN Dlang

2022-11-02 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 1 November 2022 at 23:40:22 UTC, Christian Köstlin wrote: I am still trying to find answers to the following questions: 1. Is it somehow possible to get rid of the dub single file scheme, and e.g. interpret a full dlang script at runtime? If there was an interpreter like ```

Re: dub ldc2 static linking

2022-10-28 Thread Kagamin via Digitalmars-d-learn
On Friday, 28 October 2022 at 02:46:42 UTC, ryuukk_ wrote: I'm just right now having an issue with glibc version mismatch for my server Just compile with an old enough glibc, 2.14 works for me.

Re: Is "auto t=T();" not the same as "T t;"?

2022-10-26 Thread Kagamin via Digitalmars-d-learn
Looks like explicitly initialized variable in this case allocates array literal. Uninitialized variable is initialized with init pattern. This may be correct as uninitialized variable isn't guaranteed to hold a value most useful for you, it's only guaranteed to hold a defined value.

Re: Static executable (ldc, linux)

2022-10-25 Thread Kagamin via Digitalmars-d-learn
ldc2 -link-defaultlib-shared=false or something like that

Re: How to workaround on this (bug?)

2022-09-23 Thread Kagamin via Digitalmars-d-learn
Provide two functions and let the caller choose ``` void fun(ref Variant v) nothrow { } void fun2(Variant v) { fun(v); } ```

Re: toString doesn't compile with -dip1000 switch

2022-08-01 Thread Kagamin via Digitalmars-d-learn
Bar.toString is typed `@system`.

Re: char* pointers between C and D

2022-07-25 Thread Kagamin via Digitalmars-d-learn
This is how to do it the D way: ``` int main(string[] args) { string ch1 = "Hello World!"; char[] ch2="Hello World!".dup; string s1=ch1[1..$]; char[] s2=ch2[1..$]; writeln(s1); writeln(s2); return 0; } ```

Re: null == "" is true?

2022-07-20 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 19 July 2022 at 18:05:34 UTC, Antonio wrote: In a relational database, `NULL` is not the same that `""`... and `NULL` is not the same that `0`. Are semantically different and there are database invariants (like foreign keys) based on it. Trying to "mix" this concepts in a

Re: null == "" is true?

2022-07-19 Thread Kagamin via Digitalmars-d-learn
Also what's the difference between null and empty phone number?

Re: null == "" is true?

2022-07-19 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 19 July 2022 at 10:29:40 UTC, Antonio wrote: The summary is that a DTO that works like a Map needs to represent the absent key ant this is not the same that the Null value Example: ```d struct Null { /*...*/ } struct Undefined { /*...*/ } struct ContactDto { DtoVal!(Undefined,

Re: null == "" is true?

2022-07-19 Thread Kagamin via Digitalmars-d-learn
On Monday, 18 July 2022 at 21:23:32 UTC, Antonio wrote: I will study it in detail and report (if required). May be, I will write the DTO problem with D article if I find time in august. In my experience null and empty in DTOs usually play the same logical role. It's a very contrived

Re: null == "" is true?

2022-07-18 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 12 July 2022 at 20:36:03 UTC, Antonio wrote: Honestly, it is difficult to understand for newcomers... there is a reason, but there is a reason in javascript for `0 == ''` too People would have different preferences there. Difference between null and empty is useless. D does the

Re: How to debug thread code

2022-07-12 Thread Kagamin via Digitalmars-d-learn
On Sunday, 10 July 2022 at 21:27:08 UTC, Hipreme wrote: "Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code)." Open the threads window and click on threads there, their stack will be in the

Re: freebsd dub linker error

2022-06-01 Thread Kagamin via Digitalmars-d-learn
Try to run clang with -v option and compare with gcc.

Re: Is there a way to not escape slashes when parsing JSON?

2022-02-21 Thread Kagamin via Digitalmars-d-learn
On Monday, 21 February 2022 at 09:04:06 UTC, bauss wrote: Why are we even escaping them by default, it should be the other way around, that slashes are only escaped if you ask for it; that's how it literally is in almost every JSON library. Really? I always see escaped slashes in JSON, e.g.

Re: How to verify DMD download with GPG?

2022-02-14 Thread Kagamin via Digitalmars-d-learn
3AAF1A18E61F6FAA3B7193E4DB8C5218B9329CF8 is 0xDB8C5218B9329CF8 This shortening was supposed to improve user experience.

Re: Cross Compile to Linux from Windows using LDC?

2022-02-14 Thread Kagamin via Digitalmars-d-learn
Isn't cross-linker enough? My regular mingw build of ld says it supports elf64-x86-64 traget, so I assume something like this should be enough: ld -b elf64-x86-64 -L lib --dynamic-linker /lib64/ld-linux-x86-64.so.2 --as-needed --gc-sections -s lib/crt1.o lib/crti.o my.o -lc lib/crtn.o

Re: How to print unicode characters (no library)?

2021-12-27 Thread Kagamin via Digitalmars-d-learn
On Monday, 27 December 2021 at 11:21:54 UTC, rempas wrote: So should I just use UTF-8 only for Linux? What about other operating systems? I suppose Unix-based OSs (maybe MacOS as well if I'm lucky) work the same as well. But what about Windows? Unfortunately I have to support this OS too with

Re: How to print unicode characters (no library)?

2021-12-27 Thread Kagamin via Digitalmars-d-learn
On Monday, 27 December 2021 at 07:29:05 UTC, rempas wrote: How can you do that? I'm trying to print the codes for them but it doesn't work. Or you cannot choose to have this behavior and there are only some terminals that support this? Try it on https://en.wikipedia.org/wiki/Teletype_Model_33

Re: How to print unicode characters (no library)?

2021-12-27 Thread Kagamin via Digitalmars-d-learn
D strings are plain arrays without any text-specific logic, the element is called code unit, which has a fixed size, and the array length specifies how many elements are in the array. This model is most adequate for memory correctness, i.e. it shows what takes how much memory and where it will

Re: French and Greek strings

2021-11-17 Thread Kagamin via Digitalmars-d-learn
You can use the string type to hold non-ascii characters. Just a substring of another string.

Re: abs and minimum values

2021-10-29 Thread Kagamin via Digitalmars-d-learn
Unsigned integers aren't numbers. assert(-abs(1)<0);

Re: Analyze debug condition in template

2021-10-27 Thread Kagamin via Digitalmars-d-learn
You can do something like ```d enum LogSettings { func1,func2,func3 } alias logger!LogSettings logf; void func1() { logf(...); } ``` Then the logger can inspect symbols in the template argument and compare their names to the function name.

Re: Analyze debug condition in template

2021-10-26 Thread Kagamin via Digitalmars-d-learn
`debug(func1)writefln(...)` But specify a global debug version for the compiler: `dmd -debug=func1 app.d`

Re: Why do we have Dmain?

2021-10-22 Thread Kagamin via Digitalmars-d-learn
Actually C runtime is many megabytes in size.

Re: How to test if a string is pointing into read-only memory?

2021-10-12 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 08:19:01 UTC, jfondren wrote: and string literals weren't reliably in read-only memory as recently as early 2017: https://github.com/dlang/dmd/pull/6546#issuecomment-280612721 Sometimes sections have defined symbols for start and end, you can check if the

Re: Python's list equivalent with std.variant?

2021-10-05 Thread Kagamin via Digitalmars-d-learn
On Sunday, 3 October 2021 at 22:22:48 UTC, rjkilpatrick wrote: ```d import std.stdio : writeln; import std.variant; import std.conv; // Arbitrary super class class SuperClass { this() { } } // Derived class with members class DerivedClass : SuperClass { public: this(float a) {

Re: better c fibers

2021-09-28 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 21 September 2021 at 09:37:30 UTC, Abby wrote: Hi there, I'm new in dlang I specially like betterC. I was hoping that d fibers would be implemented in without using classes, but there are not. On windows you can use the fiber api

Re: Scope with owner types

2021-09-23 Thread Kagamin via Digitalmars-d-learn
Yes, the `return` attribute is what should do it. You also need to compile the code with -dip1000 option.

Re: Run-time setting of immutable variable?

2021-09-02 Thread Kagamin via Digitalmars-d-learn
If you want only address, you can keep it as size_t: ubyte[10] Arr; immutable size_t Address; static this() { Address = cast(size_t)([0]); }

Re: Error load: QtE5Widgets64.dll

2021-08-31 Thread Kagamin via Digitalmars-d-learn
Maybe you're trying to load a 32-bit library into a 64-bit process.

Re: std.stdio.File is throwing with the message of: "Access Violation"

2021-08-20 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 17:56:53 UTC, Ruby The Roobster wrote: When I removed those two lines of code, the program ran perfectly without displaying any error or throwing any exception... The errors aren't always nicely located and can be elsewhere. Try to write a minimal runnable

Re: Shift operator, unexpected result

2021-06-10 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 9 June 2021 at 19:13:10 UTC, JG wrote: produces: 123 I would expect 0. What is the rationale for this behaviour or is it a bug? Processor just takes lower 6 bits for the shift amount and those hold zero in your case, shifting by 65 will shift by 1.

Re: How to cross build a RISC-V target betterC code using LDC on x86-64 machine

2021-06-07 Thread Kagamin via Digitalmars-d-learn
https://forum.dlang.org/post/koxqrqqzadfefbgkd...@forum.dlang.org

Re: How do I create classes dynamically?

2021-04-16 Thread Kagamin via Digitalmars-d-learn
On Friday, 16 April 2021 at 08:31:27 UTC, Imperatorn wrote: One example would be a repl That has little to do with what OP meant.

Re: How do I create classes dynamically?

2021-04-15 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 20:38:16 UTC, Mario wrote: Maybe I am just too short in D, but I wanted to find out if it is possible to create classes dynamically. My problem is, I just don't know where to start reading. Maybe at mixin templates? CreateClassWithName!("MyDynamicClassName");

Re: "this" as default parameter for a constructor.

2021-04-12 Thread Kagamin via Digitalmars-d-learn
class foo { this ( foo p /* , other params */ ) { parent = p; } foo create() { return new foo(this); } void use() { foo f = create(); } foo parent; }

Re: Why I need DUB? Will never DMD don't just use import for import packages?

2021-04-08 Thread Kagamin via Digitalmars-d-learn
On Monday, 29 March 2021 at 19:06:33 UTC, Marcone wrote: Why can't I just use: import vibe.vibe; for import packages like Nim or Python? Why I still use DUB? Theoretically an rdmd-like tool can automatically infer dependencies from imports (autodub?). But it can also easily expose you to a

Re: Don't allow to reassign, but content is editable

2021-04-07 Thread Kagamin via Digitalmars-d-learn
struct A { private int[] a; this(int[] b){a=b;} int[] c(){ return a; } @disable void opAssign(); } struct B { A a; this(int){ a=new int[5]; } int[] b(){ return a.c; } void f(){ a=new int[5]; } }

Re: Can I make this work?

2021-03-20 Thread Kagamin via Digitalmars-d-learn
struct S { this(string s) { type = Type.type1; } this(int n) { type = Type.type2; } Type type; int n; } int value(S s)() { static if(s.type == Type.type2) { // do something

Re: How to delete dynamic array ?

2021-03-19 Thread Kagamin via Digitalmars-d-learn
On Thursday, 18 March 2021 at 17:57:30 UTC, Patrick Schluter wrote: It's important to understand that [] is just a practical syntax for a fat pointer. Thinking of [] just as a fancy pointer helps imho to clarify that the pointed to memory nature is independant of the pointer itself. I

Re: tiny alternative to std library

2021-03-06 Thread Kagamin via Digitalmars-d-learn
I suppose commercial vendors aren't interested in suckless paradigm, so this library is for people and only for people.

Re: tiny alternative to std library

2021-03-05 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 3 March 2021 at 20:54:43 UTC, Anthony Quizon wrote: I'm having some success pulling out small bits of code from other libraries and keeping things minimal and c-style-ish. If you're really ok with minimalism, I'm writing such a library https://filebin.net/7gtyh5j01gk1ofly I

Re: Name mangling problem with tiny Windows 10 load-time DLL example

2021-02-28 Thread Kagamin via Digitalmars-d-learn
mangleof should give _D4file6addOneFiZi, not _D6patron6addOneFiZi

Re: Real simple unresolved external symbols question...

2021-02-10 Thread Kagamin via Digitalmars-d-learn
Add libraries that provide missing symbols.

Re: Compile time check for GC?

2021-01-28 Thread Kagamin via Digitalmars-d-learn
You can make it opt in, it's insurance.

Re: Compile time check for GC?

2021-01-27 Thread Kagamin via Digitalmars-d-learn
You can define a symbol that will conflict with GC and prevent linking with it.

Re: Surprising behaviour of std.experimental.allocator

2020-12-26 Thread Kagamin via Digitalmars-d-learn
Try to compile in debug mode, maybe you breach some contract.

Re: Updating to newer files with different disk formats

2020-12-16 Thread Kagamin via Digitalmars-d-learn
You can compare like time1 > time2 + 100.msec, though posix specifies only second precision.

Re: CMD && comand not work

2020-12-11 Thread Kagamin via Digitalmars-d-learn
On Thursday, 10 December 2020 at 21:01:30 UTC, Marcone wrote: In this very generic example && not work to finalize the instruct and start a new instruct. Yes, I know dmd can build and run without it, but this is only a example. execute(["cmd", "/c", "dmd test.d", "&&", "start test.exe"]);

Re: Is garbage detection a thing?

2020-12-01 Thread Kagamin via Digitalmars-d-learn
On Sunday, 29 November 2020 at 19:09:07 UTC, Mark wrote: Looking at Ada now. I found: Ada is not good for me. It has no augmented assignment. It's just that I want DRY because I use very verbose variable names Using a reasonable naming convention should be much easier than looking for a

Re: Is garbage detection a thing?

2020-11-29 Thread Kagamin via Digitalmars-d-learn
Maybe Ada.

Re: Function Pointer Not Working

2020-11-19 Thread Kagamin via Digitalmars-d-learn
The delegate is stored on the stack of the calling thread, the created thread loads it from there, but the calling thread doesn't wait for that and clobbers the stack right away. If you were lucky your code would crash.

Re: magically a static member on init?

2020-11-17 Thread Kagamin via Digitalmars-d-learn
On Saturday, 14 November 2020 at 23:30:58 UTC, Adam D. Ruppe wrote: On Saturday, 14 November 2020 at 23:20:55 UTC, Martin wrote: Is this intentional? In the current language design, yes. It's a bug, it breaks data sharing guarantees.

Re: DMD: invalid UTF character `\U0000d800`

2020-11-08 Thread Kagamin via Digitalmars-d-learn
On Sunday, 8 November 2020 at 10:47:34 UTC, Per Nordlöw wrote: dchar Surrogate pairs are used in rules because java strings are utf-16 encoded, it doesn't make much sense for other encodings.

Re: is type checking in D undecidable?

2020-10-23 Thread Kagamin via Digitalmars-d-learn
On Thursday, 22 October 2020 at 18:24:47 UTC, Bruce Carneal wrote: Per the wiki on termination analysis some languages with dependent types (Agda, Coq) have built-in termination checkers. What they do with code that does, say, a hash preimage attack?

Re: It is possible to substract 5 from 3 unsigned integer

2020-10-08 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 6 October 2020 at 18:24:14 UTC, Alaindevos wrote: A logical one. For the last one higher classes might be needed. Also assert(5/3==1);

  1   2   3   4   5   6   7   8   9   >