On Wed, 2017-05-31 at 16:37 -0700, H. S. Teoh via Digitalmars-d-learn
wrote:
> […]
>
> An even more down-to-earth counterargument is that if CPU vendors had
> been content with understandable, simple CPU implementations, and
> eschewed "heroic", hard-to-understand things like instruction
> pipelin
On Wednesday, May 31, 2017 22:50:19 H. S. Teoh via Digitalmars-d-learn
wrote:
> Perhaps the right approach is to check if the array length is less than
> some arbitrary threshold, and just use a naïve loop below that, and only
> switch to the complicated hackish stuff where you're sure it will
> a
On Wed, 2017-05-31 at 16:37 -0700, H. S. Teoh via Digitalmars-d-learn
wrote:
>
[…]
> With D, we can have the cake and eat it too. The understandable /
> naïve
> implementation can be available as a fallback (and reference
> implementation), with OS-specific optimized implementations guarded
> und
On Wednesday, 31 May 2017 at 15:44:51 UTC, Ivan Kazmenko wrote:
So, two custom calls, two minor changes, no sweat. Is
everything right now? Even if not: that was fast, we can do
another iteration. When we have a short readable solution with
no special cases, the first few changes are
On Tuesday, 23 May 2017 at 03:33:38 UTC, Era Scarecrow wrote:
From what I'm seeing, it should be 8, 0ch, 10h, then 14h, all
positive. I'm really scratching my head why I'm having this
issue...
What am i missing here?
More experiments and i think it comes down to static arrays.
The following
Somehow this code works for me:
```D
auto error (int status, string description){
struct Error {
int status;
string description;
}
Error err = {
status,
description
};
return err.serializeToJson;
}
```
which is supposed to be the same as
```D
On Thursday, 1 June 2017 at 12:04:05 UTC, Daniel Tan Fook Hao
wrote:
If I'm reading this right, in the former, the struct is created
when the function is called in run-time, and the type is then
inferred after that? I don't really understand the behavior
behind this.
The only difference betw
On Thursday, 1 June 2017 at 12:04:05 UTC, Daniel Tan Fook Hao
wrote:
Somehow this code works for me:
```D
auto error (int status, string description){
struct Error {
int status;
string description;
}
Error err = {
status,
description
};
return
On Thursday, 1 June 2017 at 08:45:23 UTC, Solomon E wrote:
On Wednesday, 31 May 2017 at 15:44:51 UTC, Ivan Kazmenko wrote:
So, two custom calls, two minor changes, no sweat. Is
everything right now? Even if not: that was fast, we can do
another iteration. When we have a short readable
On Thursday, 1 June 2017 at 12:04:05 UTC, Daniel Tan Fook Hao
wrote:
Somehow this code works for me:
```D
auto error (int status, string description){
struct Error {
int status;
string description;
}
Error err = {
status,
description
};
return
On Wednesday, 31 May 2017 at 17:20:08 UTC, Ali Çehreli wrote:
On 05/31/2017 02:10 AM, Vasileios Anagnostopoulos wrote:
> compiler enforced @throws
For that to be possible, the compiler would have to see all
definitions, which is not possible with separate compilation.
Besides, I think the on
On Tuesday, 30 May 2017 at 18:05:07 UTC, H. S. Teoh wrote:
On Tue, May 30, 2017 at 05:57:04PM +, Lyle via
Digitalmars-d-learn wrote:
Hi,
I have an associative array of type int[ulong] and I'm trying
to get the index of the maximum value, like this:
int[ulong] aa = [1UL: 2000,
On 06/01/2017 06:26 AM, Vasileios Anagnostopoulos wrote:
> how do I know that a function "may throw" an
> exception in order to use a try/catch/finally block? This is my biggest
> problem (sorry, coming from a java/C background).
I come from a C++ background so the advices may be different from
On Thursday, 1 June 2017 at 15:17:32 UTC, Ali Çehreli wrote:
On 06/01/2017 06:26 AM, Vasileios Anagnostopoulos wrote:
> how do I know that a function "may throw" an
> exception in order to use a try/catch/finally block? This is
my biggest
> problem (sorry, coming from a java/C background).
I co
On 06/01/2017 08:41 AM, Vasileios Anagnostopoulos wrote:
//If I do not know
void haveToCommunicateWithAli() {
sendEmailToAli();
}
//can blow-up after code has shipped
//and have no chance to recover
What shall I do in this case? Thank you in advance.
Vasileios
(Sorry if I go to too basic
On Wednesday, 31 May 2017 at 21:02:07 UTC, jmh530 wrote:
On Wednesday, 31 May 2017 at 19:22:18 UTC, Stefan Koch wrote:
You could also use string mixins.
Which will be more efficient then recursion.
I try to avoid string mixins unless I can't help it.
Nevertheless, I made an effort to try to
On Wed, May 31, 2017 at 12:13:04PM -0700, H. S. Teoh via Digitalmars-d-learn
wrote:
> On Tue, May 30, 2017 at 05:13:46PM -0700, Ali Çehreli via Digitalmars-d-learn
> wrote:
> [...]
> > I could not make the D program come close to wc's performance when the
> > data was piped from stdin.
> [...]
>
Want to create and load plugins written in D into a D app at
run-time, the kind that can make api calls or extended main app
with other functionality.
I'm currently interested in it for a vibe.d app. How does these
stuff work?
On Thursday, 1 June 2017 at 23:24:13 UTC, aberba wrote:
Want to create and load plugins written in D into a D app at
run-time, the kind that can make api calls or extended main app
with other functionality.
I'm currently interested in it for a vibe.d app. How does these
stuff work?
It works
I wonder if it is possible to somehow turn D in to a scripting
language that can be run inside D?
The point? To have the same uniform syntax for quickly developing
scripts that can then be easily transferred, if desired, in to a
complete binary.
e.g., suppose I am working in some type of ana
On Friday, 2 June 2017 at 02:06:27 UTC, Mike B Johnson wrote:
I wonder if it is possible to somehow turn D in to a scripting
language that can be run inside D?
Why not just use regular compiled D?
On Friday, 2 June 2017 at 02:15:27 UTC, Adam D. Ruppe wrote:
On Friday, 2 June 2017 at 02:06:27 UTC, Mike B Johnson wrote:
I wonder if it is possible to somehow turn D in to a scripting
language that can be run inside D?
Why not just use regular compiled D?
Because it requires one to recomp
On Friday, 2 June 2017 at 02:32:43 UTC, Mike B Johnson wrote:
1. change test12.wav to test123.wav
2. save file
3. recompile.
4. run
5. Get back to same test point(could be a lot or a little
amount of work).
If that is all you want; then compile your code into a dll/so and
load the new version
On Friday, 2 June 2017 at 02:39:47 UTC, Stefan Koch wrote:
On Friday, 2 June 2017 at 02:32:43 UTC, Mike B Johnson wrote:
1. change test12.wav to test123.wav
2. save file
3. recompile.
4. run
5. Get back to same test point(could be a lot or a little
amount of work).
If that is all you want; th
On Friday, 2 June 2017 at 02:32:43 UTC, Mike B Johnson wrote:
But it would be nice if a D had a scripting language that used
the same D syntax as this would make porting a piece of cake.
So my script.d has kinda similar syntax, but fairly different
semantics than good D code (though my jsvar.
On Friday, 2 June 2017 at 03:33:37 UTC, Adam D. Ruppe wrote:
On Friday, 2 June 2017 at 02:32:43 UTC, Mike B Johnson wrote:
But it would be nice if a D had a scripting language that used
the same D syntax as this would make porting a piece of cake.
So my script.d has kinda similar syntax, but
26 matches
Mail list logo