On Tuesday, 9 September 2025 at 00:45:00 UTC, monkyyy wrote:
On Tuesday, 9 September 2025 at 00:40:31 UTC, Brother Bill
wrote:
https://tour.dlang.org/tour/en/gems/opdispatch-opapply
This states: "Any unknown member function call to that type is
passed to opDispatch, passing the unknown member
On Tuesday, 9 September 2025 at 20:08:06 UTC, monkyyy wrote:
On Tuesday, 9 September 2025 at 19:17:11 UTC, Steven
Schveighoffer wrote:
In short `opDispatch` only is valid if it compiles. If it
doesn't compile, it's as if it doesn't exist.
Yours still thinking declaratively, that cant be true
On Tuesday, 9 September 2025 at 19:17:11 UTC, Steven
Schveighoffer wrote:
In short `opDispatch` only is valid if it compiles. If it
doesn't compile, it's as if it doesn't exist.
Yours still thinking declaratively, that cant be true. The best
description of its behavior is that it discards er
On Tuesday, 9 September 2025 at 00:40:31 UTC, Brother Bill wrote:
```
c:\dev\D\D_templates_tutorial\toy1\source\app.d(8): Error: no
property `callHome` for `l` of type `app.CallLogger!(C)`
l.callHome("foo", "bar");
^
```
You might be expecting `opDispatch` inside `CallLogger` to try
On Tuesday, 9 September 2025 at 12:04:07 UTC, Brother Bill wrote:
When commenting out the callHome() in struct C, it fails.
You can't call a function that doesn't exist. When the function
doesn't exist, you can't call it.
Obviously if callHome() is explicitly created, it works.
*Explicitl
On Tuesday, 9 September 2025 at 09:59:40 UTC, Dejan Lekic wrote:
Hopefully this slightly modified, and commented version of your
original code will
help you understand why your mixin is failing:
```d
import std.stdio;
void main() {
CallLogger!C l;
l.callA(1, 2);
l.callB(&quo
On Tuesday, 9 September 2025 at 01:24:59 UTC, monkyyy wrote:
```d
import std;
struct Vector(int N,T,string fields){
static foreach(I;0..N){
mixin("T "~fields[I]~";");
}
auto opDispatch(string __s__)(){//I suggest a habit of
avoiding simple names when generating
r."
So I tried that. But the compiler didn't like it.
How should I play the game of passing in an unknown member
function name?
Hopefully this slightly modified, and commented version of your
original code will
help you understand why your mixin is failing:
```d
import s
On Tuesday, 9 September 2025 at 01:08:41 UTC, Brother Bill wrote:
On Tuesday, 9 September 2025 at 00:45:00 UTC, monkyyy wrote:
On Tuesday, 9 September 2025 at 00:40:31 UTC, Brother Bill
wrote:
https://tour.dlang.org/tour/en/gems/opdispatch-opapply
This states: "Any unknown member function call
On Monday, 8 September 2025 at 16:23:23 UTC, Brother Bill wrote:
On Monday, 8 September 2025 at 14:42:01 UTC, evilrat wrote:
probably because you have declared nested function `add`
inside `main`, this creates a delegate closure capturing
`main` scope, if you don't want that just mark `add` s
On Monday, 8 September 2025 at 14:42:01 UTC, evilrat wrote:
probably because you have declared nested function `add` inside
`main`, this creates a delegate closure capturing `main` scope,
if you don't want that just mark `add` static.
Yep, as a nested function, this is a delegate, not a func
It works by making doSomething as a delegate.
On Monday, 8 September 2025 at 14:42:01 UTC, evilrat wrote:
probably because you have declared nested function `add` inside
`main`, this creates a delegate closure capturing `main` scope,
if you don't want that just mark `add` static.
Marking add static works.
Still don't understand why thi
https://tour.dlang.org/tour/en/basics/delegates
This is so simple. What is D complaining about?
Should this also work with a Template, as shown?
```
import std.stdio;
void main()
{
// auto add(T)(T lhs, T rhs)
// {
// return lhs + rhs;
// }
int add
On Sunday, 7 September 2025 at 12:53:58 UTC, Brother Bill wrote:
Two assert statements on lines 43 and 44 fail.
Should these assert statements be correct, and if so, what
changes to make them correct.
Or are they incorrect, and should be removed?
Or have I made a mistake in implementing this e
Two assert statements on lines 43 and 44 fail.
Should these assert statements be correct, and if so, what
changes to make them correct.
Or are they incorrect, and should be removed?
Or have I made a mistake in implementing this exercise solution?
Console output
```
areas:[TriangularArea (1, 2)
On 9/3/25 5:10 AM, Brother Bill wrote:
> Made some further changes, and have additional questions.
One of your question involves object aligment, which I mention here:
https://ddili.org/ders/d.en/memory.html#ix_memory..alignof
I discovered two (somewhat cryptic) functions there that computes
On Wednesday, 3 September 2025 at 03:09:45 UTC, Ali Çehreli wrote:
GC.calloc(bytesNeeded);
Again, I misled you there.
> writeln("myClasses address: ", myClasses);
>
> alias MyClassPtr = MyClass *;
That's not useful because the type MyClass is already a
reference type, implemented as
On 9/2/25 4:51 PM, Brother Bill wrote:
> The code snippet from the book is:
> ```
> // Allocate room for 10 MyClass objects
> MyClass * buffer =
> cast(MyClass*)GC.calloc(
> __traits(classInstanceSize, MyClass) * 10);
> ```
For clarity, we are talking about this page:
https
The code snippet from the book is:
```
// Allocate room for 10 MyClass objects
MyClass * buffer =
cast(MyClass*)GC.calloc(
__traits(classInstanceSize, MyClass) * 10);
```
```
class MyClass
{
int a;
string name;
char c;
}
```
MyClass is defined as a simple
On Friday, 29 August 2025 at 01:51:27 UTC, Steven Schveighoffer
wrote:
On Friday, 29 August 2025 at 01:24:40 UTC, Steven Schveighoffer
wrote:
Will file an issue, and we should get this fixed.
https://github.com/dlang/phobos/issues/10852
Fixed!
https://github.com/dlang/phobos/pull/10854
Wi
On Sunday, 31 August 2025 at 22:53:51 UTC, Steven Schveighoffer
wrote:
`std.concurrency` is meant to make all these control flow
systems easy to avoid races for, even in `@safe` code. Sending
the boolean instead of keeping a pointer to a shared boolean
can alleviate a lot of these problems.
On Sunday, 31 August 2025 at 12:44:33 UTC, Brother Bill wrote:
On Sunday, 31 August 2025 at 01:27:57 UTC, Steven Schveighoffer
wrote:
Why would your second iteration make a difference? Purely by
chance! In fact, on my machine, it does not exit in either
case.
Welcome to the wonderful world of
On Sunday, 31 August 2025 at 12:44:33 UTC, Brother Bill wrote:
FWIW, given that D supports Message Passing Concurrency, is
Data Sharing Concurrency just there for D completeness, for
those that want to live close to the iron.
Speaking as a guy who did Unix kernel SMP for years, there are
time
On Sunday, 31 August 2025 at 01:27:57 UTC, Steven Schveighoffer
wrote:
Why would your second iteration make a difference? Purely by
chance! In fact, on my machine, it does not exit in either case.
Welcome to the wonderful world of race conditions and
multithreading!
So this was just 'bad' lu
On Saturday, 30 August 2025 at 22:05:49 UTC, Brother Bill wrote:
A predicate (!*isDone) vs. (*isDone == false) seems to have
different behavior, where I would expect identical behavior.
What am I missing?
This program runs forever, even though isDone changes from
false to true.
```d
import
A predicate (!*isDone) vs. (*isDone == false) seems to have
different behavior, where I would expect identical behavior.
What am I missing?
This program runs forever, even though isDone changes from false
to true.
```
import std.stdio;
import std.concurrency;
import core.thread;
import core.
On Saturday, 30 August 2025 at 18:04:20 UTC, Steven Schveighoffer
wrote:
On Saturday, 30 August 2025 at 11:43:27 UTC, Brother Bill wrote:
I tried various code changes, none of which worked.
Kindly provide code changes to fix warnings that reflect
modern D programming.
This worked for me:
W
On Saturday, 30 August 2025 at 11:43:27 UTC, Brother Bill wrote:
I tried various code changes, none of which worked.
Kindly provide code changes to fix warnings that reflect modern
D programming.
This worked for me:
```d
import std.stdio;
import std.concurrency;
import std.conv;
struct Calc
On Saturday, 30 August 2025 at 03:21:14 UTC, Steven Schveighoffer
wrote:
`Tid` can only send or receive shared or immutable data. This
is a long standing requirement, and it makes sense.
The thing is, this data is shared *only* when it is going
through the message system. Once it's out, you ca
A note on your references here:
I'm assuming you are working from a physical book. But the online
book is here: https://ddili.org/ders/d.en/index.html
When you have questions, if you could link to the content, that
would be really helpful. Especially since you are not including
the entire ma
If this technique is still valid, I need the code modernized so
that it works without warnings. I'm still in the D learning
curve, so I don't quite know what is being warned, and how to
clean up the mess.
I believe that the new code runs properly, but it would be nice
for it to be 'warning f
On Friday, 29 August 2025 at 01:24:40 UTC, Steven Schveighoffer
wrote:
Will file an issue, and we should get this fixed.
https://github.com/dlang/phobos/issues/10852
-Steve
On Thursday, 28 August 2025 at 11:54:10 UTC, Brother Bill wrote:
If line 9 of the program is commented out, it runs fine.
Otherwise lots of error messages which don't pan out for me.
I tried changing Negative.front to be const, which didn't help.
I am not quite sure what the error me
On Thursday, 28 August 2025 at 13:33:09 UTC, Brother Bill wrote:
On Thursday, 28 August 2025 at 13:16:26 UTC, Andy Valencia
wrote:
Output to console: Why does static foreach run 'twice'?
run.dlang.org run only once
On Thursday, 28 August 2025 at 13:16:26 UTC, Andy Valencia wrote:
On Thursday, 28 August 2025 at 13:09:21 UTC, Brother Bill wrote:
Unable to compile. Please advise.
```
c:\dev\D\81 -
90\c83_e_static_foreach_fibonacci\source\app.d(8): Error:
function declaration without return type. (Note that
On Thursday, 28 August 2025 at 15:21:41 UTC, Andy Valencia wrote:
On Thursday, 28 August 2025 at 14:15:54 UTC, monkyyy wrote:
They lose the plot and you have to sometimes offer your own
solutions, its often not worth debugging, if you see an ugly
phoboes error on what should be a simple range
On Thursday, 28 August 2025 at 14:15:54 UTC, monkyyy wrote:
They lose the plot and you have to sometimes offer your own
solutions, its often not worth debugging, if you see an ugly
phoboes error on what should be a simple range concept,
consider not even looking.
Although at least consider s
On Thursday, 28 August 2025 at 11:54:10 UTC, Brother Bill wrote:
If line 9 of the program is commented out, it runs fine.
Otherwise lots of error messages which don't pan out for me.
I tried changing Negative.front to be const, which didn't help.
I am not quite sure what the error me
On Thursday, 28 August 2025 at 13:09:21 UTC, Brother Bill wrote:
Unable to compile. Please advise.
```
c:\dev\D\81 -
90\c83_e_static_foreach_fibonacci\source\app.d(8): Error:
function declaration without return type. (Note that
constructors are always named `this`)
writeln(n);
writeln(
Unable to compile. Please advise.
```
c:\dev\D\81 - 90\c83_e_static_foreach_fibonacci\source\app.d(8):
Error: function declaration without return type. (Note that
constructors are always named `this`)
writeln(n);
^
c:\dev\D\81 - 90\c83_e_static_foreach_fibonacci\source\app.d(8):
If line 9 of the program is commented out, it runs fine.
Otherwise lots of error messages which don't pan out for me.
I tried changing Negative.front to be const, which didn't help.
I am not quite sure what the error messages are telling me.
Thank you for your assistance!
```
C:\D\dm
On Monday, 18 August 2025 at 17:58:54 UTC, Dejan Lekic wrote:
So, to fix your error, you can remove the "const" method
qualifier from opApply, or cast the const away from the member
when you use it.
Thanks for the tip. It just needed more 'const' keywords
sprinkled in here and there.
Here
On Monday, 18 August 2025 at 13:32:57 UTC, Brother Bill wrote:
Page 496 of Programming in D
Going in circles. Please correct so it compiles and works.
An explanation would be helpful also.
Ali's book have a section about const member qualifier - "51.5
const member functions", but I think it
Page 496 of Programming in D
Going in circles. Please correct so it compiles and works.
An explanation would be helpful also.
Error Message
```
c:\dev\D\71 - 80\c73_2d_School_Student_Teacher\source\app.d(23):
Error: cannot implicitly convert expression
`this.students[cast(ulong)i]` of type `c
demands in their academic
journey, finding ways to make learning more efficient and
meaningful becomes essential.
One effective way to improve academic learning is through [essay
help](https://myassignmenthelp.expert/essay-help/). Crafting a
compelling essay requires more than just writing skills
it|e", "Exit process", &test,
"verbose|v", "Enable verbose output", &verbose
);
if (rslt.helpWanted)
{
// Capture help text to a string
import std.array : appender;
import std.format
h, -e,
-l, and -v in that order:
-h prints what one expects. If help is wanted I expect the usage
info be written on stdout though. Nothing bothers more than
programs with multiple pages of usage help written you cannot
pipe cleanly to less.
-e says "-h --help This help information&quo
h, -e,
-l, and -v in that order:
...
Thank you.
It turned out, aside from treating stderr with lockingTextWriter,
I had a couple "in" arguments, which defaultGetoptFormatter
wouldn't accept. So with all that cleared up, help is now
available. Thank you again (both of
erbose|v", "Enable verbose output", &verbose
);
if (rslt.helpWanted)
{
// Capture help text to a string
import std.array : appender;
import std.format : formattedWrite;
auto helpText = appender!string();
I think that you are almost there.
https://dlang.org/phobos/std_getopt.html#.defaultGetoptFormatter
Try using: https://dlang.org/phobos/std_stdio.html#.File.lockingTextWriter
``defaultGetoptFormatter(stderr.lockingTextWriter, "heading",
helpInformation.options);``
This seems like something which needs to be straightforward, and
yet I've spent a good amount of time getting nowhere.
How does one get the usage information which getopt embeds in a
result, and spit it out to stderr? The internals show some help
output, hard-coded to stdout. As any
On Wednesday, 19 February 2025 at 23:58:09 UTC, Salih Dincer
wrote:
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya wrote:
I'm converting Ruby code to D and am running into issues.
Would appreciate what needs to be done to get it to
compile/run correctly.
I removed 1 line in your co
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya wrote:
I'm converting Ruby code to D and am running into issues.
Would appreciate what needs to be done to get it to compile/run
correctly.
First of all, I see that you don't use reserve() at all in
arrays. Since I work on a mobile pla
On Wednesday, 19 February 2025 at 02:25:03 UTC, Salih Dincer
wrote:
have much time right now, I only saw 1 improvement. Below the
GCD filter will give the same list (lhr[]).
SDB@79
It is giving different result
On Tuesday, 18 February 2025 at 22:45:39 UTC, Jabari Zakiya wrote:
I'm bringing attention to this issue as it might improve D.
Known issue with upstream, try one of mine data structures
https://github.com/opendlang/d/blob/main/source/odc/datastructures.d
// convert lhr_mults vals > n/2 to their lhr complements
n-r,
// store them, those < n/2, in lhr_del; it now holds
non-pcp lhr vals
auto lhr_del = lhr_mults.map!((r_del) => r_del > ndiv2 ?
n - r_del : r_del).array;
lhr_del.sort!("a < b");
lhr = setDifference(lhr, l
On Wednesday, 5 February 2025 at 21:24:51 UTC, Jabari Zakiya
wrote:
On Tuesday, 4 February 2025 at 17:17:42 UTC, Jabari Zakiya
wrote:
On Monday, 3 February 2025 at 04:59:43 UTC, monkyyy wrote:
On Monday, 3 February 2025 at 04:15:09 UTC, Jabari Zakiya
wrote:
I translated this Ruby code:
FY
On Tuesday, 4 February 2025 at 17:17:42 UTC, Jabari Zakiya wrote:
On Monday, 3 February 2025 at 04:59:43 UTC, monkyyy wrote:
On Monday, 3 February 2025 at 04:15:09 UTC, Jabari Zakiya
wrote:
I translated this Ruby code:
FYI.
This code finds all the prime pairs that sum to n for all even
in
On Monday, 3 February 2025 at 04:59:43 UTC, monkyyy wrote:
On Monday, 3 February 2025 at 04:15:09 UTC, Jabari Zakiya wrote:
I translated this Ruby code:
FYI.
This code finds all the prime pairs that sum to n for all even
integers n > 2.
It (Ruby code) is included in a paper I just released
On Monday, 3 February 2025 at 04:15:09 UTC, Jabari Zakiya wrote:
I translated this Ruby code:
To this D code. It works, seems fast, can it be done shorter,
faster, more idiomatic?
translated code isnt going to be idiomatic ever; just state what
you want done
On Sunday, 2 February 2025 at 22:40:41 UTC, Jabari Zakiya wrote:
I am really impressed!
D is phenomenally memory efficient with this code.
I just ran the D code for some really large n values.
On my older Lenovo Legion 5, using Linux (June 2024) w/16GB
I was able to go up to n = 1,000,000, a
On Sunday, 2 February 2025 at 03:22:00 UTC, Jabari Zakiya wrote:
The D version is way slower, because of the array operations.
For an input of 100 (1M): D: 12+ secs; Crystal: 0.036 secs.
First of fall make sure you are using LDC or GDC compiler. Second
step is to add proper flags for optim
On Sunday, 2 February 2025 at 01:39:34 UTC, user1234 wrote:
On Sunday, 2 February 2025 at 01:12:59 UTC, user1234 wrote:
On Saturday, 1 February 2025 at 21:56:23 UTC, Jabari Zakiya
wrote:
On Saturday, 1 February 2025 at 00:21:22 UTC, user1234 wrote:
On Friday, 31 January 2025 at 20:05:54 UTC, Ja
On Sunday, 2 February 2025 at 01:12:59 UTC, user1234 wrote:
On Saturday, 1 February 2025 at 21:56:23 UTC, Jabari Zakiya
wrote:
On Saturday, 1 February 2025 at 00:21:22 UTC, user1234 wrote:
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya
wrote:
[...]
A first draft of the translation
On Saturday, 1 February 2025 at 21:56:23 UTC, Jabari Zakiya wrote:
On Saturday, 1 February 2025 at 00:21:22 UTC, user1234 wrote:
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya
wrote:
[...]
A first draft of the translation, not very idiomatic D code:
```d
module prime_pairs;
import
On Saturday, 1 February 2025 at 00:21:22 UTC, user1234 wrote:
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya wrote:
[...]
A first draft of the translation, not very idiomatic D code:
```d
module prime_pairs;
import std;
[...]
Thank you very much!
As you can see, D is not my pri
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya wrote:
I'm converting Ruby code to D and am running into issues.
Would appreciate what needs to be done to get it to compile/run
correctly.
Here's the Ruby code:
[...]
A first draft of the translation, not very idiomatic D code:
```
I'm converting Ruby code to D and am running into issues.
Would appreciate what needs to be done to get it to compile/run
correctly.
Here's the Ruby code:
```
# Enable YJIT if using CRuby >= 3.3"
RubyVM::YJIT.enable if RUBY_ENGINE == "ruby" and
RUBY_VERSION.to_f >= 3.3
def prime_pairs_lohi(
On 20/01/2025 9:08 AM, Mad - Ram wrote:
Hi how do i add my picture to the dlang website to see a pic like all
the other people in the forums
https://forum.dlang.org/help
Avatars
The forum will display avatars associated with users' email addresses.
If the email address is registered
Hi how do i add my picture to the dlang website to see a pic like
all the other people in the forums
On Friday, 18 October 2024 at 14:41:15 UTC, Mark Bauermeister
wrote:
...No more segfaults thus far but strangely the proper switch
case...
One thing that I can think looking at your code:
import std.stdio;
void main(){
int op = 1;
switch(op){
default: writeln("default"); retur
On Friday, 18 October 2024 at 14:41:15 UTC, Mark Bauermeister
wrote:
On Thursday, 17 October 2024 at 02:47:03 UTC, Mai Lapyst wrote:
[...]
Yea. I forgot about the sizeof division being wrong. I replaced
all calls to ARRAY_LEN with \.length.
[...]
Is the `switch` correct? I would expect to
On Thursday, 17 October 2024 at 02:47:03 UTC, Mai Lapyst wrote:
On Wednesday, 16 October 2024 at 13:10:34 UTC, Mark
Bauermeister wrote:
I think I got every compiler complaint fixed now. However,
upon launch the program immediately quits with "Error Program
exited with code -11". I assume that's
On Tuesday, 15 October 2024 at 15:29:09 UTC, ryuukk_ wrote:
[...]
Thanks very much.
On Wednesday, 16 October 2024 at 13:10:34 UTC, Mark Bauermeister
wrote:
I think I got every compiler complaint fixed now. However, upon
launch the program immediately quits with "Error Program exited
with code -11". I assume that's a segfault, right?
https://gist.github.com/markusbkk/442a57135
more macros.
Now if only I could figure out how to resolve "variable
`codeImage` cannot be read at compile time". That's the last
thing neither of those automation solutions can help me with.
if you mean line 966 you need to replace `enum` by `const` or
even `auto`. `enum`
iable
`codeImage` cannot be read at compile time". That's the last
thing neither of those automation solutions can help me with.
if you mean line 966 you need to replace `enum` by `const` or
even `auto`. `enum` means the value should be available in
compile time.
Ah! Makes sense.
age`
cannot be read at compile time". That's the last thing neither of those
automation solutions can help me with.
if you mean line 966 you need to replace `enum` by `const` or even
`auto`. `enum` means the value should be available in compile time.
ot;. That's the last
thing neither of those automation solutions can help me with.
On Tuesday, 15 October 2024 at 13:30:03 UTC, Mark Bauermeister
wrote:
On Tuesday, 15 October 2024 at 12:27:42 UTC, barbosso wrote:
Are you heard of https://github.com/dkorpel/ctod ?
I actually used CTOD for part of the translation but it
wouldn't translate the macros correctly. It turned them
Try this great tool by denis korpel
https://dkorpel.github.io/ctod/
I've been using it every so often to port C stuff, it's been very
helpful
```D
@nogc nothrow:
extern(C): __gshared:
union JSCFunctionType {
JSCFunction* generic;
JSValue function(JSContext* ctx, JSValueConst this_val,
On Tuesday, 15 October 2024 at 12:27:42 UTC, barbosso wrote:
Are you heard of https://github.com/dkorpel/ctod ?
I actually used CTOD for part of the translation but it wouldn't
translate the macros correctly. It turned them into weird string
mixins.
On Tuesday, 15 October 2024 at 12:13:36 UTC, monkyyy wrote:
Your probably going to need to simplify that block of code
looks awful
source code here:
https://github.com/bellard/quickjs/blob/master/quickjs.h#L1045
Are you heard of https://github.com/dkorpel/ctod ?
On Tuesday, 15 October 2024 at 12:05:16 UTC, Dakota wrote:
```c
typedef union JSCFunctionType {
JSCFunction *generic;
JSValue (*generic_magic)(JSContext *ctx, JSValueConst
this_val, int argc, JSValueConst *argv, int magic);
JSCFunction *constructor;
JSValue (*constructor_magic)(
```c
typedef union JSCFunctionType {
JSCFunction *generic;
JSValue (*generic_magic)(JSContext *ctx, JSValueConst
this_val, int argc, JSValueConst *argv, int magic);
JSCFunction *constructor;
JSValue (*constructor_magic)(JSContext *ctx, JSValueConst
new_target, int argc, JSValueC
nd here:
https://gist.github.com/markusbkk/442a571353a48c5377c503e7d02570fb
My main problem are the macro functions at line 398 in my code,
as well as the compiler telling me that "static variable
`codeImage` cannot be read at compile time".
Would really appreciate some help with this from the D Lords of
this group.
On Saturday, 28 September 2024 at 08:35:39 UTC, Johan wrote:
On Saturday, 28 September 2024 at 07:54:40 UTC, Dakota wrote:
```c
struct __attribute__((packed)) type1 {
uint32_tu32;
uint8_t u8;
uint16_tu16a;
uint16_tu16b;
uint8_t u8a;
On Saturday, 28 September 2024 at 07:54:40 UTC, Dakota wrote:
```c
struct __attribute__((packed)) type1 {
uint32_tu32;
uint8_t u8;
uint16_tu16a;
uint16_tu16b;
uint8_t u8a;
uint8_t arr[14];
};
```
the struct size in C is 24:
On Friday, 20 September 2024 at 16:21:10 UTC, Nick Treleaven
wrote:
On Friday, 20 September 2024 at 09:38:54 UTC, Dakota wrote:
Thanks to Dennis for the workaround.
Thanks your all for the tips, void solution fix me problem.
On Friday, 20 September 2024 at 09:38:54 UTC, Dakota wrote:
I need my struct defined as `isZeroInit`, so can I can import
them as `di` file. (this also reduce build size)
But I find this problem with float inside union:
```d
struct test_t {
union {
int i32;
float f32;
On Friday, 20 September 2024 at 09:38:54 UTC, Dakota wrote:
I need my struct defined as `isZeroInit`, so can I can import
them as `di` file. (this also reduce build size)
But I find this problem with float inside union:
```d
struct test_t {
union {
int i32;
float f32;
On Friday, 20 September 2024 at 09:38:54 UTC, Dakota wrote:
I consider this is compiler bug (it may take years to get fixed)
I've sent issues for compiler bugs and had them fixed within the
next release—about month, not years.
Also yes, this seems to be a compiler bug; unless there's some
s
I need my struct defined as `isZeroInit`, so can I can import
them as `di` file. (this also reduce build size)
But I find this problem with float inside union:
```d
struct test_t {
union {
int i32;
float f32;
}
}
static assert(__traits(isZeroInit, test_t) );
```
``
On Friday, 23 August 2024 at 05:50:43 UTC, Dakota wrote:
any suggestions how to fix this?
```sh
/ldc/bin/../import/core/stdc/stdio.d(31): Error: module ```
I dont use the std with wasm, everything imports everything else
and there are just broken symbols deep in "core" that wont be
fixed
On Thursday, 22 August 2024 at 21:19:57 UTC, monkyyy wrote:
On Thursday, 22 August 2024 at 07:28:00 UTC, Dakota wrote:
Is there a way to link ldc objects with Emscripten to build
wasm binary ?
yes; you'll have to untangle my build system
https://github.com/crazymonkyyy/raylib-2024
It will al
On Thursday, 22 August 2024 at 07:28:00 UTC, Dakota wrote:
Is there a way to link ldc objects with Emscripten to build
wasm binary ?
yes; you'll have to untangle my build system
https://github.com/crazymonkyyy/raylib-2024
It will always suck tho
On Thursday, 22 August 2024 at 07:28:00 UTC, Dakota wrote:
Is there a way to link ldc objects with Emscripten to build
wasm binary ?
Some years a go, i was able to build and run my hobby game using
EMScripen. Things must be changed now. I drop the link here. I
cannot help further since i
On Monday, 15 July 2024 at 11:16:23 UTC, Nick Treleaven wrote:
I put `type_s` in a file anonstruct.c, then:
```d
import anonstruct;
pragma(msg, isStatic!(type_s.c));
```
That outputs `false`, because the symbol is not a compile-time
value. Is that what you meant?
No, I am here deal with a lo
1 - 100 of 1096 matches
Mail list logo