On 04/20/2015 02:48 PM, Freddy wrote:
On Monday, 20 April 2015 at 02:56:35 UTC, Ali Çehreli wrote:
Not automatically. Check out addRange and addRoot:
http://dlang.org/phobos/core_memory.html
Ali
The destructor doesn't seem to be running
Sorry, I misunderstood you. You can use a RAII
On 04/20/2015 02:44 PM, Namespace wrote:
Thank you. Do you mean this is worth a PR, to add this
functionality to Phobos?
I am not familiar with such a need so I don't have a strong opinion.
However, if an object needs to be emplaced on top of an existing one, I
can imagine that the original
Thank you. Do you mean this is worth a PR, to add this
functionality to Phobos?
My current code looks like this:
http://dpaste.dzfl.pl/19b78a600b6c
On Monday, 20 April 2015 at 20:22:40 UTC, Jonathan M Davis wrote:
On Monday, April 20, 2015 19:42:30 dvic via Digitalmars-d-learn
wrote:
Thanks for your answer Jonathan. But does the return type part
of
a method
signature? I don't know what theory is claiming about that, but
for me they
are 2
On Monday, 20 April 2015 at 02:56:35 UTC, Ali Çehreli wrote:
Not automatically. Check out addRange and addRoot:
http://dlang.org/phobos/core_memory.html
Ali
The destructor doesn't seem to be running
import std.stdio;
import std.c.stdlib;
import core.memory;
struct Test{
On 04/20/2015 12:05 PM, Namespace wrote:
I'm sorry if I annoy you
Not at all! :) Sorry for not responding earlier.
, but I would really like to know how you would
reuse already instantiated storage of an existing object.
Example code:
final class Foo {
uint id;
@nogc
On Monday, 20 April 2015 at 23:20:07 UTC, Justin Whear wrote:
See std.functional.forward:
http://dlang.org/phobos/std_functional.html#.forward
Sweet beans, thanks
On Monday, 20 April 2015 at 21:58:59 UTC, Ali Çehreli wrote:
On 04/20/2015 02:44 PM, Namespace wrote:
Thank you. Do you mean this is worth a PR, to add this
functionality to Phobos?
I am not familiar with such a need so I don't have a strong
opinion.
However, if an object needs to be
On Monday, 20 April 2015 at 22:24:53 UTC, Ali Çehreli wrote:
On 04/20/2015 02:48 PM, Freddy wrote:
On Monday, 20 April 2015 at 02:56:35 UTC, Ali Çehreli wrote:
Not automatically. Check out addRange and addRoot:
http://dlang.org/phobos/core_memory.html
Ali
The destructor doesn't seem to be
On Mon, 20 Apr 2015 22:50:52 +, Tofu Ninja wrote:
I am trying to write a template function that can take another function
as an alias template argument and duplicate its parameters for it self.
I tried..
auto pass(alias f, T...)(T t)
{
// other stuff... return f(t);
}
but
I am trying to write a template function that can take another
function as an alias template argument and duplicate its
parameters for it self.
For example, something like this...
void foo(ref int x){x = 7;}
auto pass(alias f)(/* ??? */)
{
// other stuff...
return f( /* ??? */ );
}
On Monday, 20 April 2015 at 13:29:58 UTC, John Colvin wrote:
On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. Münch
wrote:
Hi, I just found quite old posts about Valgrind and D. Can
someone give me a short update, what the state
On Tuesday, 21 April 2015 at 01:31:58 UTC, TheGag96 wrote:
Hi guys! I had this homework assignment for data structures
that has a pretty easy solution in C++. Reading input like
this...
1 2 3 # $
4 3 * ! #
20 3 / # $ #
62 # $
2 3 8 * + #
4 48 4 2 + / #
SUM # $
1 2 3 4 5 #
R #
@
...where @
Hi guys! I had this homework assignment for data structures that
has a pretty easy solution in C++. Reading input like this...
1 2 3 # $
4 3 * ! #
20 3 / # $ #
62 # $
2 3 8 * + #
4 48 4 2 + / #
SUM # $
1 2 3 4 5 #
R #
@
...where @ denotes the end of input is fairly simple in C++:
string token
On Monday, 20 April 2015 at 17:25:55 UTC, John Colvin wrote:
On Monday, 20 April 2015 at 16:58:18 UTC, Robert M. Münch wrote:
On 2015-04-20 13:29:57 +, John Colvin said:
Were the causes ever analyzed? I'm a bit wondering why it
happens on floating point stuff...
valgrind doesn't
I think this should work:
import std.stdio;
void main() {
string token;
while(readf(%s , token))
writeln(token);
}
Have you tried that? What is wrong with it if you have?
On Tuesday, 21 April 2015 at 01:46:53 UTC, Adam D. Ruppe wrote:
I think this should work:
import std.stdio;
void main() {
string token;
while(readf(%s , token))
writeln(token);
}
Have you tried that? What is wrong with it if you have?
It'll just leave some
On Tuesday, 21 April 2015 at 02:04:24 UTC, TheGag96 wrote:
It'll just leave some trailing whitespace, which I don't want.
oh it also keeps the newlines attached. Blargh.
Well, forget the D functions, just use the C functions:
import core.stdc.stdio;
void main() {
char[16] token;
On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
The only special thing to take in to account is that valgrind
will choke on DMD generated floating point code
I actually fixed this problem a while ago.
https://github.com/D-Programming-Language/dmd/pull/4368
An actual problem with
Valgrind has a mechanism for teaching it how to ignore certain patterns.
A long time ago I setup suppressions for the gc, but the code has
changed out from under that version so the work would need to be redone.
On 4/20/2015 7:23 PM, Martin Nowak via Digitalmars-d-learn wrote:
On Monday, 20
On Sunday, 19 April 2015 at 23:38:49 UTC, Freddy wrote:
C libraries have a pattern of
HiddenType* getObj();
void freeObj(HiddenType*);
Is there any way I can make the GC search for a HiddenType*
and run freeObj when the pointer is not found.
You can't turn an arbitrary pointer into
On Monday, 20 April 2015 at 17:16:21 UTC, Ivan Kazmenko wrote:
writeln(wrap(a, 30, ;; , ;; ));
Works with dmd 2.066.1 and 2.067.0.
Thanks.
On Monday, April 20, 2015 19:42:30 dvic via Digitalmars-d-learn wrote:
Thanks for your answer Jonathan. But does the return type part of
a method
signature? I don't know what theory is claiming about that, but
for me they
are 2 different methods. So contextually, the best fit should
prevail.
Hi, I just found quite old posts about Valgrind and D. Can someone give
me a short update, what the state of support for D is and if there is
anythings special to take into account. Thanks a lot.
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. Münch wrote:
Hi, I just found quite old posts about Valgrind and D. Can
someone give me a short update, what the state of support for
D is and if there is anythings special to take
On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. Münch wrote:
Hi, I just found quite old posts about Valgrind and D. Can
someone give me a short update, what the state of support for D
is and if there is anythings special to take into account.
Thanks a lot.
The only special thing to take
On Monday, 20 April 2015 at 07:58:40 UTC, mzf wrote:
win 7 x86,3GB ram:
1. dmd 2.066 vibe-d-0.7.23, it's ok.
2. dmd 2.067 vibe-d-0.7.23,
show error msg out of memory
why?
http://forum.dlang.org/thread/mghqlf$10l2$1...@digitalmars.com#post-ybrtcxrcmrrsoaaksdbj:40forum.dlang.org
On 4/20/15 4:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
Perhaps, LocalTime should be changed so that it prints the time zone out
(and just make it so that the lack of time zone is read in as local time
rather than treating it that way in both directions), but that's not how it
works
On Monday, 20 April 2015 at 09:07:54 UTC, Chris wrote:
On Saturday, 18 April 2015 at 17:59:19 UTC, ketmar wrote:
On Sat, 18 Apr 2015 17:50:56 +, Chris wrote:
Doh! You're right! My bad. However, this makes the function
less
generic, but it doesn't matter here.
maybe `auto ref` can help
On Saturday, 18 April 2015 at 17:59:19 UTC, ketmar wrote:
On Sat, 18 Apr 2015 17:50:56 +, Chris wrote:
Doh! You're right! My bad. However, this makes the function
less
generic, but it doesn't matter here.
maybe `auto ref` can help here?
Yes, auto ref does the trick. I prefer it to
On Mon, 20 Apr 2015 10:14:25 +, Chris wrote:
string a = bla;
string b = blub;
auto res = doSomething(a, b);
If I didn't use auto ref or ref, string would get copied, wouldn't
it?
no, it wont -- not unless you'll append something to it. slicing arrays
(and string is array too) will
On Monday, 20 April 2015 at 09:58:06 UTC, Marc Schütz wrote:
On Monday, 20 April 2015 at 09:07:54 UTC, Chris wrote:
On Saturday, 18 April 2015 at 17:59:19 UTC, ketmar wrote:
On Sat, 18 Apr 2015 17:50:56 +, Chris wrote:
Doh! You're right! My bad. However, this makes the function
less
On Monday, 20 April 2015 at 10:27:00 UTC, anonymous wrote:
On Monday, 20 April 2015 at 10:14:27 UTC, Chris wrote:
string a = bla;
string b = blub;
auto res = doSomething(a, b);
If I didn't use auto ref or ref, string would get copied,
wouldn't it?
auto ref doSomething(R needle, R
On Sunday, 19 April 2015 at 23:49:08 UTC, anonymous wrote:
On Sunday, 19 April 2015 at 21:42:23 UTC, Ulrich Küttler wrote:
groupBy is a nice example as it laboriously adds reference
semantics to forward ranges but assumes input ranges to posses
reference semantics by themselves.
All ranges
win 7 x86,3GB ram:
1. dmd 2.066 vibe-d-0.7.23, it's ok.
2. dmd 2.067 vibe-d-0.7.23,
show error msg out of memory
why?
On Monday, 20 April 2015 at 10:14:27 UTC, Chris wrote:
string a = bla;
string b = blub;
auto res = doSomething(a, b);
If I didn't use auto ref or ref, string would get copied,
wouldn't it?
auto ref doSomething(R needle, R haystack);
To avoid this, I would have to write a[0..$], b[0..$],
I need current system time ISO string with timezone offset. For
example
2015-04-20T11:00:44.735441+03:00
but Clock.currTime.toISOExtString doesn't write offset:
2015-04-20T11:00:44.735441+03:00
I found workaround, but it looks redundant and needs memory
allocation:
auto t = Clock.currTime;
On Monday, April 20, 2015 08:10:40 Jack Applegame via Digitalmars-d-learn wrote:
I need current system time ISO string with timezone offset. For
example
2015-04-20T11:00:44.735441+03:00
but Clock.currTime.toISOExtString doesn't write offset:
2015-04-20T11:00:44.735441+03:00
I found
On Sunday, 19 April 2015 at 21:26:11 UTC, Vladimir Panteleev
wrote:
On Sunday, 19 April 2015 at 16:20:23 UTC, Gary Willoughby wrote:
If i pass the correct information on the command line it gets
past the library errors but now shows linker errors.
I'm not seeing the compilation errors when
On Monday, 20 April 2015 at 10:42:54 UTC, Chris wrote:
On Monday, 20 April 2015 at 10:27:00 UTC, anonymous wrote:
On Monday, 20 April 2015 at 10:14:27 UTC, Chris wrote:
string a = bla;
string b = blub;
auto res = doSomething(a, b);
If I didn't use auto ref or ref, string would get copied,
On 2015-04-20 12:42, Gary Willoughby wrote:
Great thanks that cured the linking problem but there are still more
errors during the build. I'm giving up for now as i only need the html
but it's disappointing that it's so broken.
Are your clones of DMD, druntime and Phobos up to date and clean?
On Thursday, 16 April 2015 at 18:12:35 UTC, Nordlöw wrote:
Is there a way to CT-query the arity of all opIndex and opSlice
overloads?
Ideally you don't want to have to do that. You'd have to consider
alias this and inheritance.
On Mon, 20 Apr 2015 13:31:03 +, Nordlöw wrote:
On Thursday, 16 April 2015 at 18:12:35 UTC, Nordlöw wrote:
Is there a way to CT-query the arity of all opIndex and opSlice
overloads?
Ping.
as long as they aren't templates, you can use any function traits on 'em.
like
John Colvin:
struct LineStyle
{
enum NONE = None;
enum SOLID = Solid;
enum DASH = Dash;
enum DOT = Dot;
enum DASHDOT = Dash Dot;
enum DASHDOTDOT = Dash Dot Dot;
string label;
private this(string label)
{
this.label = label;
}
}
The constructor
On Monday, 20 April 2015 at 17:02:18 UTC, CodeSun wrote:
I have test a snippet of code, and I encountered with a weird
link error.
The following is the demo:
import std.stdio;
interface Ti {
T get(T)(int num);
T get(T)(string str);
}
class Test : Ti {
T get(T)(int num)
On Mon, 2015-04-20 at 17:28 +, John Colvin via Digitalmars-d-learn wrote:
[…]
True, the constructor doesn't really add anything here.
To be honest, the combination of enumeration and runtime
variables in the Java code seems like a rubbish design, but
perhaps there's a good reason
On 4/20/15 11:28 AM, Mike James wrote:
Here is a fragment of Java code from an SWT program...
public enum LineStyle {
NONE(None),
SOLID(Solid),
DASH(Dash),
DOT(Dot),
DASHDOT(Dash Dot),
DASHDOTDOT(Dash Dot Dot);
public final String label;
private
On Monday, 20 April 2015 at 17:24:30 UTC, bearophile wrote:
John Colvin:
struct LineStyle
{
enum NONE = None;
enum SOLID = Solid;
enum DASH = Dash;
enum DOT = Dot;
enum DASHDOT = Dash Dot;
enum DASHDOTDOT = Dash Dot Dot;
string label;
private this(string label)
{
On Monday, 20 April 2015 at 16:58:18 UTC, Robert M. Münch wrote:
On 2015-04-20 13:29:57 +, John Colvin said:
On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. Münch
wrote:
Hi, I just found quite old posts about Valgrind and D.
On Mon, 20 Apr 2015 20:14:34 +0200, Robert M. Münch wrote:
Hi, is there anything for D that supports generating tags files like
ctags does for C etc. ?
Dscanner: https://github.com/Hackerpilot/Dscanner#ctags-output
Here is a fragment of Java code from an SWT program...
public enum LineStyle {
NONE(None),
SOLID(Solid),
DASH(Dash),
DOT(Dot),
DASHDOT(Dash Dot),
DASHDOTDOT(Dash Dot Dot);
public final String label;
private LineStyle(String label) {
this.label = label;
On Monday, 20 April 2015 at 17:28:27 UTC, John Colvin wrote:
On Monday, 20 April 2015 at 17:24:30 UTC, bearophile wrote:
John Colvin:
struct LineStyle
{
enum NONE = None;
enum SOLID = Solid;
enum DASH = Dash;
enum DOT = Dot;
enum DASHDOT = Dash Dot;
enum DASHDOTDOT = Dash Dot Dot;
On Monday, 20 April 2015 at 17:02:18 UTC, CodeSun wrote:
And where I can find the D symbol definition, because
information like ‘_D2tt2Ti12__T3getTAyaZ3getMFAyaZAya’ makes me
really confused.
---
import std.demangle;
auto friendlySymbol =
demangle(_D2tt2Ti12__T3getTAyaZ3getMFAyaZAya);
---
Hi, is there anything for D that supports generating tags files like
ctags does for C etc. ?
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
On 2015-04-20 13:29:57 +, John Colvin said:
On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. Münch wrote:
Hi, I just found quite old posts about Valgrind and D. Can someone give
me a short update, what the state of support
On Monday, 20 April 2015 at 17:02:18 UTC, CodeSun wrote:
So does it mean I can't declare function template inside
interface?
You can, but they are considered final so a body is required to
use them - they aren't just a pointer to the derived
implementation.
Yes, it's a lot better but I did not get to concatenate the
string ;; in each paragraph:
-
import std.conv, std.stdio, std.range, std.string;
void main() {
auto a = iota(10, 1101).text;
a = a[1 .. $ - 1], a ~= '.';
writeln(wrap(a, 30));
}
-
I have test a snippet of code, and I encountered with a weird
link error.
The following is the demo:
import std.stdio;
interface Ti {
T get(T)(int num);
T get(T)(string str);
}
class Test : Ti {
T get(T)(int num) {
writeln(ok);
}
T
On Monday, 20 April 2015 at 15:28:04 UTC, Mike James wrote:
Here is a fragment of Java code from an SWT program...
public enum LineStyle {
NONE(None),
SOLID(Solid),
DASH(Dash),
DOT(Dot),
DASHDOT(Dash Dot),
DASHDOTDOT(Dash Dot Dot);
public final String label;
On Monday, April 20, 2015 18:35:34 dvic via Digitalmars-d-learn wrote:
Hi guys,
It seems it's possible to define different read properties, only
differing by the return type.
Not possible. Just like pretty much any C-derived language (C++, Java, C#,
etc.) the return type of a function is not
On 04/20/2015 11:35 AM, dvic wrote:
@property string value() { return m_value; } // m_value is a string
@property int value() { return to!int(m_value); }
Yes, as Jonathan M Davis said, that's weird.
But when using it in writefln() or assert for example, compiler (dmd)
complains
about 2
Hi guys,
It seems it's possible to define different read properties, only
differing by the return type.
Ex:
@property string value() { return m_value; } // m_value is a
string
@property int value() { return to!int(m_value); }
But when using it in writefln() or assert for example, compiler
On Sunday, 19 April 2015 at 21:17:18 UTC, Ali Çehreli wrote:
On 04/19/2015 09:04 AM, Namespace wrote:
Is it somehow possible to reuse the memory of an object?
Yes, when you cast a class variable to void*, you get the
address of the object.
@nogc
T emplace(T, Args...)(ref T obj, auto ref
On Monday, 20 April 2015 at 18:50:31 UTC, Jonathan M Davis wrote:
On Monday, April 20, 2015 18:35:34 dvic via Digitalmars-d-learn
wrote:
Hi guys,
It seems it's possible to define different read properties,
only
differing by the return type.
Not possible. Just like pretty much any C-derived
On 4/20/15 2:50 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Monday, April 20, 2015 18:35:34 dvic via Digitalmars-d-learn wrote:
Why is the compiler not complaining about defining 2 read
properties and it does
otherwise when using both of them?
Now, that is weird. I would fully
On Monday, 20 April 2015 at 18:14:34 UTC, Robert M. Münch wrote:
Hi, is there anything for D that supports generating tags files
like ctags does for C etc. ?
I and some others have merged D support into the following fork
of exuberant-ctags:
https://github.com/fishman/ctags
This is the
Thanks. The bug is created.
https://issues.dlang.org/show_bug.cgi?id=14469
On Saturday, 18 April 2015 at 21:11:28 UTC, HaraldZealot wrote:
On Saturday, 18 April 2015 at 20:42:09 UTC, Ali Çehreli wrote:
On 04/18/2015 01:30 PM, HaraldZealot wrote:
Is it possible iterate over enum (preferable in compile time)
or at
least check that particular value belong to enum?
68 matches
Mail list logo