On Sunday, 7 April 2019 at 14:08:07 UTC, Archie Allison wrote:
This generally works OK when tied to a Console but when link
options are changed to be SUBSYSTEM:WINDOWS and
ENTRY:mainCRTStartup it rarely does.
Manually setting the entry point sounds problematic if no other
precautions are ta
On Sunday, 7 April 2019 at 17:52:40 UTC, Mike Wey wrote:
How are you using the GUI, GTK is not thread safe, all gui
function calls should be made from the GUI thread.
Last time i checked threadsEnter and threadsLeave didn't work
properly on windows.
All GUI updates are sent from a worker
On 04/07/2019 08:41 AM, Robert M. Münch wrote:
> I have an AA int[ulong] and would like to traverse the AA from biggest
> to smallest by value. Is there an elegant way to do this?
Because associative array is a data structure to use when the order is
not important, it comes down to getting the v
On Sunday, 7 April 2019 at 18:22:00 UTC, Robert M. Münch wrote:
On 2019-04-07 17:16:12 +, Seb said:
Then you can do:
---
["a": 1].byPair.array.sort!((a, b) => a.value <
a.value).release.each!writeln;
---
You'll have a sorted array with key and value props.
This seems to be really tric
On Sunday, 7 April 2019 at 20:02:15 UTC, Seb wrote:
On Sunday, 7 April 2019 at 18:22:00 UTC, Robert M. Münch wrote:
On 2019-04-07 17:16:12 +, Seb said:
Then you can do:
---
["a": 1].byPair.array.sort!((a, b) => a.value <
a.value).release.each!writeln;
---
You'll have a sorted array wit
On Sunday, 7 April 2019 at 18:22:00 UTC, Robert M. Münch wrote:
Error: no property sort for type Tuple!(uint, "key", int,
"value")[]
Did you import it?
import std.algorithm;
On 2019-04-07 17:16:12 +, Seb said:
Then you can do:
---
["a": 1].byPair.array.sort!((a, b) => a.value < a.value).release.each!writeln;
---
You'll have a sorted array with key and value props.
This seems to be really tricky:
int[uint] myArray;
foreach(key, value; myArray.byPair.array.s
On 2019-04-07 17:35:23 +, bauss said:
Import std.array
:-/ Thanks...
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
On 07-04-2019 16:49, Archie Allison wrote:
The codebase is a reasonable size so too big (and proprietary) to share.
It's always run with a GUI (GTKD), it's just the difference in linking
so launching (a)GUI + attached console for stdout.writeln vs. (b)just
the GUI window. There's nothing I'd e
On Sunday, 7 April 2019 at 15:35:46 UTC, FeepingCreature wrote:
On Sunday, 7 April 2019 at 03:47:25 UTC, Alex wrote:
rules are meant to be broken.
No they're not! Almost by definition not!
More comprehensively, if you break a rule you take
responsibility for the outcome. You wanna use string
On Sunday, 7 April 2019 at 15:26:47 UTC, Adam D. Ruppe wrote:
On Sunday, 7 April 2019 at 03:47:25 UTC, Alex wrote:
What you need to tell me is why using .stringof is bad. You
have simply conjured up a rule and are stating it but not
giving any reason why it is not a good idea to follow when, in
On Sunday, 7 April 2019 at 16:44:01 UTC, Robert M. Münch wrote:
On 2019-04-07 16:24:52 +, Cym13 said:
You could use sort to gather the indexes in order then
traverse from there:
aa.byKey.array.sort!((a, b) => aa[a]
That doesn't work: Error: no property array for type Result
With a
On Sunday, 7 April 2019 at 16:44:01 UTC, Robert M. Münch wrote:
On 2019-04-07 16:24:52 +, Cym13 said:
You could use sort to gather the indexes in order then
traverse from there:
aa.byKey.array.sort!((a, b) => aa[a]
That doesn't work: Error: no property array for type Result
With a
Le 07/04/2019 à 14:23, bauss via Digitalmars-d-learn a écrit :
On Saturday, 6 April 2019 at 19:47:14 UTC, lithium iodate wrote:
On Saturday, 6 April 2019 at 15:35:22 UTC, diniz wrote:
So, I still could store and use and compare string pointers myself [1], and
get valid results, meaning: pointer
On Sunday, 7 April 2019 at 13:45:15 UTC, Paul Backus wrote:
On Sunday, 7 April 2019 at 12:19:10 UTC, bauss wrote:
On Saturday, 6 April 2019 at 20:16:06 UTC, Paul Backus wrote:
On Saturday, 6 April 2019 at 19:31:15 UTC, Robert M. Münch
wrote:
I have a C interface that uses a parameter of type in
On 2019-04-07 16:24:52 +, Cym13 said:
You could use sort to gather the indexes in order then traverse from there:
aa.byKey.array.sort!((a, b) => aa[a]
That doesn't work: Error: no property array for type Result
With a wrapper caching that order and making it transparent as well as
On Sunday, 7 April 2019 at 15:41:51 UTC, Robert M. Münch wrote:
I have an AA int[ulong] and would like to traverse the AA from
biggest to smallest by value. Is there an elegant way to do
this?
The only way I can imagine is to create an "reverse" AA of the
form ulong[int] and than sort by keys
On 07.04.19 17:36, Robert M. Münch wrote:
The docs state that an alias can either be related to the type or the
symbol. Hence, in my case I expected it to be the symbol...
The symbol is `X.a`. A field of an instance doesn't make a distinct symbol.
I have an AA int[ulong] and would like to traverse the AA from biggest
to smallest by value. Is there an elegant way to do this?
The only way I can imagine is to create an "reverse" AA of the form
ulong[int] and than sort by keys. Traverse this AA and use the value as
the lookup key in the org
On Sunday, 7 April 2019 at 03:47:25 UTC, Alex wrote:
rules are meant to be broken.
No they're not! Almost by definition not!
More comprehensively, if you break a rule you take responsibility
for the outcome. You wanna use stringof? "Don't use stringof for
that." "rules are meant to be broken
On 2019-04-07 14:05:13 +, ag0aep6g said:
You can't make an alias to a field of an object. The alias will be made
in relation to the type instead. (If that makes sense. I'm not sure how
to phrase it best.)
The docs state that an alias can either be related to the type or the
symbol. Hence
On Sunday, 7 April 2019 at 03:47:25 UTC, Alex wrote:
What you need to tell me is why using .stringof is bad. You
have simply conjured up a rule and are stating it but not
giving any reason why it is not a good idea to follow when, in
fact, not following can be shown to be beneficial.
You can'
On 4/6/19 11:47 PM, Alex wrote:
> What you need to tell me is why using .stringof is bad. You have simply
> conjured up a rule and are stating it but not giving any reason why it
> is not a good idea to follow when, in fact, not following can be shown
> to be beneficial.
I'm not Adam, but I've als
On 3/29/19 7:52 PM, H. S. Teoh wrote:
On Fri, Mar 29, 2019 at 10:48:47PM +, Chris Katko via Digitalmars-d-learn
wrote:
...> There are probably other similar gotchas, but these are the ones
off the
top of my head. Feel free to ask if you're having trouble correctly
translating something fr
On Sunday, 7 April 2019 at 14:35:24 UTC, Doc Andrew wrote:
When you say it "rarely works" when run as a GUI app (vs
console), it makes me think that there's probably a race
condition going on, and the extra context switching that takes
place in GUI mode makes it more likely. I haven't tried it
On 4/7/19 1:30 AM, Nicholas Wilson wrote:
> On Sunday, 7 April 2019 at 05:24:38 UTC, Alex wrote:
>> Error: template instance `Reflect!(type)` cannot use local `type` as
>> parameter to non-global template `Reflect(Ts...)()`
>>
>> mixin(`import `~moduleName!(T)~`;`);
>> mixin(`alias X = T.`~name~
On Sunday, 7 April 2019 at 14:08:07 UTC, Archie Allison wrote:
I have written an industrial control program which uses serial
ports to communicate with hardware but am having problems,
perhaps with shared memory, on Windows.
The SerialPort class calls C object-file functions. Transmits
are on
On 07.04.19 14:23, Robert M. Münch wrote:
struct X {
TYPE a;
TYPE b;
}
myFunc(X _struct){
alias a = _struct.a;
a = myOtherFunc();
}
X myStruct;
myFun(myStruct);
This gives an error: need this for a of type void*
I don't understand why, because all I want is a shortcut
I have written an industrial control program which uses serial
ports to communicate with hardware but am having problems,
perhaps with shared memory, on Windows.
The SerialPort class calls C object-file functions. Transmits are
on one thread and receives on another (all within a class derived
On Sunday, 7 April 2019 at 12:19:10 UTC, bauss wrote:
On Saturday, 6 April 2019 at 20:16:06 UTC, Paul Backus wrote:
On Saturday, 6 April 2019 at 19:31:15 UTC, Robert M. Münch
wrote:
I have a C interface that uses a parameter of type intptr_t.
Wondering if size_t is the correct D equivalent?
T
On Saturday, 6 April 2019 at 19:47:14 UTC, lithium iodate wrote:
On Saturday, 6 April 2019 at 15:35:22 UTC, diniz wrote:
So, I still could store and use and compare string pointers
myself [1], and get valid results, meaning: pointer equality
implies (literal) string equality. Or am I wrong? The
struct X {
TYPE a;
TYPE b;
}
myFunc(X _struct){
alias a = _struct.a;
a = myOtherFunc();
}
X myStruct;
myFun(myStruct);
This gives an error: need this for a of type void*
I don't understand why, because all I want is a shortcut the symbol of
the parameter.
On Sunday, 7 April 2019 at 04:58:13 UTC, Alex wrote:
Is there any way to get sequences of sequences?
Using RT, I have to use strings
[[`string`, `0`], ...]
when it would be much better to use
[[string, 0], ...]
Ideally it wouldn't add so much overhead that it defeats the
purpose.
https://
On Saturday, 6 April 2019 at 20:16:06 UTC, Paul Backus wrote:
On Saturday, 6 April 2019 at 19:31:15 UTC, Robert M. Münch
wrote:
I have a C interface that uses a parameter of type intptr_t.
Wondering if size_t is the correct D equivalent?
The correct equivalent is `intptr_t` from `core.stdc.std
On Sunday, 7 April 2019 at 10:17:53 UTC, AltFunction1 wrote:
On Sunday, 7 April 2019 at 10:05:26 UTC, kdevel wrote:
In § 28.3 Pointers and the Garbage Collector [1] we read
Do not add or subtract an offset to a pointer such that the
result points
outside of the bounds of the garbage coll
On Sunday, 7 April 2019 at 10:05:26 UTC, kdevel wrote:
In § 28.3 Pointers and the Garbage Collector [1] we read
Do not add or subtract an offset to a pointer such that the
result points
outside of the bounds of the garbage collected object
originally allocated.
[...]
No the foo() cod
In § 28.3 Pointers and the Garbage Collector [1] we read
Do not add or subtract an offset to a pointer such that the
result points
outside of the bounds of the garbage collected object
originally allocated.
char* p = new char[10];
char* q = p + 6; // ok
q = p + 11;
On 07.04.19 06:58, Alex wrote:
Is there any way to get sequences of sequences?
Using RT, I have to use strings
[[`string`, `0`], ...]
when it would be much better to use
[[string, 0], ...]
Ideally it wouldn't add so much overhead that it defeats the purpose.
You can make a template that do
On 07.04.19 05:32, Alex wrote:
readlin is not a CT function. You misinterpreted what I said.
Yeah, bad example from me. This would probably have been better:
auto v = "foo";
enum y = f(v); /* Error: variable v cannot be read at compile time */
Also, the `readln` example wasn't meant
On Sunday, 7 April 2019 at 06:39:05 UTC, zabruk wrote:
On Sunday, 7 April 2019 at 03:32:45 UTC, Alex wrote:
just execute them at CT if possible(and the possibility simply
is if the inputs are known at CT).
imho, Bastiaan Veelo want to say about citate above: not just
"if possible", but "only
On 2019-04-06 20:16:06 +, Paul Backus said:
On Saturday, 6 April 2019 at 19:31:15 UTC, Robert M. Münch wrote:
I have a C interface that uses a parameter of type intptr_t. Wondering
if size_t is the correct D equivalent?
The correct equivalent is `intptr_t` from `core.stdc.stdint`.
Ha, t
On 2019-04-06 20:16:14 +, Bastiaan Veelo said:
On Saturday, 6 April 2019 at 12:06:22 UTC, Robert M. Münch wrote:
The idea is, that I can write a string (or maybe even a scope block?)
in my DSL and use a CTFE grammer to transpile the code.
Are you aware of Pegged[1]? It’s for exactly that.
42 matches
Mail list logo