Hi!
This is kind of bug report/question.
I'm running Ubuntu 12.04 (x64), DMD v2.064.2 and have the
following code:
T identity(T)(T e) { return e; }
struct S(alias Func)
{
void call()
{
import std.stdio;
writeln(Func("string").length);
}
}
static struct S1
{
ali
In addition to my letter I wrote some test code following the
message. I found out that I can use copy constructor signature:
this(immutable(this)), to get a mutable copy of immutable struct.
But this is not working with this(const(this)). My thoughts were
that if I would define some method par
On Tuesday, 26 November 2013 at 23:31:16 UTC, bioinfornatics
wrote:
Hi,
this time i have so many question about CT …
iws and ibuclaw help me for this.
I stuck currently about a cast at CT ->
http://www.dpaste.dzfl.pl/1a28a22c
it seem this should works but not…
So if you confirm maybe a report
On Wed, Nov 27, 2013 at 05:07:29PM -0500, Jonathan M Davis wrote:
> On Wednesday, November 27, 2013 21:12:07 Joseph Rushton Wakeling wrote:
> > On 27/11/13 18:55, Joseph Rushton Wakeling wrote:
> > > Understood. Pull request for the ddoc/deprecation message fix:
> > > https://github.com/D-Programmi
On 27/11/13 23:07, Jonathan M Davis wrote:
I don't know... Is it actually possible merge imaginary code? ;)
Yes, but the lines run up and down the screen ;-)
On Wednesday, November 27, 2013 21:12:07 Joseph Rushton Wakeling wrote:
> On 27/11/13 18:55, Joseph Rushton Wakeling wrote:
> > Understood. Pull request for the ddoc/deprecation message fix:
> > https://github.com/D-Programming-Language/phobos/pull/1730
>
> Thanks for the quick merge. std.complex.
On Thursday, 7 November 2013 at 14:31:27 UTC, Agustin wrote:
On Thursday, 7 November 2013 at 12:29:44 UTC, bearophile wrote:
Agustin:
no property 'popFront' for type 'BinaryHeap!(uint[])'
Try to use front and removeFront (I don't know why there is
removeFront instead of popFront).
Bye,
be
TDPL, page 37, says:
"Hex strings are useful for defining raw data; the compiler makes
no attempt whatsoever to interpret the contents as Unicode
characters or anything else but hexadecimal digits."
But:
static immutable (char[32]) s0 = x"";// compiles
static strings
On 27/11/13 18:55, Joseph Rushton Wakeling wrote:
Understood. Pull request for the ddoc/deprecation message fix:
https://github.com/D-Programming-Language/phobos/pull/1730
Thanks for the quick merge. std.complex.Imaginary to follow :-)
It's may be conceptual question. For example I want to create
immutable struct instance in module scope like a global default
value. But then I need to make mutable copy of this global struct
variable in order to init some class instance with it (for
example). Main requirement is to do this wit
On Wednesday, 27 November 2013 at 18:40:09 UTC, Namespace wrote:
Too bad. Would have been really awesome.
It is pretty hard to define within common grammar rules because
of implicit nature of operators.
On Wednesday, 27 November 2013 at 17:47:13 UTC, bearophile wrote:
Namespace:
void main() {
A a;
a.opIndex!int(0); // [1]
a!int[0]; // [2]
}
[1] works, but [2] fails.
How can I call opIndex with bracket syntax and a typename? Or
is this not possible?
I think that
On 27/11/13 17:38, monarch_dodra wrote:
If what you are doing is "non-trivial" though, it's better to submit two
different pulls for it.
Understood. Pull request for the ddoc/deprecation message fix:
https://github.com/D-Programming-Language/phobos/pull/1730
Namespace:
void main() {
A a;
a.opIndex!int(0); // [1]
a!int[0]; // [2]
}
[1] works, but [2] fails.
How can I call opIndex with bracket syntax and a typename? Or
is this not possible?
I think that's not supported by D syntax. So if you want that,
you need to use
On Wednesday, 27 November 2013 at 17:25:49 UTC, Shammah
Chancellor wrote:
On 2013-11-27 16:07:50 +, Namespace said:
Just out of curiosity: Is it possible to call an overloaded
operator with a template type?
import std.stdio;
struct A {
void opIndex(T)(size_t index) {
On 27/11/13 15:05, monarch_dodra wrote:
That wouldn't work, because you'd need "this" to refer said dummy variable. Even
if it worked, you'd bloat all instances of your struct/class just for dummy
data :/
I'm not saying it's a GOOD idea. :-P
On 2013-11-27 16:07:50 +, Namespace said:
Just out of curiosity: Is it possible to call an overloaded operator
with a template type?
import std.stdio;
struct A {
void opIndex(T)(size_t index) {
}
}
void main() {
A a;
a.opIndex!int(0);
On Wednesday, 27 November 2013 at 15:54:48 UTC, Joseph Rushton
Wakeling wrote:
On 27/11/13 16:14, H. S. Teoh wrote:
And that would be my fault. I believe it was one of my pulls
that
contained that wrong doc. Anybody care to submit a pull to fix
that? :-)
I'll take care of it. I'm working on
Just out of curiosity: Is it possible to call an overloaded
operator with a template type?
import std.stdio;
struct A {
void opIndex(T)(size_t index) {
}
}
void main() {
A a;
a.opIndex!int(0); // [1]
a!int[0]; // [2]
}
[1] work
On 27/11/13 16:14, H. S. Teoh wrote:
And that would be my fault. I believe it was one of my pulls that
contained that wrong doc. Anybody care to submit a pull to fix that? :-)
I'll take care of it. I'm working on an Imaginary struct to complement
std.complex.Complex so it's trivial to make th
On Wednesday, 27 November 2013 at 07:30:58 UTC, Jacob Carlborg
wrote:
On 2013-11-27 02:26, Craig Dillabaugh wrote:
2. Once I think my bindings are stable I would like to add
them to
Deimos or DUB registries. Are there any recommendations for
testing
bindings? I checked through some other bind
On Wed, Nov 27, 2013 at 03:30:51AM -0800, Jonathan M Davis wrote:
> On Wednesday, November 27, 2013 11:39:48 Joseph Rushton Wakeling wrote:
> > Hello all,
> >
> > I'm currently messing around in the internals of std.complex (cf.
> > discussion on main mailing list:-). In Complex.toString there is
On Wednesday, 27 November 2013 at 14:34:15 UTC, Gary Willoughby
wrote:
Here i understand what is happening but how could i improve
this example to make the expected asserts true?
In this specific example you could e.g. use std.uni.normalize,
which by default puts the string into NFC, which has
The normalize function in std.uni helps a lot here (well, it
would if it actually compiled, but that's an easy fix, just
import std.typecons in your copy of phobos/src/uni.d. It does so
already but only in version(unittest)! LOL)
dstrings are a bit easier to use too:
import std.algorithm;
imp
Beaophile also linked this article:
http://forum.dlang.org/thread/nieoqqmidngwoqwnk...@forum.dlang.org
On Wednesday, 27 November 2013 at 14:34:15 UTC, Gary Willoughby
wrote:
I've just been reading this article:
http://mortoray.com/2013/11/27/the-string-type-is-broken/ and
wanted to test if D
On Wednesday, 27 November 2013 at 14:48:07 UTC, David Nadlinger
wrote:
On Wednesday, 27 November 2013 at 14:34:15 UTC, Gary Willoughby
wrote:
Here i understand what is happening but how could i improve
this example to make the expected asserts true?
In this specific example you could e.g. use
D strings have dual nature. They behave as arrays of code units
when slicing or accessing .length directly (because of O(1)
guarantees for those operations) but all algorithms in standard
library work with them as with arrays of dchar:
import std.algorithm;
import std.range : walkLength, take;
I've just been reading this article:
http://mortoray.com/2013/11/27/the-string-type-is-broken/ and
wanted to test if D performed in the same way as he describes,
i.e. unicode strings being 'broken' because they are just arrays.
Although i understand the difference between code units and code
On Wednesday, 27 November 2013 at 11:20:59 UTC, Joseph Rushton
Wakeling wrote:
On 27/11/13 12:14, monarch_dodra wrote:
Interesting trick. That said, doing this (should) also mean
you can't use foo in
a pure context, since it means the caller needs to access the
global dummy
(although that seem
On 2013-11-27 06:06:49 +, bioinfornatics said:
On Wednesday, 27 November 2013 at 01:22:07 UTC, Shammah Chancellor wrote:
On 2013-11-26 23:31:14 +, bioinfornatics said:
Hi,
this time i have so many question about CT …
iws and ibuclaw help me for this.
I stuck currently about a cast at
On Wednesday, 27 November 2013 at 06:34:27 UTC, Philippe Sigaud
wrote:
Does std.conv.to have a better behavior?
http://www.dpaste.dzfl.pl/6a5d8c72
it segfault
On Wednesday, November 27, 2013 11:39:48 Joseph Rushton Wakeling wrote:
> Hello all,
>
> I'm currently messing around in the internals of std.complex (cf. discussion
> on main mailing list:-). In Complex.toString there is a deprecation
> message asking the user to "use std.format.format()".
>
>
On 27/11/13 12:17, evilrat wrote:
for string formatting use std.string.format, it is like writefln but for
strings.
Which I normally do. :-) But in this case my question is slightly more
specific ...
On Wednesday, 27 November 2013 at 10:39:56 UTC, Joseph Rushton
Wakeling wrote:
Hello all,
I'm currently messing around in the internals of std.complex
(cf. discussion on main mailing list:-). In Complex.toString
there is a deprecation message asking the user to "use
std.format.format()".
H
On 27/11/13 12:14, monarch_dodra wrote:
Interesting trick. That said, doing this (should) also mean you can't use foo in
a pure context, since it means the caller needs to access the global dummy
(although that seems to work right now).
Should be OK in a struct/class method context, if dummy is
On Wednesday, 27 November 2013 at 10:16:13 UTC, Jonathan M Davis
wrote:
On Wednesday, November 27, 2013 10:57:42 Joseph Rushton
Wakeling wrote:
On 27/11/13 10:45, bearophile wrote:
> It's useless code, you can't have ref variadic, sorry.
Ack. :-( I just tried it out myself and found the same t
On 27/11/13 11:15, Jonathan M Davis wrote:
Personally, I think that it's by far the best approach to just do
int foo(int i)
{
int j;
return foo(i, j);
}
It's clean, and I really don't see a big problem with it.
Yea, that's really the conclusion I had alre
Hello all,
I'm currently messing around in the internals of std.complex (cf. discussion on
main mailing list:-). In Complex.toString there is a deprecation message asking
the user to "use std.format.format()".
However, so far as I can tell both via docs and browsing std/format.d there _is_
On Wednesday, November 27, 2013 10:57:42 Joseph Rushton Wakeling wrote:
> On 27/11/13 10:45, bearophile wrote:
> > It's useless code, you can't have ref variadic, sorry.
>
> Ack. :-( I just tried it out myself and found the same thing.
Personally, I think that it's by far the best approach to ju
Joseph Rushton Wakeling:
That's a nice thought ... ! Thank you. :-)
It's useless code, you can't have ref variadic, sorry.
Bye,
bearophile
On 27/11/13 10:45, bearophile wrote:
It's useless code, you can't have ref variadic, sorry.
Ack. :-( I just tried it out myself and found the same thing.
On 26/11/13 16:44, bearophile wrote:
If you want a single function, dropping out you can write:
int foo(size_t N)(in int i, int[N] j...)
if (N < 2) {
static if (N == 1)
j[0] = i;
return i;
}
That's a nice thought ... ! Thank you. :-)
42 matches
Mail list logo