On Tuesday, 17 October 2023 at 07:22:41 UTC, Vitaliy Fadeev wrote:
On Tuesday, 17 October 2023 at 06:57:07 UTC, Imperatorn wrote:
On Tuesday, 17 October 2023 at 06:46:31 UTC, Vitaliy Fadeev
wrote:
Hi all!
I want readable mixin.
I want pass variable to string.
I want string with named args.
On Tuesday, 17 October 2023 at 06:57:07 UTC, Imperatorn wrote:
On Tuesday, 17 October 2023 at 06:46:31 UTC, Vitaliy Fadeev
wrote:
Hi all!
I want readable mixin.
I want pass variable to string.
I want string with named args.
Like this:
```D
enum JMP_ADDR_R = "RAX";
mixin( format!"asm {
Hi all!
I want readable mixin.
I want pass variable to string.
I want string with named args.
Like this:
```D
enum JMP_ADDR_R = "RAX";
mixin( format!"asm {
jmp [JMP_ADDR_R];
}"( JMP_ADDR_R ));// IT NOT WORK
```
Not this:
```D
enum JMP_ADDR_R = "RAX";
mixin(
On Friday, 22 September 2023 at 19:50:17 UTC, Christian Köstlin
wrote:
On 17.09.23 17:05, Vitaliy Fadeev wrote:
Hi!
You could model it oop style like this:
https://run.dlang.io/is/MJb5Fk
This solution might not be to your taste, as it involves
interfaces, and classes and objects and garbage
On Friday, 22 September 2023 at 21:37:37 UTC, Imperatorn wrote:
On Friday, 22 September 2023 at 14:03:40 UTC, Vitaliy Fadeev
wrote:
On Friday, 22 September 2023 at 12:53:28 UTC, Imperatorn wrote:
You're basically just describing polymorphism. I can post an
example tomorrow, it's midnight here
On Friday, 22 September 2023 at 19:50:17 UTC, Christian Köstlin
wrote:
another option could be to model your own VTable in a struct
like this:
https://run.dlang.io/is/3LTjP5
Kind regards,
Christian
Thank, Christian !
True nice tasty solution with ```VTable```!
And further... the project is
On Friday, 22 September 2023 at 22:48:34 UTC, claptrap wrote:
On Friday, 22 September 2023 at 14:29:08 UTC, Vitaliy Fadeev
wrote:
x86 first bit check (odd check):
```asm
AND EAX, EAX ; update FLAG OF // odd flag
JO Label
```
Is there D-Lang operator of optimized library function ?
There's
x86 first bit check (odd check):
```asm
AND EAX, EAX ; update FLAG OF // odd flag
JO Label
```
Is there D-Lang operator of optimized library function ?
On Friday, 22 September 2023 at 12:53:28 UTC, Imperatorn wrote:
On Friday, 22 September 2023 at 03:33:08 UTC, Vitaliy Fadeev
wrote:
On Friday, 22 September 2023 at 02:51:10 UTC, Vitaliy Fadeev
wrote:
...
```
Chip
id
name
Sense()
Draw()
```
instance
```
chip = new Chip();
```
On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev
wrote:
...
Skip this thread. I see solution.
How to delete missed posts on this forum ?
able ?
how to use correctly?
```d
import std.parallelism;
auto async_task = task!fn( args ); // error
// Error: no property
`opCall` for type `app.A`, did you mean `new A`?
async_task.executeInNewThread();
```
where
```d
auto a = new A();
auto
On Friday, 22 September 2023 at 03:33:08 UTC, Vitaliy Fadeev
wrote:
On Friday, 22 September 2023 at 02:51:10 UTC, Vitaliy Fadeev
wrote:
...
the most correct
```
chip
__vtbl ---+ // one of
__monitor |
id|
name |
|-> Chip // init
|
On Friday, 22 September 2023 at 02:51:10 UTC, Vitaliy Fadeev
wrote:
...
```
Chip
id
name
Sense()
Draw()
```
instance
```
chip = new Chip();
```
compiled to
```
chip
__vtbl -> Chip
__monitor Sense()
idDraw()
On Thursday, 21 September 2023 at 18:19:47 UTC, Imperatorn wrote:
On Sunday, 17 September 2023 at 15:05:59 UTC, Vitaliy Fadeev
wrote:
Hi!
I want to change a method ```Draw``` on a custom object when
the ```MouseIn``` event occurs.
This is known as "Change State" of the object: ```Init``` ->
On Tuesday, 19 September 2023 at 06:33:25 UTC, Richard (Rikki)
Andrew Cattermole wrote:
I assume what you are wanting is to get the alignment for a
given type?
https://dlang.org/spec/property.html#alignof
If instead you want the offset of a given field that's
different.
On Tuesday, 19 September 2023 at 03:53:06 UTC, Richard (Rikki)
Andrew Cattermole wrote:
There are no operators for this, not that you need one.
```d
void func(int numerator, int denominator, out int quotient, out
int remainder) {
quotient = numerator / denominator;
remainder =
What D function or D operator does this?
```asm
IDIV EAX, r/m32
```
```
IDIV 5, 2
EAX = 2
EDX = 1
```
and returns (2,1) at once?
Is it possible to write like this in D?
```d
struct Message
{
ulong timestamp;
}
Message LongMessage
{
ubyte[255] s;
}
//
// it mean
//
// struct LongMessage
// {
// Message _super;
// alias _super this;
// ubyte[255] s;
// }
//
// or
//
// struct LongMessage
// {
//
On Sunday, 17 September 2023 at 15:05:59 UTC, Vitaliy Fadeev
wrote:
...
Playground: https://run.dlang.io/is/hjcLCk
Hi!
I want to change a method ```Draw``` on a custom object when the
```MouseIn``` event occurs.
This is known as "Change State" of the object: ```Init``` ->
```Hovered```.
I want to change the state of an object by changing its class,
like this:
```d
this.__vptr = typeid(CLS).vtbl.ptr;
On Thursday, 15 December 2022 at 06:08:32 UTC, Vitaliy Fadeev
wrote:
On Wednesday, 14 December 2022 at 17:44:05 UTC, Ali Çehreli
wrote:
On 12/14/22 09:41, Ali Çehreli wrote:
> // According to documentation, the handler must be
created dynamically:
> // We make a unique owner for it:
On Wednesday, 14 December 2022 at 17:44:05 UTC, Ali Çehreli wrote:
On 12/14/22 09:41, Ali Çehreli wrote:
> // According to documentation, the handler must be
created dynamically:
> // We make a unique owner for it:
Last try is customized **std.typecons.Unique**:
```
module
On Wednesday, 14 December 2022 at 17:41:07 UTC, Ali Çehreli wrote:
On 12/14/22 05:58, Vitaliy Fadeev wrote:
> On Wednesday, 14 December 2022 at 11:30:07 UTC, Vitaliy
Fadeev wrote:
>> How to define HANDLE var ? What to return from procedure?
How to call
>> CloseHandle( h ) when variable
On Wednesday, 14 December 2022 at 11:30:07 UTC, Vitaliy Fadeev
wrote:
How to define HANDLE var ? What to return from procedure? How
to call CloseHandle( h ) when variable destroyed?
I was trying **std.typecons.Unique**. But where I must put
**CloseHandle( h )** ?
I was trying
On Monday, 27 September 2021 at 13:45:19 UTC, Paul wrote:
Vitaliy,
Thanks for your assistance. I was looking at your
serialization package. Is your example correct?
struct MyStruct {
ubyte mybyte1;
@NoCereal uint nocereal1; //won't be serialised
@Bits!4 ubyte
On Sunday, 26 September 2021 at 15:09:38 UTC, Paul wrote:
Is there way to write the myStruct data to the file in a single
statement...or two?
Thanks for any assistance.
Header[1] header;
void readFileHeader( ref File f )
{
f.rawRead( header );
}
26 matches
Mail list logo