On 9/25/11 1:37 AM, Nick Sabalausky wrote:
If anyone cares, I've put up a little thing about why it's best not to use
D's arrays as stacks. This is drawn from a direct experience a few months
ago. Figured if I fell into that trap then others might too, so this could
be helpful for some people. Th
"Nick Sabalausky" wrote in message
news:j5mi7l$1dtf$1...@digitalmars.com...
> If anyone cares, I've put up a little thing about why it's best not to use
> D's arrays as stacks. This is drawn from a direct experience a few months
> ago. Figured if I fell into that trap then others might too, so
On Sun, Sep 25, 2011 at 1:45 AM, Jonathan M Davis wrote:
> On Sunday, September 25, 2011 02:37:25 Nick Sabalausky wrote:
>> If anyone cares, I've put up a little thing about why it's best not to use
>> D's arrays as stacks. This is drawn from a direct experience a few months
>> ago. Figured if I f
On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
> On Sun, Sep 25, 2011 at 1:45 AM, Jonathan M Davis
wrote:
> > On Sunday, September 25, 2011 02:37:25 Nick Sabalausky wrote:
> >> If anyone cares, I've put up a little thing about why it's best not to
> >> use D's arrays as stacks. This i
> Thank you very much. I think the cgi module is lower effecient. I found
> fcgi(http://www.dsource.org/projects/fastcgi4d) and
> mango(http://www.dsource.org/projects/mango) which support servlet. But they
> don't
> support D2, anyone else can merge them to D2?
>
> zsxxsz
I've some D2 code work
Am 22.09.2011 22:54, schrieb Andrei Alexandrescu:
On 9/21/11 5:17 PM, Walter Bright wrote:
I've collected a few from various languages for comparison:
[snip]
I think we should do the following:
1. Introduce a new token "=>"
2. Add this rewrite to the grammar:
symbol => expression
translate
On 09/25/2011 11:43 AM, Mafi wrote:
Am 22.09.2011 22:54, schrieb Andrei Alexandrescu:
On 9/21/11 5:17 PM, Walter Bright wrote:
I've collected a few from various languages for comparison:
[snip]
I think we should do the following:
1. Introduce a new token "=>"
2. Add this rewrite to the gram
"Jonathan M Davis" wrote in message
news:mailman.160.1316939358.26225.digitalmar...@puremagic.com...
> On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
>>
>> Isn't this exactly what assumeSafeAppend is for?
Hmm, I didn't know about that. (Actually, I remember hearing it mentioned
befo
On Sunday, September 25, 2011 07:05:34 Nick Sabalausky wrote:
> "Jonathan M Davis" wrote in message
> news:mailman.160.1316939358.26225.digitalmar...@puremagic.com...
>
> > On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
> >> Isn't this exactly what assumeSafeAppend is for?
>
> Hmm, I
Walter:
> struct LogicalConst(T)
> {
> @property T v() {
> if (!set) {
>_v = some_expensive_computation();
>set = true;
> }
> return _v;
> }
>
>private:
> bool set = false;
> T _v;
> }
If this idiom becomes common (thanks to
Nick Sabalausky:
> https://www.semitwist.com/articles/article/view/don-t-use-arrays-as-stacks
Is it possible to write a function like:
ForeachType!A unsafePop(A)(A)if(isDynamicArray!A) { /*...*/ }
that contains both the popping (and something like assumeSafeAppend to mess
with the druntime dat
Nick Sabalausky wrote:
> "Jonathan M Davis" wrote in message
> news:mailman.160.1316939358.26225.digitalmar...@puremagic.com...
>> On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
>>>
>>> Isn't this exactly what assumeSafeAppend is for?
>
> Hmm, I didn't know about that. (Actually, I r
On 25/09/11 3:51 AM, Andrei Alexandrescu wrote:
On 9/24/11 9:07 PM, Peter Alexander wrote:
Heading off on a tangent here, but isn't the const this(this) problem a
language problem rather than a QoI problem?
The design exists but the implementation has not yet been finalized yet.
Walter and I h
On 25/09/11 4:49 AM, Walter Bright wrote:
On 9/24/2011 6:03 AM, Peter Alexander wrote:
I only use const/immutable for concurrency. Nothing else.
How do you avoid race conditions when setting logical const values?
You can't and don't. That's not what logical const is for. That's what
physica
On 2011-09-25 02:52:47 +, Andrei Alexandrescu
said:
On 9/24/11 9:31 PM, Michel Fortin wrote:
Perhaps I am missing the point. What would be gained by forcing
this(this) to be nothrow?
It further frees the standard library to cater for the throwing case.
Concretely, what does it simplif
On 24/09/11 6:53 PM, Timon Gehr wrote:
On 09/24/2011 07:21 PM, Peter Alexander wrote:
On 24/09/11 12:47 PM, Jonathan M Davis wrote:
On Saturday, September 24, 2011 12:19:33 Peter Alexander wrote:
Lazy loading and caching are the same thing.
No. Caching is more general. Lazy loading is explic
On 09/25/2011 01:18 PM, bearophile wrote:
Walter:
struct LogicalConst(T)
{
@property T v() {
if (!set) {
_v = some_expensive_computation();
set = true;
}
return _v;
}
private:
bool set = false;
T _v;
}
If this idi
Timon Gehr:
> I think it should be a language feature, as proposed by Jonathan.
I did miss his post. I see he has turn that idiom into a language feature :-)
>From Jonathan's post:
> 2. __varLoaded is default-initialized to false, and __var is void (so,
> garbage).
The GC has to read __varLoa
On 25/09/11 4:49 PM, Peter Alexander wrote:
See: http://d-programming-language.org/lex.html
It says:
q{ @ } // error, @ is not a valid D token
but...
http://d-programming-language.org/lex.html#Token
This clearly shows that @ is a token.
So, which is it?
btw...
import std.stdio;
void mai
See: http://d-programming-language.org/lex.html
It says:
q{ @ } // error, @ is not a valid D token
but...
http://d-programming-language.org/lex.html#Token
This clearly shows that @ is a token.
So, which is it?
On Sep 24, 2011, at 4:55 PM, Andrei Alexandrescu wrote:
>
> Making the allocator a part of the container type would go the STL way, and
> STL allocators are essentially a failed experiment. I'm only partially clear
> on why it has failed, but it does seem that part of the reason was making the
No. If this were just a scoped allocator, that would be fine, but a general
purpose allocator interface needs more discussion.
On 09/25/2011 05:49 PM, Peter Alexander wrote:
See: http://d-programming-language.org/lex.html
It says:
q{ @ } // error, @ is not a valid D token
but...
http://d-programming-language.org/lex.html#Token
This clearly shows that @ is a token.
So, which is it?
@ is a token. The documentation
I think what he wants is to have automatically generated unittests for
derived classes that check if the unittests of the parent still pass for
them. I don't know of a nice way to do that without requiring some
minimal effort by the implementor of the derived class. Contracts
quickly detect and r
In std.algorithm there is a section of set functions that work on ordered
iterables, like nWayUnion:
http://www.d-programming-language.org/phobos/std_algorithm.html#nWayUnion
This is an example of nWayUnion usage:
import std.algorithm;
void main() {
auto data = [[1, 2, 3], [1, 3, 5]];
a
Le 24/09/2011 01:14, Jonathan M Davis a écrit :
On Friday, September 23, 2011 16:02 Martin Nowak wrote:
I already added a comment on github (sorrowly allows comments only on
diffs).
Bugs should be fixed whenever they are know and should only be a concern
for
voting if there is a gross number of
Le 25/09/2011 04:52, Andrei Alexandrescu a écrit :
On 9/24/11 9:31 PM, Michel Fortin wrote:
Perhaps I am missing the point. What would be gained by forcing
this(this) to be nothrow?
It further frees the standard library to cater for the throwing case.
Andrei
If I understand, what is explain
On 25/09/11 7:37 PM, deadalnix wrote:
Le 25/09/2011 04:52, Andrei Alexandrescu a écrit :
On 9/24/11 9:31 PM, Michel Fortin wrote:
Perhaps I am missing the point. What would be gained by forcing
this(this) to be nothrow?
It further frees the standard library to cater for the throwing case.
An
On 22/09/2011 21:12, Trass3r wrote:
or ldc, I thought that could also compile d2
LLVM still doesn't support SEH, though it's being worked on.
The latest development code does for Win64.
--
Robert
http://octarineparrot.com/
Le 25/09/2011 21:02, Peter Alexander a écrit :
On 25/09/11 7:37 PM, deadalnix wrote:
Le 25/09/2011 04:52, Andrei Alexandrescu a écrit :
On 9/24/11 9:31 PM, Michel Fortin wrote:
Perhaps I am missing the point. What would be gained by forcing
this(this) to be nothrow?
It further frees the stan
On Sun, Sep 25, 2011 at 20:02, deadalnix wrote:
>> I think what he wants is to have automatically generated unittests for
>> derived classes that check if the unittests of the parent still pass for
>> them. I don't know of a nice way to do that without requiring some
>> minimal effort by the imple
On 25/09/11 12:55 AM, Andrei Alexandrescu wrote:
On 9/24/11 9:33 AM, dsimcha wrote:
On 9/24/2011 2:10 AM, Andrei Alexandrescu wrote:
On 9/23/11 22:30 CDT, dsimcha wrote:
On 9/23/2011 11:25 PM, Robert Jacques wrote:
On Fri, 23 Sep 2011 15:53:46 -0400, Jonathan M Davis
wrote:
No. I cannot bui
On 25/09/11 1:20 AM, dsimcha wrote:
On 9/24/2011 7:55 PM, Andrei Alexandrescu wrote:
Defining and using an allocator interface would have a small speed
impact (i.e. allocation would entail an indirect call) but I think that
would be acceptable.
Agreed. My much bigger concern w.r.t. dynamic int
On Sunday, September 25, 2011 11:12:10 bearophile wrote:
> Timon Gehr:
> > I think it should be a language feature, as proposed by Jonathan.
>
> I did miss his post. I see he has turn that idiom into a language feature
> :-)
> From Jonathan's post:
> > 2. __varLoaded is default-initialized to fals
On 9/25/2011 4:40 PM, Peter Alexander wrote:
On 25/09/11 1:20 AM, dsimcha wrote:
On 9/24/2011 7:55 PM, Andrei Alexandrescu wrote:
Defining and using an allocator interface would have a small speed
impact (i.e. allocation would entail an indirect call) but I think that
would be acceptable.
Agr
On 25/09/11 10:57 PM, dsimcha wrote:
On 9/25/2011 4:40 PM, Peter Alexander wrote:
On 25/09/11 1:20 AM, dsimcha wrote:
On 9/24/2011 7:55 PM, Andrei Alexandrescu wrote:
Defining and using an allocator interface would have a small speed
impact (i.e. allocation would entail an indirect call) but I
On Sat, 24 Sep 2011 13:19:33 +0200, Peter Alexander
wrote:
Lazy loading and caching are the same thing.
struct Foo
{
T m_lazyObj = null;
bool m_isLoaded = false;
T getObj()
{
if (!m_isLoaded)
{
m_lazyObj = func();
m_isLoaded =
On Mon, 26 Sep 2011 02:02:06 +0200, Simen Kjaeraas
wrote:
On Sat, 24 Sep 2011 13:19:33 +0200, Peter Alexander
wrote:
Lazy loading and caching are the same thing.
struct Foo
{
T m_lazyObj = null;
bool m_isLoaded = false;
T getObj()
{
if (!m_isLoaded)
On Monday, September 26, 2011 02:02:06 Simen Kjaeraas wrote:
> On Sat, 24 Sep 2011 13:19:33 +0200, Peter Alexander
>
> wrote:
> > Lazy loading and caching are the same thing.
> >
> > struct Foo
> > {
> >
> > T m_lazyObj = null;
> > bool m_isLoaded = false;
> >
> > T getObj(
On Monday, September 26, 2011 02:03:23 Simen Kjaeraas wrote:
> On Mon, 26 Sep 2011 02:02:06 +0200, Simen Kjaeraas
>
> wrote:
> > On Sat, 24 Sep 2011 13:19:33 +0200, Peter Alexander
> >
> > wrote:
> >> Lazy loading and caching are the same thing.
> >>
> >> struct Foo
> >> {
> >>
> >> T m_
On 9/23/2011 9:11 PM, Jonathan M Davis wrote:
Okay. I'm not saying that we should necessarily implement this. I'm just
looking to air out an idea here and see if there are any technical reasons why
it can't be done or is unreasonable.
Andrei and I talked about this some time back. Where it ran
On Sunday, September 25, 2011 17:46:00 Walter Bright wrote:
> On 9/23/2011 9:11 PM, Jonathan M Davis wrote:
> > Okay. I'm not saying that we should necessarily implement this. I'm just
> > looking to air out an idea here and see if there are any technical
> > reasons why it can't be done or is unre
I've had a good time with std.benchmark today and made it ready for
submission to Phobos. As a perk I've added the %h format specifier,
which formats a number in human-readable form using SI prefixes.
For those interested in discussing this prior to the formal review
process, the code is at:
On 9/25/2011 6:03 PM, Jonathan M Davis wrote:
I don't know that what it adds merits the extra complexity that it requires.
I think that's the real issue. D has a lot of stuff in it, we ought to be very
demanding of significant new features.
Andrei Alexandrescu:
> http://erdani.com/d/web/phobos-prerelease/std_benchmark.html
Is the micron symbol visible on Windows too?
Bye,
bearophile
On Sun, 25 Sep 2011 18:10:53 +0200, Timon Gehr wrote:
> @ is a token. The documentation was probably written when it was not.
Yep, so Peter's stumbled on a bug. Bugzilla that shit, Peter! :D
On Sun, 25 Sep 2011 21:08:45 -0400, Andrei Alexandrescu
wrote:
I've had a good time with std.benchmark today and made it ready for
submission to Phobos. As a perk I've added the %h format specifier,
which formats a number in human-readable form using SI prefixes.
For those interested in discus
bearophile wrote:
> Is the micron symbol visible on Windows too?
Yes, of course.
It's a matter of fonts though - if you don't have the character
in your font (regardless of operating system) it might not show.
The micro sign is very common though, so unlikely to have
any font without it.
Well am I?
On 9/25/11 8:41 PM, bearophile wrote:
Andrei Alexandrescu:
http://erdani.com/d/web/phobos-prerelease/std_benchmark.html
Is the micron symbol visible on Windows too?
Ionno, haven't tried.
Andrei
On Sun, 25 Sep 2011 21:44:44 -0500, dame wrote:
> Well am I?
\|||/
(o o)
,ooO--(_)---.
| Please|
| don't feed the |
| TROLLs ! |
'--Ooo--'
|__|__|
|| ||
ooO Ooo
Ali
On Mon, 26 Sep 2011 05:44:44 +0300, dame
wrote:
Well am I?
Of course you are not. If you were, you'd choose a high profile language
as your prey.
On another thought i think you are, you keep trying and i am the only one
feeding you with this reply, not a healthy environment for a troll
On Mon, 26 Sep 2011 05:03:32 +0300, Adam D. Ruppe
wrote:
bearophile wrote:
Is the micron symbol visible on Windows too?
Yes, of course.
It's a matter of fonts though - if you don't have the character
in your font (regardless of operating system) it might not show.
The micro sign is very
On 9/25/11 9:02 PM, Robert Jacques wrote:
On Sun, 25 Sep 2011 21:08:45 -0400, Andrei Alexandrescu
wrote:
I've had a good time with std.benchmark today and made it ready for
submission to Phobos. As a perk I've added the %h format specifier,
which formats a number in human-readable form using SI
I'm thinking we could shorten the function names. benchmarkResume is a
mouthful, and we already came to the conclusion that we shouldn't
repeat module names in function names. But I'm all out of ideas for
naming things, sorry. :)
Vladimir Panteleev wrote:
> There are two problems with Unicode characters in console D programs:
I was thinking of the website documentation, not the program itself.
The symbols works for the website, but not really for the program.
(even most my linux terminals aren't UTF-8)
On Mon, 26 Sep 2011 06:14:59 +0300, Andrej Mitrovic
wrote:
I'm thinking we could shorten the function names. benchmarkResume is a
mouthful, and we already came to the conclusion that we shouldn't
repeat module names in function names. But I'm all out of ideas for
naming things, sorry. :)
Al
On Mon, 26 Sep 2011 04:08:45 +0300, Andrei Alexandrescu
wrote:
I've had a good time with std.benchmark today and made it ready for
submission to Phobos. As a perk I've added the %h format specifier,
which formats a number in human-readable form using SI prefixes.
For those interested in
On 9/25/2011 6:24 PM, Peter Alexander wrote:
On 25/09/11 10:57 PM, dsimcha wrote:
On 9/25/2011 4:40 PM, Peter Alexander wrote:
On 25/09/11 1:20 AM, dsimcha wrote:
On 9/24/2011 7:55 PM, Andrei Alexandrescu wrote:
Defining and using an allocator interface would have a small speed
impact (i.e. a
"dsimcha" wrote in message
news:j5otvn$2qg1$1...@digitalmars.com...
>
> T newArray(T, I...)(I sizes);
>
> // Usage:
> auto foo = newArray!(uint[])(5);
>
> This would be marginally do-able but very ugly if RTTI were used.
You can do this with a final templated interface method and forward to the
On Sunday, September 25, 2011 21:51:49 Andrei Alexandrescu wrote:
> On 9/25/11 8:41 PM, bearophile wrote:
> > Andrei Alexandrescu:
> >> http://erdani.com/d/web/phobos-prerelease/std_benchmark.html
> >
> > Is the micron symbol visible on Windows too?
>
> Ionno, haven't tried.
core.time.Duration h
On Sun, 25 Sep 2011 23:06:01 -0400, Andrei Alexandrescu
wrote:
On 9/25/11 9:02 PM, Robert Jacques wrote:
On Sun, 25 Sep 2011 21:08:45 -0400, Andrei Alexandrescu
wrote:
I've had a good time with std.benchmark today and made it ready for
submission to Phobos. As a perk I've added the %h format
so wrote:
> On Mon, 26 Sep 2011 05:44:44 +0300, dame
> wrote:
>
>> Well am I?
>
> Of course you are not. If you were, you'd choose a high profile
> language as your prey.
> On another thought i think you are, you keep trying and i am the only
> one feeding you with this reply, not a healthy enviro
or maybe I want you to get the fu
I am not a warrior.
>so wrote:
> On Mon, 26 Sep 2011 05:44:44 +0300, dame
> wrote:
>
>> Well am I?
>
> Of course you are not. If you were, you'd choose a high profile
> language as your prey.
> On another thought i think you are, you keep trying and i am the on
On 25.09.2011 04:25, Peter Alexander wrote:
On 24/09/11 4:47 PM, Rainer Schuetze wrote:
Sorry for the bad example, here's one that is not thread-safe, and where
the invariant can fail in a multi-threaded environment:
shared(int) globId;
class C
{
invariant() { assert((globId & 1) == 0); }
@p
On Monday, September 26, 2011 08:14:31 Rainer Schuetze wrote:
> Which finally brings us back to the original question: What does
> immutable guarantee in the face of non-pure property getter functions?
immutable guarantees that when an object is immutable, none of its member
variables will _ever_
and you shut the fuck up and stand the fuck down, and get the fuck out of
my face
I have not lived a day without her.
On 9/25/2011 6:08 PM, Andrei Alexandrescu wrote:
I've had a good time with std.benchmark today and made it ready for submission
to Phobos. As a perk I've added the %h format specifier, which formats a number
in human-readable form using SI prefixes.
We already have std.perf:
http://www.d-pro
69 matches
Mail list logo