On Tuesday, 30 June 2015 at 19:36:24 UTC, Jacob Carlborg wrote:
On 30/06/15 16:19, aki wrote:
Please suggest me if anyone have an idea.
You can use TypeInfo.getHash [1] to get the hash of a given
value. Something like:
string a = "foo";
typeid(a).getHash(&a)
[1] http://dlang.org/phobos/ob
Hi.
With a few changes, I have got the source working for the client
and server code for hello.
The COM object isn't recognised by dynamic languages such as
Python and VBA, even after registering.
I think I need to add type library fields in the registry.
Any tips or sample code from some
On Tue, Jun 30, 2015 at 06:33:32PM +, Taylor Hillegeist via
Digitalmars-d-learn wrote:
> So I am aware that Unicode is not simple... I have been working on a boxes
> like project http://boxes.thomasjensen.com/
>
> it basically puts a pretty border around stdin characters. like so:
>
On Tue, 30 Jun 2015 21:02:37 +, DLearner wrote:
> Out of curiosity, why can't D define a 2-dim array by something like:
> int(2,1) foo;
>
> which defines two elements referred to as:
> foo(0,0) and foo(1,0)?
Work is being done on multidimensional slicing, see this thread:
http://forum.dlang.o
On Tuesday, 30 June 2015 at 22:23:40 UTC, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer
wrote:
Have you tried placing const on the function signature? i.e.:
pure int delegate() const d = () const {...
That's how you'd do it (I think, didn't test) if the deleg
On Wednesday, 1 July 2015 at 00:13:36 UTC, Jesse Phillips wrote:
On Tuesday, 30 June 2015 at 22:23:40 UTC, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer
wrote:
Have you tried placing const on the function signature? i.e.:
pure int delegate() const d = () cons
int[] a = [1,1,1,1];
int[] b = [1,1,1,1];
int[] c;
c[] = a[] - b[];
c.writeln;
This outputs []. This feels wrong, it feels like something that
should have exploded or set the length to 4. If the lengths of a
and b are mismatched it throws an exception.
On Tuesday, 30 June 2015 at 15:18:36 UTC, Jack Applegame wrote:
Just creating a bunch (10k) of sleeping (for 100 msecs)
goroutines/tasks.
Compilers
go: go version go1.4.2 linux/amd64
vibe.d: DMD64 D Compiler v2.067.1 linux/amd64, vibe.d 0.7.23
Code
go: http://pastebin.com/2zBnGBpt
vibe
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer
wrote:
Have you tried placing const on the function signature? i.e.:
pure int delegate() const d = () const {...
That's how you'd do it (I think, didn't test) if the delegate
context pointer was a class/struct.
-Steve
Nah, says
On Tuesday, 30 June 2015 at 21:02:39 UTC, DLearner wrote:
On Tuesday, 30 June 2015 at 20:33:31 UTC, jmh530 wrote:
On Tuesday, 30 June 2015 at 20:17:12 UTC, Justin Whear wrote:
[...]
I think this is a good explanation.
Looking through
http://dlang.org/arrays.html
I see that the multidimension
On 6/30/15 5:44 PM, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 21:31:05 UTC, Steven Schveighoffer wrote:
On 6/30/15 5:23 PM, Tofu Ninja wrote:
On Sunday, 28 June 2015 at 10:19:05 UTC, anonymous wrote:
[...]
Is there any way to annotate the context as const?
const x = 4 ;)
But even if y
On Tuesday, 30 June 2015 at 22:23:40 UTC, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer
wrote:
Have you tried placing const on the function signature? i.e.:
pure int delegate() const d = () const {...
That's how you'd do it (I think, didn't test) if the deleg
On Tuesday, 30 June 2015 at 21:31:05 UTC, Steven Schveighoffer
wrote:
On 6/30/15 5:23 PM, Tofu Ninja wrote:
On Sunday, 28 June 2015 at 10:19:05 UTC, anonymous wrote:
[...]
Is there any way to annotate the context as const?
const x = 4 ;)
But even if you could annotate just the *reference*
I was reading "D Templates: A Tutorial" by Philippe Sigaud which
says:
--- quote
What is a Template? In the next chapters, you’ll see how to
define function, struct and class templates.
But before that, I’d like to introduce what a template really is,
because this
def
On 1/07/2015 6:33 a.m., Taylor Hillegeist wrote:
So I am aware that Unicode is not simple... I have been working on a
boxes like project http://boxes.thomasjensen.com/
it basically puts a pretty border around stdin characters. like so:
/\ \
\_|Dif
On Tuesday, 30 June 2015 at 21:06:58 UTC, WhatMeWorry wrote:
All the stuff I've read about templates always refers to them
as template declarations.
So with the following code segment:
template codeBlockTemplate(T, U)
{
T a = 7;
U b = 'z';
}
codeBlockTemplate!(int, char); // error he
On Tuesday, 30 June 2015 at 15:18:36 UTC, Jack Applegame wrote:
Just creating a bunch (10k) of sleeping (for 100 msecs)
goroutines/tasks.
Compilers
go: go version go1.4.2 linux/amd64
vibe.d: DMD64 D Compiler v2.067.1 linux/amd64, vibe.d 0.7.23
Code
go: http://pastebin.com/2zBnGBpt
vibe
On Tuesday, 30 June 2015 at 20:17:12 UTC, Justin Whear wrote:
No. The order of braces when indexing is the opposite of the
order when
declaring.
The declaration
int [1][2] foo;
reads innermost to outermost, "((int [1] ) [2])"
When indexing foo, you index from outermost to innermost, so
foo[
Oh, seems I should learn to refresh the page :)
On 6/30/15 5:23 PM, Tofu Ninja wrote:
On Sunday, 28 June 2015 at 10:19:05 UTC, anonymous wrote:
[...]
Is there any way to annotate the context as const?
const x = 4 ;)
But even if you could annotate just the *reference* as const, it doesn't
stop foo from changing it as you did in the examp
So I am aware that Unicode is not simple... I have been working
on a boxes like project http://boxes.thomasjensen.com/
it basically puts a pretty border around stdin characters. like
so:
/\ \
\_|Different all twisty a|
|of in maze are you, |
Suppose:
'int [1][2] foo;'
Probably I misunderstand, but TDPL seems to say that foo has two
elements:
foo[0][0] and foo[1][0]
as opposed to two elements:
foo[0][0] and foo[0][1]
Is this correct?
I am pretty surprised, as the following code gives errors.
void main(){
int [1][2] foo;
foo[0][0] = 1;
foo[0][1] = 2;
foo[1][0] = 3;
foo[1][1] = 4;
}
Those errors are:
app.d(5): Error: array index 1 is out of bounds foo[0][0 .. 1]
app.d(7): Error: array index 1 is out of bound
All the stuff I've read about templates always refers to them as
template declarations.
So with the following code segment:
template codeBlockTemplate(T, U)
{
T a = 7;
U b = 'z';
}
codeBlockTemplate!(int, char); // error here
Microsof's Visual Studio IDE tells me expected, ;
found
On Sunday, 28 June 2015 at 09:59:29 UTC, Marc Schütz wrote:
On Sunday, 28 June 2015 at 01:02:02 UTC, Charles Hixson wrote:
I'm planning an application where a series of threads each
...gn. Does anyone have a better idea?
(The rough estimate of the number of Tids is six, but that's
likely to
On Saturday, 27 June 2015 at 21:53:33 UTC, ketmar wrote:
is it safe to call `GC.removeRange` in dtor? i believe it
should be safe, so one can perform various cleanups, but
documentation says nothing about guarantees
It's not documented. Afaik parts of the standard library depend
on this behav
On Sunday, 28 June 2015 at 10:19:05 UTC, anonymous wrote:
[...]
Is there any way to annotate the context as const?
On Tuesday, 30 June 2015 at 20:33:31 UTC, jmh530 wrote:
On Tuesday, 30 June 2015 at 20:17:12 UTC, Justin Whear wrote:
[...]
I think this is a good explanation.
Looking through
http://dlang.org/arrays.html
I see that the multidimensional array indexing is not
particularly focused on (could be
On 30/06/15 16:19, aki wrote:
Please suggest me if anyone have an idea.
You can use TypeInfo.getHash [1] to get the hash of a given value.
Something like:
string a = "foo";
typeid(a).getHash(&a)
[1] http://dlang.org/phobos/object.html#.TypeInfo.getHash
--
/Jacob Carlborg
On 6/30/15 11:16 AM, Jonathan M Davis wrote:
On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
On Monday, 29 June 2015 at 19:29:37 UTC, sigod wrote:
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed t
On Tuesday, 30 June 2015 at 17:37:38 UTC, Atila Neves wrote:
Sleep will almost certainly pause and block the fiber. Vibe.d
only switches between them when there's IO to be done or
something else from the event loop.
Sleep blocks the fiber, but not the event loop. Because it isn't
core.thread.Th
On Tue, 30 Jun 2015 20:09:50 +, DLearner wrote:
> Suppose:
> 'int [1][2] foo;'
>
> Probably I misunderstand, but TDPL seems to say that foo has two
> elements:
> foo[0][0] and foo[1][0]
>
> as opposed to two elements:
> foo[0][0] and foo[0][1]
>
> Is this correct?
No. The order of braces
On Tuesday, 30 June 2015 at 14:28:49 UTC, Paul wrote:
Using dub I get this during linking:
Building tkd-test ~master configuration "application", build
type debug.
Compiling using dmd...
Linking...
/usr/bin/ld: cannot find -ltcl
/usr/bin/ld: cannot find -ltk
...any suggestions please?
You n
On 6/27/15 5:53 PM, ketmar wrote:
is it safe to call `GC.removeRange` in dtor? i believe it should be safe,
so one can perform various cleanups, but documentation says nothing about
guarantees.
Hm... I can't see any reason why it wouldn't be allowed. removeRange
shouldn't allocate, so the one
On Tuesday, 30 June 2015 at 15:18:36 UTC, Jack Applegame wrote:
Just creating a bunch (10k) of sleeping (for 100 msecs)
goroutines/tasks.
Compilers
go: go version go1.4.2 linux/amd64
vibe.d: DMD64 D Compiler v2.067.1 linux/amd64, vibe.d 0.7.23
Code
go: http://pastebin.com/2zBnGBpt
vibe
On 6/26/15 6:00 PM, Tofu Ninja wrote:
Also are static constructors in templated types guaranteed to run for
every instantiation?
I'd hazard to guess that the current compiler does run them, but that
they probably aren't guaranteed to run by a sufficiently smart future
compiler.
Note, I stro
On Tuesday, 30 June 2015 at 15:17:00 UTC, Jonathan M Davis wrote:
I tend to think that it's incredibly stupid to use something
like Nullable for a type that's already Nullable.
Unfortunately, we're stuck with it as changing that would break
code.
It's just silly. If a type is already nullabl
On Monday, 29 June 2015 at 14:28:06 UTC, anonymous wrote:
On Monday, 29 June 2015 at 12:04:46 UTC, Jonathan M Davis wrote:
You haven't declared an immutable constructor, so you can't
construct an immutable Foo.
That's not what's happening. Constructing an immutable Foo
works just fine.
Then
On Thursday, 25 June 2015 at 03:49:04 UTC, Tofu Ninja wrote:
> Is this intended or is it a bug?
On Thursday, 25 June 2015 at 03:53:58 UTC, Adam D. Ruppe wrote:
Intended, the mixin template works on the basis of names. This
The extra step is easy though: alias the name in:
I would like to to t
On Sunday, 28 June 2015 at 05:04:48 UTC, DlangLearner wrote:
I will convert a Java program into D. The original Java code is
based on the class RandomeAccessFile which essentially defines
a set of methods for read/write Int/Long/Float/String etc. The
module std.stream seems to be a good fit for
On Tuesday, 30 June 2015 at 16:43:58 UTC, anonymous wrote:
On Tuesday, 30 June 2015 at 15:18:36 UTC, Jack Applegame wrote:
Just creating a bunch (10k) of sleeping (for 100 msecs)
goroutines/tasks.
Compilers
go: go version go1.4.2 linux/amd64
vibe.d: DMD64 D Compiler v2.067.1 linux/amd64, v
On Tuesday, 30 June 2015 at 15:25:27 UTC, Alex Parrill wrote:
On Tuesday, 30 June 2015 at 14:28:49 UTC, Paul wrote:
Using dub I get this during linking:
Building tkd-test ~master configuration "application", build
type debug.
Compiling using dmd...
Linking...
/usr/bin/ld: cannot find -ltcl
/u
On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
On Monday, 29 June 2015 at 19:29:37 UTC, sigod wrote:
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed to be used with reference types
(e.g. classes)
Don't have go installed, but for me, the timings don't change
very much depending on compiler and optimization flags:
dub --compiler=dmd 13346ms
dub --compiler=dmd --build=release 12348ms
dub --compiler=ldc212082ms
dub --compiler=ldc2 --build=release
I would like to know proper way to calculate
hash for given member fields.
class Foo {
int value;
string str;
override nothrow @safe size_t toHash() {
// calculate hash based on field value.
// value and str in this example.
}
}
boo
On Tuesday, 30 June 2015 at 15:18:36 UTC, Jack Applegame wrote:
Just creating a bunch (10k) of sleeping (for 100 msecs)
goroutines/tasks.
Compilers
go: go version go1.4.2 linux/amd64
vibe.d: DMD64 D Compiler v2.067.1 linux/amd64, vibe.d 0.7.23
Code
go: http://pastebin.com/2zBnGBpt
vibe
On Tuesday, 30 June 2015 at 14:19:39 UTC, aki wrote:
I would like to know proper way to calculate
hash for given member fields.
class Foo {
int value;
string str;
override nothrow @safe size_t toHash() {
// calculate hash based on field value.
Just creating a bunch (10k) of sleeping (for 100 msecs)
goroutines/tasks.
Compilers
go: go version go1.4.2 linux/amd64
vibe.d: DMD64 D Compiler v2.067.1 linux/amd64, vibe.d 0.7.23
Code
go: http://pastebin.com/2zBnGBpt
vibe.d: http://pastebin.com/JkpwSe47
go version build with "go b
On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
It's a design mistake in Nullable. I would suggest that either
never use Nullable with a type that already has a null value,
or use the "overload" of Nullable that takes a null value, and
set it to null. Example:
Class Test {}
alias Nullab
On Tuesday, 30 June 2015 at 11:50:19 UTC, Marc Schütz wrote:
On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
It's a design mistake in Nullable. I would suggest that either
never use Nullable with a type that already has a null value,
or use the "overload" of Nullable that takes a null val
Using dub I get this during linking:
Building tkd-test ~master configuration "application", build type
debug.
Compiling using dmd...
Linking...
/usr/bin/ld: cannot find -ltcl
/usr/bin/ld: cannot find -ltk
...any suggestions please?
https://issues.dlang.org/show_bug.cgi?id=14751
On Tuesday, 30 June 2015 at 12:58:21 UTC, Paul wrote:
I downloaded the archive from
https://github.com/nomad-software/tkd and files are same as in
the git repo. Tcl/tk is installed on this machine (test 'hello
world' script works fine) but I get this error when compiling
the example from the g
On Tuesday, 30 June 2015 at 13:19:25 UTC, Marc Schütz wrote:
If you don't want to use DUB, you need to download the other
two packages from code.dlang.org and specifiy "-I/path/to/tcltk
-I/path/to/x11 -I/path/to/tkd" in the DMD invocation.
Thank you, I'll try that.
If you don't want to use DUB, you need to download the other two
packages from code.dlang.org and specifiy "-I/path/to/tcltk
-I/path/to/x11 -I/path/to/tkd" in the DMD invocation.
I downloaded the archive from
https://github.com/nomad-software/tkd and files are same as in
the git repo. Tcl/tk is installed on this machine (test 'hello
world' script works fine) but I get this error when compiling the
example from the github page:
tkd/interpreter/tcl.d(16): Error: module
On Tuesday, 30 June 2015 at 13:22:43 UTC, Paul wrote:
On Tuesday, 30 June 2015 at 13:19:25 UTC, Marc Schütz wrote:
If you don't want to use DUB, you need to download the other
two packages from code.dlang.org and specifiy
"-I/path/to/tcltk -I/path/to/x11 -I/path/to/tkd" in the DMD
invocation.
On Monday, 29 June 2015 at 19:29:37 UTC, sigod wrote:
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed to be used with reference types
(e.g. classes)?
P.S. I have experience with C#, where `Nullable` ca
On Monday, 29 June 2015 at 20:12:12 UTC, Assembly wrote:
I believe it's a design choice, if so, could someone explain
why? is immutable better than C#'s readonly so that the
readonly keyword isn't even needed? for example, I'd like to
declare a member as readonly but I can't do it directly beca
I stumbled upon this interesting programming challenge [0], which
imho should be possible to implement in D. Maybe someone here
wants to try.
Task: Given two enums with less than 256 states, pack them into
one byte and provide convenient accessor functions.
Something like this:
enum X { A,
I believe it's a design choice, if so, could someone explain why?
is immutable better than C#'s readonly so that the readonly
keyword isn't even needed? for example, I'd like to declare a
member as readonly but I can't do it directly because immutable
create a new type (since it's a type specif
On Monday, 29 June 2015 at 22:11:16 UTC, sigod wrote:
`new immutable(MyClass)()` is invalid code.
It's perfectly fine, actually.
On Friday, 26 June 2015 at 22:14:56 UTC, Adam D. Ruppe wrote:
On Friday, 26 June 2015 at 21:50:30 UTC, Assembly wrote:
class Baa {
Foo a = new Foo();
Foo b = new Foo();
Foo[] l = [a,b];
I wasn't aware about this. I'm used to have static only when I
request so, like using static keyword
On Monday, 29 June 2015 at 22:05:47 UTC, qznc wrote:
I stumbled upon this interesting programming challenge [0],
which imho should be possible to implement in D. Maybe someone
here wants to try.
Task: Given two enums with less than 256 states, pack them into
one byte and provide convenient ac
On Monday, 29 June 2015 at 11:36:42 UTC, ketmar wrote:
it doesn't, afair, but it's quite natural. if user type was
throwed out as unused, it would be very strange to insist on
keeping it's initialization code.
Personally I would be kinda pissed if the compiler did this, I
expect the static ct
On Monday, 29 June 2015 at 19:29:37 UTC, sigod wrote:
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed to be used with reference types
(e.g. classes)?
P.S. I have experience with C#, where `Nullable` ca
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed to be used with reference types (e.g.
classes)?
P.S. I have experience with C#, where `Nullable` cannot be
used with reference types. And it sounds logic
On Monday, 29 June 2015 at 20:12:12 UTC, Assembly wrote:
I believe it's a design choice, if so, could someone explain
why? is immutable better than C#'s readonly so that the
readonly keyword isn't even needed? for example, I'd like to
declare a member as readonly but I can't do it directly beca
On Monday, 29 June 2015 at 22:22:46 UTC, anonymous wrote:
On Monday, 29 June 2015 at 22:11:16 UTC, sigod wrote:
`new immutable(MyClass)()` is invalid code.
It's perfectly fine, actually.
Yes, you're right. It seems I've mistyped `immutable` when was
checking it with compiler.
something like that can help?
```
run: all
$(OUT)
```
On Monday, 29 June 2015 at 10:22:10 UTC, Atila Neves wrote:
I guess I'm going to have benchmark this now... :)
What about doing a memory profiling using DMD fresh builtin
profiler of
http://dpaste.dzfl.pl/17b0ed9c0204
?
I'm guessing the GC might give misguiding results as your
testStruct
On Monday, 29 June 2015 at 11:36:42 UTC, ketmar wrote:
it doesn't, afair, but it's quite natural. if user type was
throwed out as unused, it would be very strange to insist on
keeping it's initialization code.
Yes, but I would instead expect that the static ctor prevents the
type from becomin
On Mon, 29 Jun 2015 05:04:36 -0700
Jonathan M Davis via Digitalmars-d-learn
wrote:
> On Sunday, June 28, 2015 11:37:59 Jack Applegame via
> Digitalmars-d-learn wrote:
> > I don't see any reason why it should not compile.
> >
> > import std.array;
> > import std.range;
> > import std.algorithm;
>
On Monday, 29 June 2015 at 12:04:46 UTC, Jonathan M Davis wrote:
You haven't declared an immutable constructor, so you can't
construct an immutable Foo.
That's not what's happening. Constructing an immutable Foo works
just fine.
On Sunday, June 28, 2015 11:37:59 Jack Applegame via Digitalmars-d-learn wrote:
> I don't see any reason why it should not compile.
>
> import std.array;
> import std.range;
> import std.algorithm;
>
> class Foo {
> }
>
> void main() {
> auto result = iota(3).map!(i => new immutable Foo).array();
On Monday, 29 June 2015 at 08:45:15 UTC, Atila Neves wrote:
On Sunday, 28 June 2015 at 17:02:42 UTC, Nordlöw wrote:
On Friday, 26 June 2015 at 21:40:49 UTC, Atila Neves wrote:
I'd have to benchmark it against something, but I'm pretty
sure cerealed is fast.
Faster than msgpack?
I guess I'm
On Monday, 29 June 2015 at 02:07:57 UTC, ketmar wrote:
On Sat, 27 Jun 2015 22:49:13 +, Tofu Ninja wrote:
On Saturday, 27 June 2015 at 22:20:40 UTC, ketmar wrote:
2. no.
Hmm... any reason why?
if instantiated template was not used in any code that makes
into compiled binary, compiler
Hello,
i get myself a nice makefile from here:
https://gist.github.com/darkstalker/2221824
How can I modify it so that I can use the run option of dmd? I
tried to add another compiler flag variable which would be only
used with run but then it messed with -of$@ option and said it
couldn't re
On Sunday, June 28, 2015 11:14:57 Baz via Digitalmars-d-learn wrote:
> On Sunday, 28 June 2015 at 05:04:48 UTC, DlangLearner wrote:
> > I will convert a Java program into D. The original Java code is
> > based on the class RandomeAccessFile which essentially defines
> > a set of methods for read/wr
On Mon, 29 Jun 2015 10:19:33 +, Marc Schütz wrote:
> On Monday, 29 June 2015 at 02:07:57 UTC, ketmar wrote:
>> On Sat, 27 Jun 2015 22:49:13 +, Tofu Ninja wrote:
>>
>>> On Saturday, 27 June 2015 at 22:20:40 UTC, ketmar wrote:
2. no.
>>>
>>> Hmm... any reason why?
>>
>> if instantiat
On Sunday, 28 June 2015 at 21:26:52 UTC, Walter Bright wrote:
On 6/28/2015 2:48 AM, ponce wrote:
I don't quite get what code could be generating that
reference, since I don't
call format or toString on a Throwable.
You can grep the .obj files for the symbol.
Thanks.
Fixed by upgrading. I th
On Sunday, 28 June 2015 at 17:02:42 UTC, Nordlöw wrote:
On Friday, 26 June 2015 at 21:40:49 UTC, Atila Neves wrote:
I'd have to benchmark it against something, but I'm pretty
sure cerealed is fast.
Faster than msgpack?
I guess I'm going to have benchmark this now... :)
Atila
p.s. also note that module can has several static ctors, i.e. this works
fine:
=== z00.d ===
module z00;
import std.stdio;
static this () { writeln("ctor0"); }
static this () { writeln("ctor1"); }
=== z01.d ===
module z01;
import z00;
void main () {}
this prints:
ctor0
ctor1
so you c
On Sunday, 28 June 2015 at 23:42:47 UTC, Timothee Cour wrote:
How would I cast away shared for a given expression?
I can write it for a specific type but I'd like to have a
generic way to do
so.
Also, Unqual doesn't help here.
Normally, "cast()" removes "shared" from a type. BUT, sometimes
i
I'd say bug, I think the array function is trying an optimization
it shouldn't be trying for immutable classes.
Note:
should work with any types, eg:
shared(T[])* => T[]*
etc...
On Sun, Jun 28, 2015 at 4:42 PM, Timothee Cour
wrote:
> How would I cast away shared for a given expression?
> I can write it for a specific type but I'd like to have a generic way to
> do so.
> Also, Unqual doesn't help here.
>
On Monday, 29 June 2015 at 02:31:18 UTC, ketmar wrote:
yes. it doesn't do that now, afair, but i can't see any sense
in running code that obviously does nothing, as it's owner is
not used. module ctors was designed for such things -- i.e. to
run some code on startup. if someone is doing some vi
On 6/28/2015 2:48 AM, ponce wrote:
I don't quite get what code could be generating that reference, since I don't
call format or toString on a Throwable.
You can grep the .obj files for the symbol.
On Sat, 27 Jun 2015 22:49:13 +, Tofu Ninja wrote:
> On Saturday, 27 June 2015 at 22:20:40 UTC, ketmar wrote:
>> 2. no.
>
> Hmm... any reason why?
if instantiated template was not used in any code that makes into
compiled binary, compiler is free to remove it with all it's ctors. it
may do
On Monday, 29 June 2015 at 02:07:57 UTC, ketmar wrote:
On Sat, 27 Jun 2015 22:49:13 +, Tofu Ninja wrote:
On Saturday, 27 June 2015 at 22:20:40 UTC, ketmar wrote:
2. no.
Hmm... any reason why?
if instantiated template was not used in any code that makes
into compiled binary, compiler
On Mon, 29 Jun 2015 03:10:44 +, Tofu Ninja wrote:
> On Monday, 29 June 2015 at 02:31:18 UTC, ketmar wrote:
>> yes. it doesn't do that now, afair, but i can't see any sense in
>> running code that obviously does nothing, as it's owner is not used.
>> module ctors was designed for such things --
How would I cast away shared for a given expression?
I can write it for a specific type but I'd like to have a generic way to do
so.
Also, Unqual doesn't help here.
On 06/28/2015 01:50 PM, Charles Hixson via Digitalmars-d-learn wrote:
I'm planning an application where a series of threads each need to be
aware of the Tids of all the others.
The original thread did receive a couple of responses:
http://forum.dlang.org/thread/mailman.5134.1435453322.7663.di
On Mon, 29 Jun 2015 02:19:54 +, Tofu Ninja wrote:
> On Monday, 29 June 2015 at 02:07:57 UTC, ketmar wrote:
>> On Sat, 27 Jun 2015 22:49:13 +, Tofu Ninja wrote:
>>
>>> On Saturday, 27 June 2015 at 22:20:40 UTC, ketmar wrote:
2. no.
>>>
>>> Hmm... any reason why?
>>
>> if instantiated
I'm planning an application where a series of threads each need to be
aware of the Tids of all the others. The number won't be known at
compile time, but that doesn't seem to change the design.
All I've been able to come up with is a pair of loops, one to spawn the
threads, and collect their
On Sunday, 28 June 2015 at 10:16:47 UTC, Marc Schütz wrote:
On Saturday, 27 June 2015 at 17:43:13 UTC, aki wrote:
But when I compile it by DMD 2.062 on Windows
it says:
testArray.d(5): Error: cannot infer argument types
(line 5 is at "foreach(i, v; a[]) {" )
2.062 is really ancient, we're abo
On Sat, 27 Jun 2015 22:49:13 +, Tofu Ninja wrote:
> On Saturday, 27 June 2015 at 22:20:40 UTC, ketmar wrote:
>> 2. no.
>
> Hmm... any reason why?
p.s. note that static ctors are *intended* to run in runtime, not in
compile time. if compiler decides that some code is not required in
runtim
My understanding of pure is that a function labeled pure can only
include pure functions. I've been confused by the fact that a
function calling map (like below) can be labeled pure without any
problems. The only way I can rationalize it is that map really
isn't a function, it's (if I'm underst
On Sunday, 28 June 2015 at 16:15:31 UTC, Marc Schütz wrote:
Secondly, `map` is indeed a template function, as you write.
For templates functions, the compiler infers many properties,
including purity.
Thanks for the reply. Two follow ups: 1) Does labeling a template
as pure matter if the co
On Sunday, 28 June 2015 at 15:55:51 UTC, jmh530 wrote:
My understanding of pure is that a function labeled pure can
only include pure functions. I've been confused by the fact
that a function calling map (like below) can be labeled pure
without any problems. The only way I can rationalize it is
1 - 100 of 103 matches
Mail list logo