On Saturday, 14 March 2015 at 09:59:05 UTC, dnewer wrote:
yes,java is good lang,but i dont think it's better than c#,if
no oracle or google support java will less and less.
C# is a good and easy lang.
i like C# .
Not sure what do you mean. D has classes, interfaces and foreach,
that should be
On Sunday, 15 March 2015 at 14:58:54 UTC, Idan Arye wrote:
Here is a very crude, very basic example:
http://dpaste.dzfl.pl/94d851d7ca63.
U++ approach will probably give more succinct result. Not sure
how it fares against D philosophy: does it replace range
primitives with whole new thing?
On Friday, 13 March 2015 at 21:12:52 UTC, Robert M. Münch wrote:
Hi, I want to use the Windows OutputDebugString() which is not
defined anywhere.
The declaration can be already part of WindowsAPI project:
https://github.com/AndrejMitrovic/WindowsAPI just see it there.
How do I declare such m
On Wednesday, 11 March 2015 at 13:30:27 UTC, Sativa wrote:
On Wednesday, 11 March 2015 at 08:45:15 UTC, Kagamin wrote:
http://wiki.dlang.org/Libraries_and_Frameworks#GUI_Libraries
Can you point out where it says anything about wpf or .NET? I'm
having trouble finding it. I even searched for .n
You can also try to expose COM-accessible .net interface and use
it through COM in D.
Only native libraries are more or less accessible from D, not
.net. For .net you can use pinvoke (if you can build D dll) or
IPC.
A hash table? See http://dlang.org/hash-map.html
http://wiki.dlang.org/Libraries_and_Frameworks#GUI_Libraries
On Sunday, 8 March 2015 at 21:41:44 UTC, FG wrote:
Except that with this solution you will confuse empty strings
with ints.
The idea was to only make it memory-safe without union.
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
On Sunday, 8 March 2015 at 03:09:00 UTC, zhmt wrote:
Yes, this a good idea, if the author of vibe.d do this, will be
better, it is used frequently in many scenes.
You can do it too, unlike in C++, in D you can write extension
methods to any type, as long as they are visible, you can call
them
On Saturday, 7 March 2015 at 02:23:10 UTC, zhmt wrote:
Hi,I got the right answer in vibe.d forum,here is the link:
http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/24403/#post-24416
If that's correct, you can write an extension method for
InputStream in terms of asio:
I'd say, peek is the right method, it returns what's already in
the buffer (but doesn't read), while leastSize returns full
logical size of the stream.
On Friday, 6 March 2015 at 16:39:56 UTC, Ali Çehreli wrote:
mixin (makePairInitValueDefinitions());
Oh, so that's how you do static foreach.
On Friday, 6 March 2015 at 00:53:49 UTC, Ali Çehreli wrote:
It made me happy that I was not the only person who has been
ruminating over "alphabet" as the crucial piece in this whole
Unicode story. I've been giving the example of if I have a
company name as the string "ali & jim", the uppercase
On Thursday, 5 March 2015 at 13:57:45 UTC, FG wrote:
void main()
{
string s = "ąćęłńóśźż";
Try with string s = "ąc\u0301ęłńóśźż";
string s;
char[] b = cast(char[])asArray();
b[0..s.length] = s[];
https://issues.dlang.org/show_bug.cgi?id=2742
Unsafe!(int*)* _c;
class A
{
Unsafe!(int*) _counter;
void escape() @safe { _c = &_counter; }
}
Not sure if it's legal. It should be really untouchable.
Being a safety measure, it becomes trusted code's responsibility
to provide this safety. BTW it also needs @system postblit; meh,
I hope it's enough to make untouchable.
If one wants to prevent a leak, then counter can be wrapped
---
struct Unsafe(T)
{
private T _payload;
T payload() @system { return _payload; }
alias payload this;
}
---
And somehow disallow Unsafe template in safe function signatures,
then having
Unsafe!(int*) _counter;
would be ok?
Hmm... that means in OOP class is a unit of safety instead of a
method, but it also applies to free methods, which access static
members.
On Monday, 2 March 2015 at 07:20:49 UTC, Vitalie Colosov wrote:
Now it all makes sense. Thank you.
Maybe it would make also some sense if I would have gotten some
kind of exception trying to access the variable which was not
populated by the running thread, instead of successfully
getting empt
I mean, if it used GC after fork, like in bug 6846, that would be
untidy (it's complicated because GC is always a temptation).
https://github.com/rejectedsoftware/vibelog
https://github.com/rejectedsoftware/vibed.org - site itself
https://github.com/rikkimax/Cmsed - CMS in D
On Friday, 27 February 2015 at 10:49:25 UTC, Ola Fosheim Grøstad
wrote:
On Friday, 27 February 2015 at 09:33:43 UTC, Kagamin wrote:
If you can't give an example of unsafety easily, that's
already quite important. Compare to C, where one can provide
such an example easily.
Yes, that is true. A
On Friday, 27 February 2015 at 14:52:56 UTC, Steven Schveighoffer
wrote:
The counter is freed in the destructor, nothing can happen
after that.
So the code is now etched in stone and cannot be changed? Is
there an attribute for that? :P
Changes introduces in the destructor shouldn't affect o
On Saturday, 28 February 2015 at 05:32:51 UTC, ketmar wrote:
On Sat, 28 Feb 2015 06:09:16 +0100, Martin Nowak wrote:
Meanwhile the author of daemonized came up with another idea,
using exec
instead of fork. https://github.com/NCrashed/daemonize/issues/2
ahem. http://forum.dlang.org/post/mc35
If you can't give an example of unsafety easily, that's already
quite important. Compare to C, where one can provide such an
example easily. If you want to write a mathematical prover, that
won't hurt, though such tools don't need language support, lints
and provers were written even for C.
On Thursday, 26 February 2015 at 20:56:52 UTC, Ola Fosheim
Grøstad wrote:
Well, but @safe code is not verified either... It is inferred
@safe based on a fixed set of criterions, but not verified. To
verify you need more, and you have to start with strong typing.
@safe is supposed to provide sa
On Thursday, 26 February 2015 at 16:25:59 UTC, Steven
Schveighoffer wrote:
However, we have an issue here. At any point inside the code,
you could do:
oldcount = count;
And now, there is still potentially a dangling pointer
somewhere. This means every place count is used must be
checked. In
It improves things without tools. Tools are always welcome, e.g.
dfix already does something.
Huh? If you wanted to print an array, then
---
void main()
{
int n=1;
while(n<=10_001)
{
v~=n;
n+=5000;
}
foreach(c;v)
{
writeln( " current n is ",c );
}
}
---
Implementations can have bugs, probably COFF support wasn't
stress tested.
https://issues.dlang.org/show_bug.cgi?id=13172
On Friday, 20 February 2015 at 14:33:31 UTC, Ola Fosheim Grøstad
wrote:
Yeah, either use plain C or avoid 3rd party libraries... I
guess that includes phobos ;)
AFAIK, in early days of unix there were no threads, processes
were single-threaded, fork was the way to concurrency and exec
was the
I think, it's better to diagnose, what problem the program
encounters, than to explain, what happens in kernel and glibc.
The first step is to see, where it hangs and get a stacktrace.
Yeah, the docs navigation sucks
http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/tkdapplication.html
On Tuesday, 17 February 2015 at 09:08:17 UTC, Vlad Levenfeld
wrote:
For my use case I'm less concerned with absolute resolution
than with preserving the information in the smaller operand
when dealing with large magnitude differences.
What do you mean? As long as you don't change the operand,
Periodic fractions.
http://digitalmars.com/d/1.0/dbc.html
in is precondition, body is function body, which expects
precondition to pass.
It checks that you don't set both text and image, because the
button doesn't support it.
Yeah, since @trusted is checked manually, it's sort of a problem,
if you don't know, how to check it.
On Friday, 13 February 2015 at 09:11:26 UTC, Foo wrote:
And I wouldn't say indiscriminately. Every function I marked
with @trusted was checked by me so far.
What did you check them for? :)
Just first example: make and destruct, being marked as @trusted,
don't prevent caller from UAF and double
Whether s.front uses GC is determined by s.front implementation,
caller can't affect it.
On Thursday, 12 February 2015 at 17:29:34 UTC, Foo wrote:
And since today it is @safe wherever possible.
Well, you marked functions @trusted rather indiscriminately :)
Such approach doesn't really improve safety, and the code could
work as well being @system. It's not like @system is inherentl
On Thursday, 12 February 2015 at 11:10:35 UTC, ponce wrote:
On Thursday, 12 February 2015 at 09:50:39 UTC, ketmar wrote:
On Thu, 12 Feb 2015 09:04:27 +, ponce wrote:
http://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors
I've also made one for "D can't do real-time because it
On Thursday, 12 February 2015 at 12:52:03 UTC, Andrey Derzhavin
wrote:
If we can't relay on GC wholly, there is no need for GC.
All of the objects, that I can create, I can destroy manually
by myself, without any doubtful GC destroying attempts.
Manual memory management should be possible in D
On Thursday, 12 February 2015 at 08:55:43 UTC, Jonathan M Davis
wrote:
On Thursday, February 12, 2015 08:33:34 Kagamin via
Digitalmars-d-learn wrote:
Truth be told, D has no guideline for deterministic destruction
of managed resources.
Really what it comes down to is that if you want
Truth be told, D has no guideline for deterministic destruction
of managed resources.
http://www.dsource.org/projects/ddl
On Wednesday, 11 February 2015 at 08:49:40 UTC, Andre Artus wrote:
First to mind is that in Java .class files are executable (in
Java runtime), while object files are not.
There was a library, which could load object files with D code,
resolve symbols and execute it.
https://issues.dlang.org/show_bug.cgi?id=2742
On Wednesday, 11 February 2015 at 05:08:16 UTC, Venkat Akkineni
wrote:
I am coming from Java. What is the purpose of an object file &
why is it generated at compile time in addition to an
executable. I know C generates an object file too, but I don't
know what the use is.
Java uses a similar
https://github.com/Hackerpilot/libdparse/blob/master/src/std/d/lexer.d#L1491
You can use C functions in D too:
import core.stdc.stdio;
ubyte[] temp = [ 65, 30, 66, 30, 67, 0];
puts(cast(char*)temp.ptr);
Looks like RS is an unprintable character, that's why you don't
see it in console.
Try variadic templates with recursion.
For example see http://dpaste.dzfl.pl/f49a97e35974
http://sourceforge.net/p/mingw/mingw-org-wsl/ci/master/tree/lib/lib32/wininet.def
?
writeln("Sorted, reversed: ", retro(sort(myVals)));
?
On Friday, 30 January 2015 at 06:16:21 UTC, Joel wrote:
What happens is, that I run the script file (in DAllegro
folder) and it is suppose to create lib files from the DLL
ones. On my system, it says its done it but no lib files pop up!
You can try procmon to watch, what happens with files.
On Wednesday, 28 January 2015 at 11:50:46 UTC, Danny wrote:
For Windows, if I use GetStdHandle, is the resulting HANDLE
valid for threads other than the one that called GetStdHandle ?
Because the HANDLE is a pointer but doesn't have "shared". Does
one know for Windows handles in general which a
Some reading:
http://ddili.org/ders/d.en/concurrency.html
http://ddili.org/ders/d.en/concurrency_shared.html
http://www.informit.com/articles/article.aspx?p=1609144
Associative array doesn't support thread-safe operations, that's
why they don't work on shared instance. You should use
std.concurrency or implement low-level concurrency mechanism.
On Thursday, 22 January 2015 at 09:26:21 UTC, tcak wrote:
There are convenient constants defined in std.ascii.
import std.ascii;
string arr = lowercase ~ uppercase ~ digits;
// also 'std.ascii.letters' gives ('A' .. 'Z' ~ 'a' .. 'z')
Well, that's just disguising what we can't do.
D has alot
You can ask to add a keyword to bugzilla for C++ issues, this can
help to improve their visibility and searchability.
Probably borrowed from java:
http://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.12.4
http://forum.dlang.org/thread/dnxgbumzenupviqym...@forum.dlang.org
:-/
On Sunday, 18 January 2015 at 11:21:52 UTC, Marc Schütz wrote:
It's not different, and if you're still doing the O_EXCL open
afterwards, it's safe. I just assumed you were going to use the
generated filename without a further check. This is then
unsafe, no matter how the UUID is generated, and
Works for me on allegro-5.0.10-mt.dll, produced 391kb lib file.
On Thursday, 18 December 2014 at 20:41:39 UTC, Laeeth Isharc
wrote:
(There may be more efficient purer ways of doing this, but I
don't wish to spend time learning Excel internals/object
models, and I know my route will work reasonably well).
ActiveX is not internal to Excel. Being a generic co
What is missing?
On Wednesday, 26 November 2014 at 04:10:08 UTC, Vlad Levenfeld
wrote:
So I used the dmd visual studio project to build dmd
It can be outdated, because dmd release is built by dmc, not vc.
On Monday, 17 November 2014 at 16:38:45 UTC, Rene Zwanenburg
wrote:
Clock.currTime uses a high performance timer,
QueryPerformanceCounter on Windows for example, so you
shouldn't have to worry about timer accuracy.
You probably mistake it for StopWatch, clock is not timer.
You can control it by creating a global flag and checking it
before freeing.
http://dlang.org/phobos/core_cpuid.html#.isX86_64 - this should
probably detect x86-64.
Well, the easiest thing is to see assembler generated at both
sides and check if they are compatible. If they are not, try to
interface via C ABI. You can also inspect value of X before
calling EXP.
On Wednesday, 12 November 2014 at 14:42:38 UTC, eles wrote:
Which is why this approach is so cumbersome. At least, in
non-GC you only have just one kind of destructor.
It's not necessarily very cumbersome. Standard library usually
provides necessary integration:
http://blogs.msdn.com/b/bcltea
It can work with only managed destructor - that's how it's
usually done. Finalizer only guards against slow resource leak
when you forget to free them.
With GC you usually have two destructors: one for managed
resources and one for unmanaged resources. Destructor for managed
resources should be run on live objects as soon as you don't need
the resource, it calls unmanaged destructor too. Unmanaged
destructor (finalizer) is called by GC during
On Saturday, 8 November 2014 at 15:51:59 UTC, Gary Willoughby
wrote:
This is really cool, (and at the risk of sounding foolish) what
is the benefit of doing this?
It turns segfault into normal exception with a stack trace, so
you see where it failed right away.
On Friday, 7 November 2014 at 03:45:23 UTC, Steven Schveighoffer
wrote:
In an environment that you don't control, the default behavior
is likely to print "Segmentation Fault" and exit. No core dump,
no nothing.
If you let the exception propagate into OS, by default Windows
creates memory dump
I was thinking about list comprehension, which is what
programming on ranges is. Isn't it?
On Monday, 10 November 2014 at 10:27:19 UTC, bearophile wrote:
In practice I prefer to avoid using hacks like setting a
NDEBUG. It's better to have differently named operators if
their behavour is different. So it's better to keep the
assert() as it is commonly used (and I'd like it to refuse a
Another synonym is "list".
https://issues.dlang.org/show_bug.cgi?id=12990 this?
D.learn is about basics of D. Interfacing with C++ is an advanced
topic, with feature set in flux, so I'd suggest to ask about it
in http://forum.dlang.org/group/digitalmars.D group.
You can see http://wiki.dlang.org/DIP61 and linked discussions.
Static and virtual functions probably work. Constructors and
destructors probably don't. What's difficult is multiple
inheritance. The information on C++ support is largely considered
private to the compiler team.
Oops, this:
http://forum.dlang.org/post/vybptydvdxultfnfq...@forum.dlang.org
http://forum.dlang.org/post/xqjosrzoswakjcdgq...@forum.dlang.org
D claims compatibility with system C compiler, which usually have
32-bit int.
On Friday, 31 October 2014 at 23:59:54 UTC, dajones wrote:
is there a better way than doing...
cast(string)(buf~"hoo")
to get it to pick the correct overload?
text(buf,"hoo")
DMD is for x86 AFAIK.
On Thursday, 30 October 2014 at 10:18:40 UTC, Suliman wrote:
No! I mean not translation to js. I mean theoretical ability of
creation new programming language that can work every where!
It's already created - C++! http://www.chromium.org/nativeclient
https://github.com/D-Programming-Language/dub/issues/229
On Friday, 24 October 2014 at 10:46:57 UTC, tcak wrote:
Second Thread (TestThread)
http://i.imgur.com/w4y5gYB.png
Hmm... where is __lll_lock_wait_private now? And how mmap can
hang at all?
Looks like your IDE filters too much. Can you configure it to
filter less and show address locations?
Do you see recursive call to malloc in the stack trace?
maybe
template Foo(T a, T: T[U], U)
If it's deterministic, looks more like
https://issues.dlang.org/show_bug.cgi?id=4890
(11981 is not deterministic)
701 - 800 of 926 matches
Mail list logo