On Friday, 25 October 2019 at 21:06:53 UTC, IGotD- wrote:
On Friday, 25 October 2019 at 20:44:18 UTC, Dennis wrote:
On Friday, 25 October 2019 at 19:49:05 UTC, Ali Çehreli wrote:
I'm still not completely sold on the whole idea though
because it's not a clear win.
Do others see other
On Saturday, 26 October 2019 at 02:42:04 UTC, rikki cattermole
wrote:
On 26/10/2019 2:27 PM, 9898287 wrote:
[...]
You probably want -O3 not -O5.
[...]
I assume what you intended is:
writeln("Hello, ", i);
Also for format functions in D you should prefer the templated
variation as it
On 26/10/2019 2:27 PM, 9898287 wrote:
Hi I want to find out what's causing my file writes to be so slow. I'm
setting up buffer and locking the file and writing them to the file.
$ cat d.d && ldc2 -O5 d.d && time ./d >> /dev/null
You probably want -O3 not -O5.
void main() {
import
Hi I want to find out what's causing my file writes to be so
slow. I'm setting up buffer and locking the file and writing them
to the file.
$ cat d.d && ldc2 -O5 d.d && time ./d >> /dev/null
void main() {
import std.stdio;
stdout.setvbuf(4096);
stdout.lock();
foreach(i; 0 ..
On Friday, 25 October 2019 at 20:44:18 UTC, Dennis wrote:
On Friday, 25 October 2019 at 19:49:05 UTC, Ali Çehreli wrote:
I'm still not completely sold on the whole idea though because
it's not a clear win.
Do others see other advantages in other places like templates?
For example, could
On Thursday, 24 October 2019 at 17:41:21 UTC, Dukc wrote:
On Thursday, 24 October 2019 at 16:50:17 UTC, Dukc wrote:
Hmm, I need to check whether I can do that on LibreOffice Calc.
Unfortunately, no. If there's a way to do that, it's not
obvious.
I should be able to make an easy-to-use
On Friday, 25 October 2019 at 15:22:12 UTC, Ali Çehreli wrote:
On 10/25/2019 05:37 AM, Stefan Koch wrote:
just replace x = a[i] with x = a.ptr[i];
That's a neat trick!
Ali
But it requires the function to be qualified as @trusted which
might hide a @system == operator. How common is it
On Friday, 25 October 2019 at 19:49:05 UTC, Ali Çehreli wrote:
I'm still not completely sold on the whole idea though because
it's not a clear win.
Do others see other advantages in other places like templates?
For example, could templates really be written generically for
arrays and
On 10/25/2019 02:25 AM, Dennis wrote:
> On Friday, 25 October 2019 at 05:17:35 UTC, Ali Çehreli wrote:
>> - Big O is different
>
> No it isn't.
Agreed and I've just realized a benefit of the 'in' operator for arrays,
which I haven't heard before. (I don't follow all discussions in
detail.)
On Friday, 25 October 2019 at 16:01:57 UTC, mipri wrote:
On Friday, 25 October 2019 at 15:52:50 UTC, Paul Backus wrote:
On Friday, 25 October 2019 at 09:25:21 UTC, Dennis wrote:
I can overload the 'in' operator on my types to something
that takes exponential time if I want, just like "+" can
On Friday, 25 October 2019 at 14:51:33 UTC, Yui Hosaka wrote:
The outputs for your program are as follows: [...]
Thanks for the output. I added it to the bug report.
The internal representation of the value is correct in all
versions. While the result of the direct call of snprintf always
On Thursday, 24 October 2019 at 12:58:11 UTC, lili wrote:
Hi:
In Dlang where is strange design. The in expression can only
use to associative array, why array can not use in expression.
I don't see much of a problem why this couldn't be implemented as
long as the user understands the
On Friday, 25 October 2019 at 15:52:50 UTC, Paul Backus wrote:
On Friday, 25 October 2019 at 09:25:21 UTC, Dennis wrote:
I can overload the 'in' operator on my types to something that
takes exponential time if I want, just like "+" can also be
overloaded to a linear time operation on e.g.
On Friday, 25 October 2019 at 09:25:21 UTC, Dennis wrote:
I can overload the 'in' operator on my types to something that
takes exponential time if I want, just like "+" can also be
overloaded to a linear time operation on e.g. BigInt.
Worth noting that `opIn` is a D1 operator overload, and
On 10/25/2019 05:37 AM, Stefan Koch wrote:
just replace x = a[i] with x = a.ptr[i];
That's a neat trick!
Ali
On 10/25/2019 07:34 AM, Robert M. Münch wrote:
> If the compiler is a 1-pass one I see the problem, otherwise one could
> first get a "total overview" and create the necessary vtbl entries after
> everything is known. Maybe this is not "how a compiler is implemented"
> but the problem sounds
On Friday, 25 October 2019 at 06:53:38 UTC, berni44 wrote:
On Thursday, 24 October 2019 at 20:48:02 UTC, Yui Hosaka wrote:
Do you have any idea for this issue?
I added a bug report:
https://issues.dlang.org/show_bug.cgi?id=20320
Internally the conversation from the binary representation of
On 2019-10-24 19:45:42 +, Ali ehreli said:
One practical reason is, the number of their instances cannot be known
when the interface (or base class) is compiled.
...
Ali, first, thanks a lot for your answers.
If the compiler is a 1-pass one I see the problem, otherwise one could
On Thursday, 24 October 2019 at 21:02:03 UTC, Per Nordlöw wrote:
On Thursday, 24 October 2019 at 18:37:05 UTC, welkam wrote:
I remember in some video Chandler Carruth said that value
range propagation across function boundary was implemented in
llvm but later removed because it produced no
On Wednesday, 23 October 2019 at 12:01:47 UTC, Per Nordlöw wrote:
On Wednesday, 23 October 2019 at 11:33:56 UTC, kinke wrote:
For your example, the template is inferred to be @safe, and
`-release` only elides bounds checks in @system functions
(corresponding to `-boundscheck=safeonly`). Use
On Friday, 25 October 2019 at 06:40:19 UTC, lili wrote:
why need defined a alias Min in Min template?
https://dlang.org/spec/template.html#implicit_template_properties
More fun with Notebooks, adding and removing tabs willy-nilly:
https://gtkdcoding.com/2019/10/25/0082-notebook-vi-add-remove-tabs.html
On Friday, 25 October 2019 at 05:17:35 UTC, Ali Çehreli wrote:
- Big O is different
No it isn't. Worst case lookup of an associative array lookup is
O(n) too. It can easily be 'achieved' by having a key type with:
```
size_t toHash() const scope pure {
return 0;
}
```
The fact that
On Friday, 25 October 2019 at 06:40:19 UTC, lili wrote:
Hi:
What is the alias Min = xxx mean? why need defined a alias Min
in Min template?
```
template Min(alias pred, Args...)
if (Args.length > 0 && __traits(isTemplate, pred))
{
static if (Args.length == 1)
{
alias Min =
On Friday, 25 October 2019 at 06:59:07 UTC, Per Nordlöw wrote:
/** Array-overload for `skipOver` with no explicit predicate
predicate. */
bool skipOver(T)(scope ref const(T)[] haystack,
scope const(T)[] needle)
Found it.
The parameter `haystack` must be qualified with inout
Why does
/** Array-overload for `startsWith` with no explicit predicate
predicate. */
bool startsWith(T)(scope const(T)[] haystack,
scope const(T)[] needle)
{
if (haystack.length >= needle.length)
{
return haystack[0 .. needle.length] == needle; // range
On Thursday, 24 October 2019 at 20:48:02 UTC, Yui Hosaka wrote:
Do you have any idea for this issue?
I added a bug report:
https://issues.dlang.org/show_bug.cgi?id=20320
Internally the conversation from the binary representation of the
value to the printed one is done by a call to a C
Hi:
What is the alias Min = xxx mean? why need defined a alias Min in
Min template?
```
template Min(alias pred, Args...)
if (Args.length > 0 && __traits(isTemplate, pred))
{
static if (Args.length == 1)
{
alias Min = Alias!(Args[0]);
}
else static if (isLess!(pred,
28 matches
Mail list logo