On Sunday, 24 August 2014 at 09:29:53 UTC, Jacob Carlborg wrote:
On 2014-08-24 10:03, Bienlein wrote:
I have omitted the code for the TestClass class to save space.
Problem
is that the compiler outputs this:
Error: @nogc function 'main.nogcNew!(TestClass, ).nogcNew'
cannot call
non-@nogc fu
On 04/09/14 22:30, Kagamin wrote:
emplace calls constructor, and constructor can't be realistically
required to be nogc. It depends on the constructor. Similar for destroy.
But if the constructor is @nogc or if there's a default constructor.
--
/Jacob Carlborg
On Fri, 05 Sep 2014 00:26:07 +
Freddy via Digitalmars-d-learn
wrote:
> How would you create a mutable array with a fixed(compile error
> when trying to change) length.
Static arrays have a fixed length and live on the stack.
int[12] arr;
Dynamic arrays have a mutable length and the memory
On Thursday, 4 September 2014 at 17:22:42 UTC, Gary Willoughby
wrote:
On Thursday, 4 September 2014 at 16:43:13 UTC, evilrat wrote:
how i can specify github repo & branch? i've already tried
adding everything i have in mind but no luck so far.
so in theory it should be like this:
--
How would you create a mutable array with a fixed(compile error
when trying to change) length.
On Sunday, 24 August 2014 at 08:03:11 UTC, Bienlein wrote:
Hello,
I was having a look at the new nogc annotation and therefore
wrote some code that creates an instance on the heap bypassing
the GC (code adapted from http://dpaste.dzfl.pl/2377217c7870).
Problem is that calls to call the class'
On Thu, 04 Sep 2014 20:29:08 +
"Nordlöw" via Digitalmars-d-learn
wrote:
> On Thursday, 4 September 2014 at 20:03:57 UTC, Nordlöw wrote:
> > if (low < value < high)
>
> An alternative could be
>
> if (value in low..high)
and then we need new overload for 'in' operator...
signature
On 9/4/14, 7:03 PM, "Nordlöw" wrote:
On Thursday, 4 September 2014 at 22:02:20 UTC, Nordlöw wrote:
D can also, in this case, do (or will do) common sub-expression
elimination because it has a strict memory model (const and
immutability) and function purity (template inference).
Correction: foo
On 09/04/2014 02:04 PM, monarch_dodra wrote:
> On Thursday, 4 September 2014 at 19:12:27 UTC, Ali Çehreli wrote:
>> The documentation says "To overload a[], simply define opIndex with no
>> parameters":
>>
>> http://dlang.org/operatoroverloading.html#Slice
>>
>> And it works with some uses of a
On 09/04/2014 04:03 PM, "Nordlöw" wrote:
> Are there any programming languages that extend the behaviour of comparison
> operators to allow expressions such as
>
> if (low < value < high)
>
> ?
>
> This syntax is currently disallowed by DMD.
>
> I'm aware of the risk of a programmer misint
On Thursday, 4 September 2014 at 22:02:20 UTC, Nordlöw wrote:
D can also, in this case, do (or will do) common sub-expression
elimination because it has a strict memory model (const and
immutability) and function purity (template inference).
Correction: foo cannot be pure in this case. But I b
On Thursday, 4 September 2014 at 20:45:41 UTC, Ary Borenszweig
wrote:
That's because the middle expression in the comparison is first
assigned to a temporary variable, so `foo` is only invoked
once. This makes both the code more readable, efficient and
saves the programmer from having to save t
On 09/04/2014 12:19 PM, "Marc Schütz" " wrote:
On Thursday, 4 September 2014 at 19:12:27 UTC, Ali Çehreli wrote:
The documentation says "To overload a[], simply define opIndex with no
parameters":
http://dlang.org/operatoroverloading.html#Slice
And it works with some uses of a[]. However, op
On Thursday, 4 September 2014 at 19:12:27 UTC, Ali Çehreli wrote:
The documentation says "To overload a[], simply define opIndex
with no parameters":
http://dlang.org/operatoroverloading.html#Slice
And it works with some uses of a[]. However, opSlice() seems to
be needed to actually use the
On Thursday, 4 September 2014 at 20:57:43 UTC, monarch_dodra
wrote:
On Thursday, 4 September 2014 at 20:38:39 UTC, Nordlöw wrote:
On Thursday, 4 September 2014 at 19:24:00 UTC, Nordlöw wrote:
string t1; t1 ~= '*'.repeat(n).array;
string t2; t2 ~= "*".replicate(n);
After having read
http:
On Thursday, 4 September 2014 at 20:38:39 UTC, Nordlöw wrote:
On Thursday, 4 September 2014 at 19:24:00 UTC, Nordlöw wrote:
string t1; t1 ~= '*'.repeat(n).array;
string t2; t2 ~= "*".replicate(n);
After having read
http://dlang.org/phobos/std_array.html#.replicate
I came to the conclu
https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dmain2.d#L270
well, this sucks.
https://github.com/D-Programming-Language/druntime/blob/master/src/core/stdc/stdio.d#L457
see? It's null. Hmm... where is it initialized?
On 9/4/14, 5:03 PM, "Nordlöw" wrote:
Are there any programming languages that extend the behaviour of
comparison operators to allow expressions such as
if (low < value < high)
?
This syntax is currently disallowed by DMD.
I'm aware of the risk of a programmer misinterpreting this as
On Thursday, 4 September 2014 at 20:38:38 UTC, Kagamin wrote:
Maybe some module constructor wasn't run due to linking mess.
So it remains uninitialized.
Is there a way I can check if module c-tor run? rt_init()
returned no error.
On Thursday, 4 September 2014 at 19:24:00 UTC, Nordlöw wrote:
string t1; t1 ~= '*'.repeat(n).array;
string t2; t2 ~= "*".replicate(n);
After having read
http://dlang.org/phobos/std_array.html#.replicate
I came to the conclusion that the lazy std.range:repeat is
preferred.
I'm stil
Maybe some module constructor wasn't run due to linking mess. So
it remains uninitialized.
On Sunday, 24 August 2014 at 13:27:01 UTC, Jacob Carlborg wrote:
On 2014-08-24 14:18, Kagamin wrote:
Shouldn't emplace and destroy infer their attributes instead
of strictly
annotating them as nogc.
If they are templates, I guess they should. I don't know how
good the compiler is at inferri
On Thursday, 4 September 2014 at 20:25:52 UTC, monarch_dodra
wrote:
In the case of D, it's a C compatibility thing. Other languages
I don't know.
FYI,
auto x = 1 < 2 < 3;
as C++ is accepted (but warned about) by GCC as
x.cpp:19:20: warning: comparisons like ‘X<=Y<=Z’ do not have
their m
On Thursday, 4 September 2014 at 20:03:57 UTC, Nordlöw wrote:
if (low < value < high)
An alternative could be
if (value in low..high)
but then the problem would be to remember that this range is
actually
[low..high[
to be compliant with range indexing semantics.
But it could
On Thursday, 4 September 2014 at 20:03:57 UTC, Nordlöw wrote:
Are there any programming languages that extend the behaviour
of comparison operators to allow expressions such as
if (low < value < high)
?
This syntax is currently disallowed by DMD.
I'm aware of the risk of a programmer mis
Are there any programming languages that extend the behaviour of
comparison operators to allow expressions such as
if (low < value < high)
?
This syntax is currently disallowed by DMD.
I'm aware of the risk of a programmer misinterpreting this as
if ((low < value) < high)
Is this th
On Thursday, 4 September 2014 at 19:22:42 UTC, Nordlöw wrote:
Is DMD/Phobos already that clever!?
Further -vgc has nothing to say about
string t1; t1 ~= '*'.repeat(n).array;
string t2; t2 ~= "*".replicate(n);
.
On Wednesday, 3 September 2014 at 20:20:09 UTC, Meta wrote:
Does this work?
s ~= "*".replicate(n);
Yes, thanks.
So what's best?
type ~= '*'.repeat(pointerCount).array;
or
type ~= "*".replicate(pointerCount);
?
Further, -vgc says only ~= will allocate:
t_repeat_replicate.d(12,19)
On Thursday, 4 September 2014 at 19:12:27 UTC, Ali Çehreli wrote:
The documentation says "To overload a[], simply define opIndex
with no parameters":
http://dlang.org/operatoroverloading.html#Slice
And it works with some uses of a[]. However, opSlice() seems to
be needed to actually use the
The documentation says "To overload a[], simply define opIndex with no
parameters":
http://dlang.org/operatoroverloading.html#Slice
And it works with some uses of a[]. However, opSlice() seems to be
needed to actually use the returned slice further.
Note that opSlice() also seems to be for
On Wednesday, 3 September 2014 at 20:46:40 UTC, monarch_dodra
wrote:
Is there a simpler way to way to
s ~= repeat('*', n).array.to!string;
if s has to be of type string?
s ~= repeat('*', n).array();
Should be enough. Why the "to!string"?
You're correct. The
.to!string
was unnecessary
> Ah that sounds interesting too! Immediately I start thinking in terms like
> tidlywiki http://tiddlywiki.com/ or something similar, I guess the emacs way
> described earlier also would support this. I personally always enjoy reading
> the readthedocs stuff http://docs.readthedocs.org/en/latest/ i
On Thursday, 4 September 2014 at 18:22:55 UTC, Marc Schütz wrote:
On Thursday, 4 September 2014 at 17:57:47 UTC, Szymon Gatner
wrote:
On Thursday, 4 September 2014 at 15:25:59 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 04 Sep 2014 15:10:21 +
"Jorge A. S. via Digitalmars-d-learn"
wr
On Thursday, 4 September 2014 at 17:57:47 UTC, Szymon Gatner
wrote:
On Thursday, 4 September 2014 at 15:25:59 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 04 Sep 2014 15:10:21 +
"Jorge A. S. via Digitalmars-d-learn"
wrote:
In one of the specializations of the write function in the
s
On Thursday, 4 September 2014 at 15:25:59 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 04 Sep 2014 15:10:21 +
"Jorge A. S. via Digitalmars-d-learn"
wrote:
In one of the specializations of the write function in the
std.stdio (the call site that you showed in your post) no
check for c
On Thursday, 4 September 2014 at 16:43:13 UTC, evilrat wrote:
how i can specify github repo & branch? i've already tried
adding everything i have in mind but no luck so far.
so in theory it should be like this:
-- dub.json
"dependencies": {
"cairod": {"version": "~ReworkWin32", "path
On Thursday, 4 September 2014 at 17:06:00 UTC, Márcio Martins
wrote:
On Wednesday, 3 September 2014 at 07:43:20 UTC, Guillaume
Chatelet wrote:
+1 I've been bitten by this also.
Same here, +1
It's still on my radar, but it's actually not that trivial of a
change, especially if we want to avo
On Wednesday, 3 September 2014 at 07:43:20 UTC, Guillaume
Chatelet wrote:
+1 I've been bitten by this also.
Same here, +1
how i can specify github repo & branch? i've already tried adding
everything i have in mind but no luck so far.
so in theory it should be like this:
-- dub.json
"dependencies": {
"cairod": {"version": "~ReworkWin32", "path":
"https://github.com/evilrat666/cairoD.git"}
}
A closer look shows that cycle "repeats the given _forward_ range
indefinitely", so I guess the current behavior is at least
consistent with the docs.
On Thursday, 4 September 2014 at 11:58:58 UTC, monarch_dodra
wrote:
On Thursday, 4 September 2014 at 11:43:28 UTC, monarch_dodra
wrote:
Indexing is done with the unsigned size_t.
I re-read your post, and I don't think I actually answered your
question...?
I don't know of any case where you'
On Thu, 04 Sep 2014 15:10:21 +
"Jorge A. S. via Digitalmars-d-learn"
wrote:
> In one of the specializations of the write function in the
> std.stdio (the call site that you showed in your post) no check
> for closed stdout (when stdout._p is null) is done. I can't say
> if this is a bug in
I'm having an error related to yours: when I call writeln
function in a closed stdout I will get a segfault message.
Example:
import std.stdio;
void main() {
stdout.close();
write("hello\n");
}
The code above will crash with segfault buf the following code
will raise an exception instead
On Thursday, 4 September 2014 at 14:00:14 UTC, Ali Çehreli wrote:
On 09/04/2014 02:54 AM, nikki wrote:
> a pointer variable to save an adres of a function, then
dereferencing to use
> it.
If possible, even in C, I would recommend using a 'function
pointer' for that. However, there are cases wh
On 09/04/2014 02:54 AM, nikki wrote:
> a pointer variable to save an adres of a function, then dereferencing
to use
> it.
If possible, even in C, I would recommend using a 'function pointer' for
that. However, there are cases where the signature of the function
should be unknown to the code
I should have read your post more carefully, the 'tagging' in the
code is not really what I am after, I want the file including the
documentation to just be a valid d file, does'nt mean however
that there aren't ways of solving the issue without such precise
tagging I guess
On Saturday, 30 August 2014 at 07:24:39 UTC, Philippe Sigaud
wrote:
On Sat, Aug 30, 2014 at 1:37 AM, nikki wrote:
I wasn't too happy about it and I wrote my own little parse
thingie and have
a literate version nice and meta and small and sloppy ;)
http://nikkikoole.github.io/docs/dokidokDOC.ht
On Friday, 29 August 2014 at 23:41:00 UTC, bearophile wrote:
nikki:
I use it to change my d sourcefile slightly (into valid
markdown)
then I use a node module (ghmd) to make sortof sexy html from
that.
Are you going to add popups of the types as in the F# page I
have linked?
Bye,
bearophi
On Thursday, 4 September 2014 at 11:43:28 UTC, monarch_dodra
wrote:
Indexing is done with the unsigned size_t.
I re-read your post, and I don't think I actually answered your
question...?
I don't know of any case where you'd want to index negativelly.
That said, I'm sure it could be possibl
On Thursday, 4 September 2014 at 11:29:30 UTC, rcor wrote:
auto c = cycle([1,2,3]);
foreach(i ; iota(-4,4)) {
writeln(c[i]);
}
prints the sequence
1
2
3
1
1 <- c[0] == c[-1]
2
3
I understand this is what would happen if I were to just use
modulus on an index to access the original arra
auto c = cycle([1,2,3]);
foreach(i ; iota(-4,4)) {
writeln(c[i]);
}
prints the sequence
1
2
3
1
1 <- c[0] == c[-1]
2
3
I understand this is what would happen if I were to just use
modulus on an index to access the original array, but should
Cycle really mimic this behavior? I feel like
On Thursday, 4 September 2014 at 09:54:57 UTC, nikki wrote:
thanks! just what I needed, with some stumbling I managed to
get everything working as intended: using a pointer variable to
save an adres of a function, then dereferencing to use it.
Now I am wondering when to use the ** ?
for examp
On Thursday, 4 September 2014 at 09:02:26 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 04 Sep 2014 08:38:50 +
via Digitalmars-d-learn
wrote:
Hmm... would be nice if there were a warning/error when
__gshared is used without static in a class.
would you fill enhancement request in b
thanks! just what I needed, with some stumbling I managed to get
everything working as intended: using a pointer variable to save
an adres of a function, then dereferencing to use it.
Now I am wondering when to use the ** ?
for example I found this function over at
https://github.com/d-gamede
On Thu, 04 Sep 2014 08:38:50 +
via Digitalmars-d-learn wrote:
> Hmm... would be nice if there were a warning/error when __gshared
> is used without static in a class.
would you fill enhancement request in bugzilla?
signature.asc
Description: PGP signature
On Wednesday, 3 September 2014 at 20:10:51 UTC, ketmar via
Digitalmars-d-learn wrote:
On Wed, 03 Sep 2014 19:53:15 +
nrgyzer via Digitalmars-d-learn
wrote:
__gshared class members are effectively "static", i.e. they are
"class
members", not "instance members".
Hmm... would be nice if
57 matches
Mail list logo