Maybe Ada.
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.
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.
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.
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?
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);
See
https://forum.dlang.org/post/kqvpjwbkpravywald...@forum.dlang.org
if(GetFileType(GetStdHandle(STD_OUTPUT_HANDLE))==FILE_TYPE_PIPE)setvbuf()
That said, full buffering for pipes may be not all that
profitable, so it makes sense to always set line buffering for
pipes and leave full buffering only for file.
On Tuesday, 18 August 2020 at 19:01:17 UTC, Marcone wrote:
SFX zip in it is properties: https://i.imgur.com/dH7jl5n.png
Opening with winRar: https://i.imgur.com/s7C9mZn.png
Probably winrar messing with your file manager. Try to uninstall
ungerister winrar from your file manager or try a differ
On Sunday, 16 August 2020 at 18:13:07 UTC, Anonymouse wrote:
Just as a drive-by comment, the main stdio thing I came across
that I couldn't do from within @safe was stdout.flush(), which
I need to call manually for Cygwin terminals and some terminals
embedded in editors (vscode). If someone kno
Because it's used with C `time` function
https://github.com/dlang/druntime/blob/master/src/core/stdc/time.d#L37 which is provided by msvcrt as 32-bit function. 64-bit variant has a different name.
On Monday, 27 July 2020 at 09:41:44 UTC, wjoe wrote:
But it's possible when bound with the socket option
SO_REUSEPORT (at least that's the name of the flag on linux
since 3.9).
The docs say it can't be used to hijack an address.
This option must be set on each socket (including the first
sock
On Wednesday, 22 July 2020 at 16:14:24 UTC, wjoe wrote:
If you send a UDP datagram to a single address, however, it
will still be delivered to every program on that PC which
receives UDP datagrams from that port.
Normally binding two sockets to the same port is not allowed.
Yes, all the synchronization and casting pretty much mandates
that shared data must be behind some kind of abstraction for
better ergonomics and better correctness too.
---
import std;
shared class TimeCount {
synchronized void startClock() {
auto me = cast()this;
me.startTime = Clock.currTime;
}
synchronized void endClock() {
auto me = cast()this;
me.endTime = Clock.currTime
---
import std;
shared class TimeCount {
void startClock() {
auto me = cast()this;
me.startTime = Clock.currTime;
}
void endClock() {
auto me = cast()this;
me.endTime = Clock.currTime;
}
void c
On Monday, 13 July 2020 at 07:26:06 UTC, Arafel wrote:
That's exactly why what I propose is a way to *explicitly* tell
the compiler about it, like @system does for safety.
With __gshared you can opt out from sharing safety, then you're
back to old good C-style multithreading.
I mean runas your own program.
Well, you can elevate your own program and tell it to run that
command, collect the result and send it back through e.g. shared
memory.
You call ShellExecute with "runas" verb:
https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea
On Friday, 10 July 2020 at 17:18:25 UTC, mw wrote:
On Friday, 10 July 2020 at 08:48:38 UTC, Kagamin wrote:
On Friday, 10 July 2020 at 05:12:06 UTC, mw wrote:
looks like we still have to cast:
as of 2020, sigh.
Why not?
Because cast is ugly.
Implicitly escaping thread local data into share
On Friday, 10 July 2020 at 05:12:06 UTC, mw wrote:
looks like we still have to cast:
as of 2020, sigh.
Why not?
Without contradictions the solution is trivial:
module config;
version(LogEnabled) enum isEnabled=true;
else enum isEnabled=false;
shared int level;
Contradictions that don't let you glue it all together.
If you suspect there's a contradiction in requirements, you need
to specify them with better precision.
try
https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-setunhandledexceptionfilter
You can store the delegate in an array and invoke it by index.
bson_t* bson_new_from_json(in char* data, long len, bson_error_t*
error);
string str_utf8 = "{\"a\":1}";
bson_error_t error;
auto bson = bson_new_from_json(str_utf8.ptr, str_utf8.length,
&error);
You have a wrong declaration for bson_error_t too.
On Monday, 29 June 2020 at 19:55:59 UTC, Steven Schveighoffer
wrote:
Yep, for sure. I'll file an issue. Anyone know why the calling
convention would differ?
It's easier to enforce left to right evaluation order this way:
arguments are pushed to stack as they are evaluated, which is
pascal cal
On Saturday, 27 June 2020 at 14:49:34 UTC, James Gray wrote:
I have produced something which essentially reproduces my
problem.
What is the problem? Do you have a leak or you want to know how
GC works?
On Sunday, 28 June 2020 at 07:09:53 UTC, Виталий Фадеев wrote:
I want light-weight runtime !
How to ?
Runtime provides language features that rely on extra code.
Removing that code from runtime means to give up on corresponding
language features. This way you can implement only features you
On Saturday, 27 June 2020 at 07:51:21 UTC, adnan338 wrote:
On Saturday, 27 June 2020 at 07:31:56 UTC, Kagamin wrote:
std.concurrency is for noninteractive appications, the
approach with gui timer was the correct one.
Thank you. That works but my progress bar is sometimes getting
stuck because
std.concurrency is for noninteractive appications, the approach
with gui timer was the correct one.
On Friday, 26 June 2020 at 10:12:09 UTC, Jacob Carlborg wrote:
Downloading files over TLS. This seems that it's something that
should be quite simple to do. My high level goals are
cross-platform and easy distribution. I don't need anything
fancy just a simple API like this:
download("https:/
If you want to use them from D, you need those classes and
methods declared in the D language, in text.
Not sure how much synchronization do you want to do.
import gio.Application : GioApplication = Application;
import gtk.Application : Application;
import gtk.ApplicationWindow : ApplicationWindow;
import gtk.ProgressBar : ProgressBar;
import glib.Timeout : Timeout;
import gtkc.gtktypes : GApplicat
string param="aa";
parameters[param]=Parameter();
in id=parameters[param].id;
that's
int id=parameters[param].id;
Logic is apparently still in flux, too early to document.
On Thursday, 21 May 2020 at 17:19:10 UTC, Konstantin wrote:
Hi all! I will try to ask again(previous two posts still have
no answers) : are there any site/page/docs somewhere to track
actual info about @nogc support in language itself and in
phobos library? Or, at least plans to extend such sup
On Monday, 18 May 2020 at 17:20:17 UTC, BoQsc wrote:
It would be great if we could change/customise the icon of the
Command line application that run the HelloWorld application.
But I have a bad feeling that it is probably not possible
without a GUI library.
I think the window icon is just th
On Monday, 18 May 2020 at 17:02:02 UTC, BoQsc wrote:
The important question is: how can we change the name/title of
this Command Line application.
As the simplest solution, you can set the window title in
shortcut properties.
On Monday, 27 April 2020 at 10:28:04 UTC, mark wrote:
I renamed the class shown in my previous post from View to
InnerView, then created a new View class:
class View : ScrolledWindow {
import qtrac.debfind.modelutil: NameAndDescription;
InnerView innerView;
this() {
super(
Maybe if you teach dparse to do this check.
On Thursday, 19 March 2020 at 13:10:29 UTC, Steven Schveighoffer
wrote:
Similar for me but not GameMaker but RPG Maker.
I've seen all your work on the language, and this is a pretty
good endorsement.
Not sure if I'm ready to pay for it though, I want to make sure
his motivation/drive is not
https://issues.dlang.org/show_bug.cgi?id=19495#c1
On Monday, 18 November 2019 at 06:44:43 UTC, Joel wrote:
```
http://www.w3.org/2001/XMLSchema-instance";>
```
You're missing a closing tag.
On Wednesday, 13 November 2019 at 16:43:27 UTC, IGotD- wrote:
On Wednesday, 13 November 2019 at 15:30:33 UTC, Dukc wrote:
I'm not 100% sure what managed pointers mean -Are they so that
you can't pass them to unregistered memory? A library solution
would likely do -wrap the pointer in a struct
On Wednesday, 23 October 2019 at 11:20:59 UTC, Per Nordlöw wrote:
Does DMD/LDC avoid range-checking in slice-expressions such as
the one in my array-overload of `startsWith` defined as
bool startsWith(T)(scope const(T)[] haystack,
scope const(T)[] needle)
{
if (haystack.l
On Wednesday, 23 October 2019 at 11:20:59 UTC, Per Nordlöw wrote:
Does DMD/LDC avoid range-checking in slice-expressions such as
the one in my array-overload of `startsWith` defined as
bool startsWith(T)(scope const(T)[] haystack,
scope const(T)[] needle)
{
if (haystack.l
On Sunday, 29 September 2019 at 02:09:56 UTC, Hossain Adnan wrote:
On Saturday, 28 September 2019 at 13:37:12 UTC, Kagamin wrote:
https://ddbus.dpldocs.info/ddbus.bus.requestName.html
It requires a Connection type which I cannot find in the API.
It's in ddbus.thin, missing documentation comm
On Sunday, 29 September 2019 at 02:09:56 UTC, Hossain Adnan wrote:
On Saturday, 28 September 2019 at 13:37:12 UTC, Kagamin wrote:
https://ddbus.dpldocs.info/ddbus.bus.requestName.html
It requires a Connection type which I cannot find in the API.
It's in ddbus.thin, missing documentation comm
https://ddbus.dpldocs.info/ddbus.bus.requestName.html
Maybe you upgraded SFML and now binding doesn't match?
On Thursday, 5 September 2019 at 12:46:06 UTC, berni wrote:
OK. This are two solutions and although I'll probably not going
to use any of those (due to other reasons), I still don't
understand, why the original approach does not work. If I've
got a book an put it in a box and later I'll get it
Maybe something like this
https://forum.dlang.org/post/hloitwqnisvtgfoug...@forum.dlang.org
On Monday, 26 August 2019 at 12:02:12 UTC, GreatSam4sure wrote:
I want customizable GUI toolkit like JavaFX and adobe spark
framework in D.
DWT was translated from java SWT, you can do the same for JavaFX,
D is heavily based on java and there's an automatic translation
tool from java to D.
You're probably interested in readiness, not possibility?
On Wednesday, 31 July 2019 at 22:30:52 UTC, Alexandre wrote:
1) Improve as a programmer
2) Have fun doing programs
Thats it basically. I am planning to study all "free" time I
have. I am doing basically this since last year.
Try Basic. It has builtin graphics, seeing you program draw is
quit
On Sunday, 28 July 2019 at 12:56:12 UTC, BoQsc wrote:
Right now, I'm thinking what is correct way to run another .d
script from a .d script. Do you have any suggestions?
You mean something like execute(["rdmd", "another.d"]); ?
On Thursday, 25 July 2019 at 12:46:48 UTC, Oleg B wrote:
What reason for such restrictions? It's fundamental idea or
temporary implementation?
I think it's a dmd limitation. Currently it has a bug that it can
still generate code for ctfe templated functions, and they will
fail to link if they
On Sunday, 21 July 2019 at 07:04:00 UTC, rikki cattermole wrote:
COM is used heavily in WinAPI since about Vista. Pretty much
all new functionality has been exposed by it and NOT
extern(Windows) functions which was the standard during up to
about XP (for example notification icons would today b
On Tuesday, 16 July 2019 at 01:38:49 UTC, evilrat wrote:
Also from what I see MS done this intentionally, means they
either no longer loves COM or there was some other good reason.
Primary consumer of COM interfaces is Visual Basic. It was really
only Bill Gates who loved Basic, he wrote a Bas
TBH modern computers are obscenely powerful, I just spent weeks
on celeron 1.8GHz 2mb L2 cache 2gb ram computer and didn't see
any slowness on it despite some bloated software in python and a
strange text editor pluma that ate 150mb ram just editing a plain
text file, I swear it's not based on
On Saturday, 22 June 2019 at 01:27:31 UTC, lili wrote:
A nick site, has a lot of languages, unfortunately no dlang in
there.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/
See https://github.com/kostya/benchmarks
You should declare methods too, see example
https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d
On Friday, 17 May 2019 at 06:58:54 UTC, Marco de Wild wrote:
Thank you. I've looked into it, and it appears to be quite a
big library. I've looked into mach.collect and mach.range, but
I didn't manage to find what I was looking for (a simple array
data structure). Do you recommend to look into
Try mach.d https://github.com/pineapplemachine/mach.d it uses
explicit range accessors for iteration.
Assert failure uses system IO API, try
https://docs.microsoft.com/en-us/windows/console/setstdhandle
struct myFramework {
myFrameworkAccessor myFWApp;
}
interface myFrameworkApp {
void init();
}
main(){
myFramework mf = new myFramework;
mf.myFWApp.init(); // this bombs because myFWApp is NULL
}
struct myFrameworkAccessor {
myFrameworkApp instance()
You better obfuscate the password on client side.
fwrite, fputc - that's missing C library.
If you have a slow memory leak, you can speed it up by a stress
test. Also the debug built application can run in a separate
environment.
Well, if the code is too complex to debug, the usual solution is
to try simpler code and see if it works.
Maybe just use mixin template?
mixin template f(alias values)
{
static foreach(v;values)
mixin("bool " ~ v ~ " = false;");
}
int main()
{
enum string[] a=["a","b"];
mixin f!a;
return 0;
}
https://dlang.org/spec/function.html#property-functions
On Sunday, 7 April 2019 at 14:49:20 UTC, Archie Allison wrote:
The codebase is a reasonable size so too big (and proprietary)
to share.
You can reduce it to a minimal example that doesn't work. Static
variables are thread local by default in D unless they are marked
as shared or __gshared.
There was this old project: http://dsource.org/projects/ddl/
On Saturday, 16 March 2019 at 14:57:35 UTC, Paul Backus wrote:
This code fails to compile if you change `auto s2` to `const
s2`--in other words, it has the same problem as the original
example.
Maybe there's not much need for qualifiers anyway.
struct S(T) {
T value;
}
auto make(T)(ref T
struct S(T) {
T value;
bool opEquals(U:S!V,V)(in U r) const
{ return value==r.value; }
}
On Monday, 11 March 2019 at 15:23:34 UTC, BoQsc wrote:
If it is unavoidable to use Floating point, how can I quickly
and simply understand the rules of using float to make the
least error, or should I just find a third party package for
that as well?
It's taught in a computational mathematics
On Tuesday, 5 March 2019 at 01:43:42 UTC, solidstate1991 wrote:
https://github.com/ZILtoid1991/dimage/blob/master/source/dimage/png.d
It seems that after a certain point, it doesn't add more data
to the compression stream, flushing doesn't help.
What do you mean by "doesn't add"?
ubyte[] sli
byte[] snappyCompress(in byte[] plaintext) {
import deimos.snappy.snappy;
size_t output_length =
snappy_max_compressed_length(plaintext.length);
byte[] output = new byte[output_length];
if(snappy_compress(cast(char*)plaintext.ptr, plaintext.length,
cast(char*)output.ptr, &outp
On Tuesday, 19 February 2019 at 16:38:17 UTC, drug wrote:
The same I can say about properties - for example I use them in
meta programming to detect what to serialize/process - I skip
methods but serialize properties and for me this is a nice
language feature.
Serialization of arbitrary stuff
On Tuesday, 19 February 2019 at 15:30:22 UTC, Atila Neves wrote:
I keep hearing how const is nigh unusable in D, and except for
ranges I litter my code with const everywhere, pretty much just
as often as I used in C++.
I once spent a good amount of effort to annotate my code with
pure and ino
Union is just a pretty cast, type system guarantees don't hold
for it.
D has immutable data, const allows to consume both mutable and
immutable data.
On Friday, 8 February 2019 at 05:28:30 UTC, DanielG wrote:
Is this correct behavior?
It's correct for Windows: address of imported data is not known
at link time and must use dynamic linkage. AFAIK, export
attribute doesn't do much on posix platforms.
On Sunday, 3 February 2019 at 14:42:13 UTC, Ron Tarrant wrote:
This morning I was Googling "singleton replacement" and someone
on another forum said Factory would do the job. Anyone have
thoughts on that?
It's usually replaced with inversion of control: the service
instance is passed as an ar
It's a strong typed handle, in C it's declared as
#ifdef STRICT
typedef void *HANDLE;
#if 0 && (_MSC_VER > 1000)
#define DECLARE_HANDLE(name) struct name##__; typedef struct
name##__ *name
#else
#define DECLARE_HANDLE(name) struct name##__{int unused;};
typedef struct name##__ *name
#endif
#e
also
http://blogs.microsoft.co.il/pavely/2009/07/23/changing-console-fonts/
Create a shortcut to cmd.exe and edit its properties. The console
window itself has a system menu for this too.
Try workarounds here:
https://issues.dlang.org/show_bug.cgi?id=1448
https://issues.dlang.org/show_bug.cgi?id=2742
I believe this is historical. It will fail because atomics are
combinatorially parameterized because the compiler couldn't
properly infer template arguments until recently (this also
resulted in memory corruption in ldc fork of druntime). Now that
the compiler was fixed, atomics can be fixed to
On Friday, 18 January 2019 at 18:48:46 UTC, Jonathan M Davis
wrote:
Yes, but some D features will use the GC
They would like to allocate, but they don't know nor care where
it's allocated from, if the developer uses custom memory
management, he will know how it's allocated and will be able to
On Thursday, 17 January 2019 at 02:21:21 UTC, Steven O wrote:
void main()
{
alias Rec_type = Tuple!(int, "x", int, "y", int, "z");
RedBlackTree!Rec_type[1] test;
}
alias Rec_type1 = Tuple!(int, "x", int, "y", int, "z");
alias Rec_type2 = Tuple!(int, "x", int, "y", string, "z");
Tuple!(R
On Friday, 18 January 2019 at 00:08:00 UTC, 1001Days wrote:
It works, but I have two questions regarding its efficacy: is
it viable in the long run, and is it now possible to use
delegates without the GC?
GC is just a handy memory management approach, it even works for
C and C++, (example: gc
On Friday, 18 January 2019 at 09:39:31 UTC, John Burton wrote:
It likely is a bad idea for a small struct like this but if it
was much bigger would it makes sense to write this as :-
this(const ref Config config)
Which is what you might do in C++ or does D handle this
differently?
F
On Tuesday, 15 January 2019 at 11:14:54 UTC, John Burton wrote:
auto window = Window(title = "My Window", width = 1000,
fullscreen = true);
In this particular case I would make the constructor take 3
parameters - title, width and height. Full screen is a rare
functionality and shouldn't clutt
101 - 200 of 926 matches
Mail list logo