This idea is too obvious and I suppose I'm the only one not knowing it,
but I have never seen it's implementation. Why?
The idea:
1. `Object` class has hidden `isAlive` field which is true since
construction and up to finalization.
2. Every method asserts that the object is alive first.
3. The
IMHO this should compile:
---
mixin template T() { final void f() { } }
class A { mixin T ta; }
class B : A { mixin T tb; }
---
these asserts should pass:
---
mixin template T(string s) {
string f() { return s; }
}
class A {
mixin T!"T1" ta1;
mixin T!"T2" ta2;
mixin T!"T";
}
On Tuesday, 24 April 2012 at 04:55:34 UTC, kenji hara wrote:
My concern is that the proposal is much complicated and less
useful
for general use cases.
You can emulate such formatting like follows:
IMHO addition of %!+s and %!-s alone and removing %c's magic will
only simplify formatting for
23.04.2012 21:49, Denis Shelomovskij написал:
23.04.2012 21:15, kenji hara написал:
2012年4月24日1:14 Denis Shelomovskij:
23.04.2012 18:54, kenji hara написал:
Please give us use cases. I cannot imagine why you want to
change/remove quotations but keep escaped contents.
Sorry, I should
23.04.2012 21:15, kenji hara написал:
2012年4月24日1:14 Denis Shelomovskij:
23.04.2012 18:54, kenji hara написал:
Please give us use cases. I cannot imagine why you want to
change/remove quotations but keep escaped contents.
Sorry, I should mention that !' and !" are optional
23.04.2012 18:54, kenji hara написал:
Please give us use cases. I cannot imagine why you want to
change/remove quotations but keep escaped contents.
Sorry, I should mention that !' and !" are optional and aren't commonly
used, and all !?* are very optional and are here just for completeness
(IM
I've never used new excellent range formatting syntax by Kenji Hara
until now. And I've met with difficulties, because "%(%(%c%), %)" is the
most common format for string array for me and it neither obvious nor
elegant. It occurs that "%c" disables character escaping. What the hell?
Why? Not ob
20.04.2012 8:06, H. S. Teoh написал:
I'm writing some code that does some very simplistic parsing, and I'm
just totally geeking out on how awesome D is for writing such code:
import std.conv;
import std.regex;
import std.stdio;
struct Data {
strin
D already has a history with heroes and great projects... Unfortunately,
lots of dead great projects. IMHO, a monument to them should be set up.
Reasons:
1. If a project failed because of some design issues (e.g. Descent) new
developers should be informed about a danger of this approach and wa
12.04.2012 6:21, Reid Levenick написал:
Firstly, I had no idea where suggestions should go, and I saw a few
others here and thus here I am.
I was writing some code that depended heavily on my own eponymous
templates, and decided to change the names of some of them to make them
more self-document
09.04.2012 17:26, Andrei Alexandrescu пишет:
On 4/9/12 2:06 AM, Denis Shelomovskij wrote:
Why will recording the average produce so much noise?
As I explained, the average takes noise and outliers (some very large,
e.g. milliseconds in a benchmark that takes microseconds) into account.
The
08.04.2012 21:31, Andrei Alexandrescu пишет:
On 4/8/12 11:59 AM, Denis Shelomovskij wrote:
Very good but minimum isn't a best guess. Personally I (and there will
be a lot of such maniacs I suppose) will think that this (minimum) time
can be significantly smaller than average time.
Very good but minimum isn't a best guess. Personally I (and there will
be a lot of such maniacs I suppose) will think that this (minimum) time
can be significantly smaller than average time.
So a parameter (probably with a default value) should be added.
Something like enum of flags telling wh
06.04.2012 12:49, Gour пишет:
On Fri, 06 Apr 2012 12:34:09 +0400
Denis Shelomovskij wrote:
Because I believes HTML should die with all present web browsers and
JS. And XML because of its frighten overuse. And all slow and buggy
web apps.
And adobe Flash of course should also die
06.04.2012 1:04, Nick Sabalausky пишет:
"Denis Shelomovskij" wrote in message
news:jlkubn$k4f$1...@digitalmars.com...
I think it will be great to have a single place for all D related projects
so a developer can easily find what is already done
(for an example of "I didn&
I think it will be great to have a single place for all D related
projects so a developer can easily find what is already done
(for an example of "I didn't now about you project" see, e.g. "Modern
COM Programming in D" thread), what is *planned* and what great projects
have already failed (and,
05.03.2012 22:06, bioinfornatics пишет:
opDispaytch is not really easy to use for this. my first code do this in
1 line and it is easy to understand hat it do. In 1 line i forward 3
method to a member. This save time, code and bug.
So what's the problem with opDispatch?
By the way, don't do
02.03.2012 19:29, Alex Rønne Petersen пишет:
On 02-03-2012 16:25, Robert Jacques wrote:
On Fri, 02 Mar 2012 08:13:00 -0600, Denis Shelomovskij
wrote:
Even `memcpy` is claimed dangerous at http://dlang.org/garbage.html
(because of possibility of moving GC, I suppose) but it just creates
false
Do you remember this: http://d.puremagic.com/issues/show_bug.cgi?id=7033
It should be solved and I'm volunteer to do it. But I need to know:
1. `_setmode` is only defined in version(DIGITAL_MARS_STDIO) which is
defined in version(DigitalMars)version(Windows) but used in
version(Windows) in raw
Even `memcpy` is claimed dangerous at http://dlang.org/garbage.html
(because of possibility of moving GC, I suppose) but it just creates
false positives for GC. `memmove` can even temporary destroy pointers in
some overlapping cases like Google answer on "Lucky" `memmove source
code` request do
18.02.2012 0:33, Joshua Niehus пишет:
Not as fancy as the other submits, but it might be worthy of the front
page:
import std.stdio, std.traits;
void main(string[] args) {
auto foo(T)(T n) {
return delegate(T i) {
static if (isSomeString!(T))
auto m = mix
30.01.2012 8:59, Kagamin пишет:
static assert(__traits(compiles, HANDLE.init is null));
hmm... What declaration of HANDLE do you use?
Wrapper knows nothing about non-standard types, but in `CreateFileW` the
last argument is `__(in?) HANDLE hTemplateFile`, so it is an optional
parameter (can
30.01.2012 4:42, Timon Gehr пишет:
I suppose the unary + before the second 'num' is required to
disambiguate from which array length 'num' will be deduced? Shouldn't
this restriction be lifted? (Obviously, if the lengths have to match,
both are fine.)
Yes, this restriction isn't necessary. I ju
30.01.2012 0:49, Walter Bright пишет:
On 1/29/2012 6:04 AM, Denis Shelomovskij wrote:
Why does Phobos use 4-space indentation?
Because it works, changing it would be a vast waste of time for a
non-existent benefit, and it would become a nuisance to do diffs of
source code that cross the re
30.01.2012 0:53, Walter Bright пишет:
On 1/29/2012 10:53 AM, Denis Shelomovskij wrote:
No, it isn't. Spaces aren't comfortable to use in existed editors.
Right, and I use tabs in my editor.
I also run all files through the tools:
detab
to convert my tabs to spaces
...
Works li
30.01.2012 0:42, Walter Bright пишет:
On 1/29/2012 6:17 AM, bearophile wrote:
D2 style guide should *require* D2 to be edited using a mono-spaced
font, and
the D2 front-end should enforce this with a "-ms" compiler switch.
What? How could the compiler possibly know what font was used in your
e
29.01.2012 23:02, Iain Buclaw пишет:
On 29 January 2012 18:11, Denis Shelomovskij
wrote:
29.01.2012 18:09, Iain Buclaw пишет:
On 29 January 2012 14:04, Denis Shelomovskij
wrote:
29.01.2012 15:21, Alex Rønne Petersen пишет:
On 29-01-2012 10:15, Gour wrote:
Hello!
It was
D has complete (IMHO) compiler support for calling C functions (using
extern(C)). But there is a lack of library support.
Readers from this NG probably know this, but... Microsoft .NET Framework
has such support. Look briefly at source example in:
http://msdn.microsoft.com/en-gb/library/s97sht
29.01.2012 21:29, Russel Winder пишет:
On Sun, 2012-01-29 at 14:09 +, Iain Buclaw wrote:
[...]
The problem is lines with mixed tabs and spaces, and different users
set their text editors see tabs differently. ie: is your tab-width set
to 2, 3, 4, or 8?
Isn't that the whole point: using sp
29.01.2012 22:07, Stewart Gordon пишет:
It is. But mishmashing tab and space indentation causes far worse conflict.
Iain - I take it you meant that mishmashing, combined with users having
different tab size settings, causes a problem. Correct?
Stewart.
Looks the reason against tabs is: mixed
29.01.2012 18:09, Iain Buclaw пишет:
On 29 January 2012 14:04, Denis Shelomovskij
wrote:
29.01.2012 15:21, Alex Rønne Petersen пишет:
On 29-01-2012 10:15, Gour wrote:
Hello!
It was mentioned in #D that gdc will probably adapt its code to GNU code
style and I wonder, seeing no
29.01.2012 20:48, bearophile пишет:
Stewart Gordon:
What do you mean by the "D2 front-end"?
It was one of my first attempts at humor :-)
Bye and sorry,
bearophile
Thanks for explicitly defining that! You just saved a lot of my time. )
29.01.2012 15:21, Alex Rønne Petersen пишет:
On 29-01-2012 10:15, Gour wrote:
Hello!
It was mentioned in #D that gdc will probably adapt its code to GNU code
style and I wonder, seeing no recemmendation in
http://www.d-programming-language.org/dstyle.html in regard to
indent-style, can someone
It was originally posted to D.learn but there was no reply. So:
Is there a strict aliasing rule in D?
I just saw https://bitbucket.org/goshawk/gdc/changeset/b44331053062
22.01.2012 18:51, Alex Rønne Petersen пишет:
Hi,
Someone on IRC wanted to know the element type of an array type and the
following code was suggsted:
template ElementType(T : T[])
{
alias T ElementType;
}
He was confused about how ElementType!(int[]) could possibly equal int,
until we explaine
22.01.2012 22:33, Andrej Mitrovic пишет:
A while ago there was a suggestion by Andrei to incorporate this sort of syntax:
template ElementType(T : T[])
{
alias ElementType = T;
}
struct Foo(T)
{
alias Type = T;
}
I think people agreed it was a nice syntax, but I don't know if anyone
t
23.01.2012 17:15, Gour пишет:
On Sun, 22 Jan 2012 22:03:08 +0400
Denis Shelomovskij wrote:
I'm finishing a fast (I just don't see a faster way) and garbage-free
CTFE-capable wrapper. But it requires IDL to be written for every C
function.
I'm curious if you have read the
24.01.2012 19:28, David Nadlinger пишет:
On 1/24/12 4:16 PM, Denis Shelomovskij wrote:
If people have a problem with #d IRC they should just disable technical
messages they don't need. If they can't do that, it's their own problem.
They are supposed to be programmers.
Have no
22.01.2012 23:55, Denis Shelomovskij пишет:
In this thread I would like a reason of trying to support Win95/98/Me to
be discussed.
"Get rid of win9x support" pull requests:
https://github.com/D-Programming-Language/druntime/pull/140
https://github.com/D-Programming-Language/phobo
24.01.2012 5:57, Brad Anderson пишет:
Recently there has been explosion in bug closures. This has had the
unfortunate side effect of making it difficult to have a conversation in
#d IRC with the bot constantly announcing these changes. I humbly
request that those responsible slow down this beha
24.01.2012 5:50, kenji hara пишет:
Precise documentation is not yet written.
Filled an issue:
http://d.puremagic.com/issues/show_bug.cgi?id=7361
24.01.2012 2:32, Nick Sabalausky пишет:
"Andrei Alexandrescu" wrote in message
news:jfk1r6$2a5j$1...@digitalmars.com...
On 1/23/12 3:14 AM, Nick Sabalausky wrote:
"Walter Bright" wrote in message
news:jfj0ao$3q9$1...@digitalmars.com...
Another way of looking at it is Phobos should provide
22.01.2012 23:55, Denis Shelomovskij пишет:
In this thread I would like a reason of trying to support Win95/98/Me to
be discussed.
In the case Win95/98/Me will be marked as unsupported, I will volunteer
to remove unnecessary code from druntime/Phobos.
22.01.2012 22:11, Timon Gehr пишет:
On 01/22/2012 07:07 PM, Denis Shelomovskij wrote:
22.01.2012 18:51, Alex Rønne Petersen пишет:
Hi,
Someone on IRC wanted to know the element type of an array type and the
following code was suggsted:
template ElementType(T : T[])
{
alias T ElementType
In this thread I would like a reason of trying to support Win95/98/Me to
be discussed. I would like to see arguments for and against and, when
there will be enough arguments, to vote, make a decision, and add
supported Windows OS-es list to the docs, because now D is stamping
itself by having u
22.01.2012 18:51, Alex Rønne Petersen пишет:
Hi,
Someone on IRC wanted to know the element type of an array type and the
following code was suggsted:
template ElementType(T : T[])
{
alias T ElementType;
}
He was confused about how ElementType!(int[]) could possibly equal int,
until we explaine
21.01.2012 19:24, Gour пишет:
Hello!
We have a need to bind smaller to medium-size C library and would like
to provide more D-ish or higher-level bindings than just wrapper over C
code.
E.g. the C function looks like:
int swe_calc_ut ( double tjd_ut, int ipl, int iflag, double* xx, char* serr)
20.01.2012 19:40, Robert Clipsham пишет:
Just came across this amusing 4 minute video:
https://www.destroyallsoftware.com/talks/wat
Good talk!
But with a mistake: there are 15 delimiters in 16 element array
(printing/join result), not 16.
13.01.2012 19:56, Don Clugston пишет:
On 13/01/12 14:47, Manu wrote:
On 13 January 2012 14:48, bearophile mailto:bearophileh...@lycos.com>> wrote:
This is the third time I see people trip on power operator precedence:
http://d.puremagic.com/issues/show_bug.cgi?id=7268
Some people expect this:
09.01.2012 17:22, Trass3r пишет:
I don't think you are looking for such solution, so it is here just
for information. But if someone need this, I will release sources.
Please do so, could be helpful.
IIRC it was the last working version before I decided to create a bigger
library (the one th
09.01.2012 17:22, Trass3r пишет:
I have written a Windows OpenGL context creation for given HWND
(initially for DGUI but it isn't a restriction, one just have to write
his own control class) because of complicated context creation in this
OS (~800 lines of D code for only context creation with de
09.01.2012 6:05, Trass3r пишет:
(other than SDL)
Basically something like the SFML Window module, but written in D and
working on Windoze/Linux.
I have written a Windows OpenGL context creation for given HWND
(initially for DGUI but it isn't a restriction, one just have to write
his own cont
07.01.2012 5:12, Andrej Mitrovic пишет:
Oooh I've just realized something, the *compilation* calls are what's
destroying the performance. I was using "dmd test.d&& test.exe"
instead of just "test.exe" and this would generate a new exe which
screwed up the results.
So regex has nothing to do wit
01.01.2012 8:34, Andrei Alexandrescu пишет:
to the entire D community!
Andrei
Happy new year from Russia!
It's OT. This post should be in D.announce NG titled:
"A year have rev. 2012 now. Everybody is switched to this revision
automatically."
With the following text:
"Somebody is telling it
So, I'm a function `f`, I have an `immutable(type)[]` argument and I
want to store it for my friend `g` in an TLS variable `v`:
---
string v;
debug string sure;
void f(string s) { v = s; debug sure = s.idup; }
void g() { assert(v == sure); }
---
I also store a copy of `s` into `sure` for my frie
21.12.2011 0:22, Walter Bright пишет:
First off, dmd most definitely puts 0 initialized static data into the
BSS segment. So what's going on here?
1. char data is not initialized to 0, it is initialized to 0xFF.
Non-zero data cannot be put in BSS.
Sorry, it was because of copying C code in my po
16.12.2011 21:29, Andrei Alexandrescu пишет:
Hello,
Late last night Walter and I figured a few interesting tidbits of
information. Allow me to give some context, discuss them, and sketch a
few approaches for improving things.
A while ago Walter wanted to enable function-level linking, i.e. onl
23.11.2011 19:16, deadalnix пишет:
Hi,
I want to suggest a project to the community. Doom3 source code has just
been released, and I think we may want to do a port in D.
...
I'm definitively in. And you ?
It's insane at first sight. But after thinking for a moment I realized
that is isn't d
22.11.2011 15:13, mta`chrono пишет:
A noob question from my side: What is DWARF?
By the way I never touched the sources of gdb. I'm just a friendly user
of it.
http://lmgtfy.com/?q=gdb+DWARF&l=1
Your example, a bit improved:
---
// In std.concept, e.g.
template verify(alias concept, T) {
//static assert(isConcept!concept, concept.stringof ~ " is not a
concept"); //the test for particular concept's concepts can be added
mixin concept!T;
}
template verify(alias concept) {
mix
void myfunction(A)(A arr)
if(__traits(compiles, verifyMyConcept!(A)))
{
}
It should be
---
void myfunction(A)(A arr)
{
verifyMyConcept!A;
}
---
to see the error messages.
03.11.2011 11:29, kenji hara пишет:
EnumMember returns tuple, it is compile-time sequence.
And foreach with tuple unrolls its body. Then, Loop A is unrolled like follows.
__foreachEntry0: {
if ( TestEnum.ONE == TestEnum.TWO )
goto __foreachEntry1;
writeln( "A: ", TestEnum.ONE );
}
__
02.11.2011 8:23, Caligo пишет:
I just found out that Bitbucket finally offers Git support. I wonder,
would anyone else like to see GDC switch to Git? I would like to kindly
make a request because it would make things little easier.
What things? I see, that every one switches to Git, but what
What does D already have: build-in rectangular static arrays, dynamic
arrays of arrays, std.range.frontTransversal, std.range.transversal.
Some time ago I was told that "FORTRAN is good for its arrays" and heard
me saying "it is easy to implement in C++ or D, but in D it will have
more conveni
Suddenly, I had a talk with an Fortran guy at previous weekend and have
wrote something like Fortran arrays in D last week. I had an idea of
adding it into Phobos, but just had no time for review of my code. Draft
version is in attachment.
rarray.d - something like Fortran array
main.d - example
09.10.2011 21:29, bearophile пишет:
Kenji Hara has just copied in GIT a large patch by Don:
https://github.com/9rnsr/dmd/branches/opDollar
It allows user defined collections usable with this syntax:
x[$-2, y[$-6, $-9], $-2]
See:
http://d.puremagic.com/issues/show_bug.cgi?id=3474
But a syntax
20.09.2011 10:22, bearophile пишет:
Josh Simmons:
You could also just...
uint32_t next_pow_2(uint32_t n)
{
n -= 1;
n |= n>> 1;
n |= n>> 2;
n |= n>> 4;
n |= n>> 8;
n |= n>> 16;
return n + 1;
}
My version with bsr is faster.
Bye,
bearophile
Is it? Eve
05.08.2011 16:26, dsimcha пишет:
My apologies for not announcing this yesterday. For some reason I
thought today was the official end of review. Anyhow, Lars Kyllingstad's
new std.path module, which has been in review for the past 3 weeks, is
up for vote. Please vote yes or no in this thread.
Co
04.08.2011 17:57, Trass3r пишет:
dmd -oftestGtkD.exe -release -IgtkD-1.4.1-release\headers main.d
gtkD-1.4.1-release\library.lib
Gives the same result.
Ok, could you try with Unilink to see if it's a linker problem?
ftp://ftp.styx.cabel.net/pub/UniLink/
http://www.digitalmars.com/d/archives/di
04.08.2011 15:33, Trass3r пишет:
doCompile.bat:
dmd -c -release -IgtkD-1.4.1-release\headers main.d
doLink.bat:
link
main,"testGtkD.exe",,"gtkD-1.4.1-release\library.lib"+user32+kernel32/noi;
Don't invoke optlink directly like that.
Just use something like 'dmd -release main.obj
gtkD-1.4.1-re
I use dmd with default configuration.
Files from huge-build.zip:
zeroCount.exe: counts zero bytes
main.d:
module main;
import gtk.Main;
void main(string[] args) {
Main.init(args);
}
doCompile.bat:
dmd -c -release -IgtkD-1.4.1-release\headers main.d
doLink.bat:
link
main,"testGtkD.exe",,"
AFAIK GtkD is the only mature crossplatform GUI for D. So the question
is: 111 MiB *.exe file mostly from zeroes is good/acceptable? Is it a
bug or it's how dmd2+OPTLINK works? It looks like dmd1 hasn't this issue.
Files (dmd 2.054 compiled) are here:
http://deoma-cmd.ru/files/other/huge-build.
03.08.2011 22:48, Adam D. Ruppe пишет:
System: Windows XP, Core 2 Duo E6850
Is this Windows XP 32 bit or 64 bit? That will probably make
a difference on the longs I'd expect.
I meant Windows XP 32 bit (5.1 (Build 2600: Service Pack 3)) (according
to what is "Windows XP" in wikipedia)
03.08.2011 22:15, Ziad Hatahet:
I believe that "long" in this case is 32 bits in C++, and 64-bits in the
remaining languages, hence the same result for int and long in C++. Try
with "long long" maybe? :)
--
Ziad
2011/8/3 Denis Shelomovskij mailto:verylonglogin@gmail.c
03.08.2011 18:20, bearophile:
The benchmark info:
http://chadaustin.me/2011/01/digging-into-javascript-performance/
The code, in C++, JS, Java, C#:
https://github.com/chadaustin/Web-Benchmarks/
The C++/JS/Java code runs on a single core.
D2 version translated from the C# version (the C++ versio
201 - 275 of 275 matches
Mail list logo