On Monday, 11 November 2013 at 13:20:04 UTC, bearophile wrote:
Philippe Sigaud:
And I agree with you than character literals should default to
dchar. It's
a perpetual source of friction for me.
99% of my char literals need to be of type char.
On the other hand once you have suffixes to
On Tuesday, November 12, 2013 09:14:54 Kenji Hara wrote:
On Monday, 11 November 2013 at 13:20:04 UTC, bearophile wrote:
Philippe Sigaud:
And I agree with you than character literals should default to
dchar. It's
a perpetual source of friction for me.
99% of my char literals need to
On Tuesday, 12 November 2013 at 01:14:47 UTC, bioinfornatics
wrote:
Dear,
I am looking for a bidirectional map i.e
http://en.wikipedia.org/wiki/Bidirectional_map
My seach into D documentation seem to said to me that this
structure is not implemented.
Something like (for primary idea):
Kenji Hara:
Or, uniform construction for built-in types would be another
better way.
auto c = char('a');
auto w = wchar('a');
auto d = dchar('a');
auto x = char('à'); // compile-time error
Yes, uniform construction syntax for all types seems a good idea.
But the suffixes for chars, as
The following code works for finding the lower bound based on
needle. But I have to create a needle which I don't want to do.
How can I use lowerBound with just the sortKey, date in this
case? So I want to do something like the following - but it
won't work. Is there a way to search an array
On Tuesday, 12 November 2013 at 09:10:07 UTC, Andrea Fontana
wrote:
On Tuesday, 12 November 2013 at 01:14:47 UTC, bioinfornatics
wrote:
Dear,
I am looking for a bidirectional map i.e
http://en.wikipedia.org/wiki/Bidirectional_map
My seach into D documentation seem to said to me that this
Daniel Davidson:
Is there a way to search an array I know is ordered by date by
only supplying date?
You can use a map to perform a projection:
import std.stdio, std.range, std.datetime, std.algorithm,
std.array;
struct S {
Date date;
string foo;
}
void main() {
auto
On Tuesday, 12 November 2013 at 15:51:53 UTC, bearophile wrote:
Daniel Davidson:
Is there a way to search an array I know is ordered by date by
only supplying date?
You can use a map to perform a projection:
import std.stdio, std.range, std.datetime, std.algorithm,
std.array;
Daniel Davidson:
Yes, but that is only giving the dates. I want the actual array
elements. Suppose S is a large object with lots of extra fields
in addition to `string foo`. There should be a way to pull out
the lower bound based on a date without creating a needle (S).
Maybe lowerBound is
On Tuesday, 12 November 2013 at 16:34:30 UTC, bearophile wrote:
Daniel Davidson:
Yes, but that is only giving the dates. I want the actual
array elements. Suppose S is a large object with lots of extra
fields in addition to `string foo`. There should be a way to
pull out the lower bound
Just realized I forgot to delete the 7 and the x from inside the
function calls. Question is the same, though.
On Tuesday, 12 November 2013 at 18:22:46 UTC, Noah wrote:
When running the following code:
__gshared void* return_ptr;
__gshared void* injected_fn = fn;
void main() {
buffer(7);
When running the following code:
__gshared void* return_ptr;
__gshared void* injected_fn = fn;
void main() {
buffer(7);
printf(End main\n);
}
void buffer() {
test(x);
printf(End buffer\n);
}
void test() {
printf(This is a test!\n);
inject();
printf(End of the
Of course after I post this I realize the answer. The function
only works when the surrounding function has at least one
argument. Probably has something to do with the way the compiler
emits no-argument functions, I'll have to look at some
disassembly.
In this declaration (tango.io.Console.d from Tango2):
__gshared immutable immutable(char)[] Eol = \r\n;
Aren't the two `immutable` keywords redundant? Why would
`__gshared` be necessary for such an immutable type?
Thanks
Dne 12.11.2013 19:49, Nicolas Sicard napsal(a):
In this declaration (tango.io.Console.d from Tango2):
__gshared immutable immutable(char)[] Eol = \r\n;
Aren't the two `immutable` keywords redundant? Why would `__gshared` be
necessary for such an immutable type?
Thanks
Hi,
this declaration
I played around a little and figured out, that destructors in D
work quite similarily to destructors in C++. They are invoked,
after the members of the instance being destructed have been
destroyed themselfes (or at least have been brought into an
invalid state). Therefore, these members
On Tuesday, 12 November 2013 at 20:09:57 UTC, Martin Drašar wrote:
Those two immutables are not redundant, because it is an array
of immutable chars (string), that is itself immutable.
It is redundant because immutable is transitive. immutable
char[] is equivalent.
But Tango has lot of
On Tuesday, 12 November 2013 at 20:15:02 UTC, Florian wrote:
I played around a little and figured out, that destructors in D
work quite similarily to destructors in C++. They are invoked,
after the members of the instance being destructed have been
destroyed themselfes (or at least have been
Is there any better way to write the method than:
(cmp doesn't seem to work, and byte arrays don't have an opCmp method.)
int opCmp(ref const B24 b) const
{for(int i = 0;i 24;i++)
{if(bytes[i] b.bytes[i])return-1;
if(bytes[i] b.bytes[i])
On 11/12/2013 01:06 PM, Charles Hixson wrote:
Is there any better way to write the method than:
(cmp doesn't seem to work, and byte arrays don't have an opCmp method.)
int opCmp(ref const B24 b) const
{for(int i = 0;i 24;i++)
{if(bytes[i] b.bytes[i])return
Le 08/11/2013 21:05, Flamaros a écrit :
On Tuesday, 15 October 2013 at 23:10:32 UTC, Flamaros wrote:
On Friday, 6 September 2013 at 20:54:53 UTC, Flamaros wrote:
On Friday, 6 September 2013 at 16:05:43 UTC, Tourist wrote:
On Thursday, 5 September 2013 at 19:48:07 UTC, Flamaros wrote:
I am
On Tuesday, 12 November 2013 at 20:29:13 UTC, Dicebot wrote:
On Tuesday, 12 November 2013 at 20:15:02 UTC, Florian wrote:
I played around a little and figured out, that destructors in
D work quite similarily to destructors in C++. They are
invoked, after the members of the instance being
On Tuesday, 12 November 2013 at 20:16:31 UTC, Dicebot wrote:
On Tuesday, 12 November 2013 at 20:09:57 UTC, Martin Drašar
wrote:
Those two immutables are not redundant, because it is an array
of immutable chars (string), that is itself immutable.
It is redundant because immutable is
Ali Çehreli:
int opCmp(ref const B24 b) const
{
return bytes[].cmp(b.bytes[]);
Few months ago I have written a small rant about that. That
little [] at the end of those arrays is not innocuous, it
essentially throws away a very precious compile-time amount of
information:
On Tuesday, November 12, 2013 23:40:24 Florian wrote:
it would be possible to move the shutdown() sequence into the
destructor of the Connection class.
Classes in D do not have destructors. Only structs to. ~this is a destructor
in a struct, but it's a finalizer in a class. Finalizers are not
I understood very well, that the garbage collector is not
guaranteed to run. However, it does not explain the segmentation
fault in my example, does it?
On Wednesday, November 13, 2013 00:07:12 Florian wrote:
I understood very well, that the garbage collector is not
guaranteed to run. However, it does not explain the segmentation
fault in my example, does it?
You're getting a segfault, because you're using something which is on the GC
heap -
On Tuesday, 12 November 2013 at 23:18:11 UTC, Jonathan M Davis
wrote:
You can't do that in
finalizer, because the GC can choose to free it before the
finalizer even runs
(this avoids issues with circular references).
Ah, damn, have forgotten about it. Disregard previous post.
On Tuesday, 12 November 2013 at 22:40:26 UTC, Florian wrote:
The example below prints the following output:
~Connection
~Session
segmentation fault
Same example prints this for me (no segfault):
~Session
shutdown
~Connection
2.064.2 @ linux-64
What is your system / compiler?
See also
http://d.puremagic.com/issues/show_bug.cgi?id=11451
On 11/12/2013 01:38 PM, Ali Çehreli wrote:
On 11/12/2013 01:06 PM, Charles Hixson wrote:
Is there any better way to write the method than:
(cmp doesn't seem to work, and byte arrays don't have an opCmp method.)
int opCmp(ref const B24 b) const
{for(int i = 0;i 24;i++)
Charles Hixson:
I had tried return bytes.cmp(b.bytes); , but it didn't occur
to me that the error meant I should have used a copy? Does
this syntax mean that what's being compared is a dynamic array
copy of the original static array?
They are not copies, just slices. In case of doubts take
On 11/11/2013 05:14 PM, bioinfornatics wrote:
Dear,
I am looking for a bidirectional map i.e
http://en.wikipedia.org/wiki/Bidirectional_map
My seach into D documentation seem to said to me that this structure is
not implemented.
Something like (for primary idea):
struct
Thanks to both TFF and Kenji for their excellent explanations. I
think my head is going to explode ;).
So, as I understand it, there are two sorts of immutable entities
in D.
The first is probably the one most familiar to the majority of
us, which is an entity with immutable contents but
Hi,
I have this error message ( i.e title ) and i do not see where i
am wrong:
this( in ubyte wordLength, in string sequence ){
kMer = wordLength;
bytePerChar = cast(ubyte)(T.sizeof / kMer);
char[ubyte] toCharTmp;
ubyte[char] toNumTmp;
foreach(
On Wednesday, November 13, 2013 03:43:40 bioinfornatics wrote:
Hi,
I have this error message ( i.e title ) and i do not see where i
am wrong:
this( in ubyte wordLength, in string sequence ){
kMer = wordLength;
bytePerChar = cast(ubyte)(T.sizeof / kMer);
Let's suppose I have a module structure:
- package.module1.core
- package.module2.core
Building documentation with dmd will generate a sigle core.html
file with content related only to package.module2.core,
overwriting the first one.
Is there any way that dmd can recreate directory
37 matches
Mail list logo