On Sunday, 2 February 2014 at 01:19:22 UTC, Matthew Dudley wrote:
This is the general outline of what I'm trying to do:
import std.typecons; //wrap
import std.stdio;
interface FooBar
{
public:
void foo();
void bar();
final void both() // NVI
{
On Sunday, 2 February 2014 at 01:19:22 UTC, Matthew Dudley wrote:
This is the general outline of what I'm trying to do:
import std.typecons; //wrap
import std.stdio;
interface FooBar
{
public:
void foo();
void bar();
final void both() // NVI
{
On Saturday, 1 February 2014 at 21:00:18 UTC, Nemanja Borić wrote:
Hello,
I am having troubles to use the enum defined in the separate
module.
When I try to access it, I am getting "Undefined symbol" error:
// CodeEnum.d
enum CodeEnum
{
OK = 200,
FAIL = 400
}
unittest
{
This is the general outline of what I'm trying to do:
import std.typecons; //wrap
import std.stdio;
interface FooBar
{
public:
void foo();
void bar();
final void both() // NVI
{
foo();
bar();
On Saturday, 1 February 2014 at 22:02:24 UTC, Russel Winder wrote:
My problem of the moment is segmentation faults during
execution, and I
have no model of how to go about providing useful data to debug
this :-((
It wouldn't by any chance be related to
https://bitbucket.org/ariovistus/pyd/i
On Saturday, 1 February 2014 at 22:52:24 UTC, Andrej Mitrovic
wrote:
On Saturday, 1 February 2014 at 22:47:54 UTC, deed wrote:
Docs also say:
/**
Note:
Each $(D front) will not persist after $(D
popFront) is called, so the caller must copy its contents (e.g.
by
calling $(D to!string)) if rete
On Saturday, 1 February 2014 at 22:59:12 UTC, bearophile wrote:
deed:
auto lines = File(filename).byLine.array;
writeln(lines); // Crap
---
Beside the answers that others have already given you, another
way to do that is to read the whole file (with read or
readText) and then use splitlines
On Saturday, 1 February 2014 at 22:52:24 UTC, Andrej Mitrovic
wrote:
On Saturday, 1 February 2014 at 22:47:54 UTC, deed wrote:
Docs say:
- std.stdio.byLine returns an input range
- std.array.array takes an input range
Docs also say:
/**
Note:
Each $(D front) will not persist after $(D
popFron
deed:
auto lines = File(filename).byLine.array;
writeln(lines); // Crap
---
Beside the answers that others have already given you, another
way to do that is to read the whole file (with read or readText)
and then use splitlines on the string.
Bye,
bearophile
On Saturday, 1 February 2014 at 22:47:54 UTC, deed wrote:
Docs say:
- std.stdio.byLine returns an input range
- std.array.array takes an input range
Docs also say:
/**
Note:
Each $(D front) will not persist after $(D
popFront) is called, so the caller must copy its contents (e.g. by
calling $(
---
import std.stdio;
import std.array;
auto lines = File(filename).byLine.array;
writeln(lines); // Crap
---
dmd 2.064(.2 I think)
Docs say:
- std.stdio.byLine returns an input range
- std.array.array takes an input range
Philippe Sigaud:
In D, do not use the same symbol for a module and one of its
inner symbols.
I have seen other people hit this problem (like problems caused
by having a "set.d" module containing a "Set" struct plus a "set"
helper function).
Is this worth warning against (with a dmd warning
On Sat, 2014-02-01 at 20:58 +, Ellery Newcomer wrote:
> On Sunday, 26 January 2014 at 14:17:18 UTC, Russel Winder wrote:
> > On Sun, 2014-01-26 at 12:11 +, Russel Winder wrote:
> > […]
> >> However with Python 2 the example from:
> >>
> >>https://bitbucket.org/ariovistus/pyd/wiki/Quick
On Sat, 01 Feb 2014 21:18:12 +, Martijn Pot wrote:
> I tried something similar to (check first answer):
> http://stackoverflow.com/questions/121162/what-does-the-explicit-
keyword-in-c-mean
>
> but I can't get it to work. But then again... I'm just starting with D.
>
> It seems not to be sup
On Sat, 01 Feb 2014 21:23:07 +, TheFlyingFiddle wrote:
> On Saturday, 1 February 2014 at 20:26:27 UTC, alexhairyman wrote:
>> Is there a way to implicitly convert *FROM* a base type? I have an
>> implicit conversion to a base type (float[2]) in a struct, but now I'd
>> like to be able to impli
On Saturday, 1 February 2014 at 20:26:27 UTC, alexhairyman wrote:
Is there a way to implicitly convert *FROM* a base type? I have
an implicit conversion to a base type (float[2]) in a struct,
but now I'd like to be able to implicitly convert from a base
type (in this case a float[2]) to a struc
I tried something similar to (check first answer):
http://stackoverflow.com/questions/121162/what-does-the-explicit-keyword-in-c-mean
but I can't get it to work. But then again... I'm just starting
with D.
It seems not to be supported:
http://forum.dlang.org/thread/teddgvbtmrxumffrh...@forum.d
> // Reply.d
> import CodeEnum;
>
> unittest
> {
> auto.e = CodeEnum.OK; // Error: undefined identifier 'OK'
> }
>
>
> What I am doing wrong?
The module and your enum have the same name. When the compiler sees
the `CodeEnum` symbol, it considers you're referring to the module.
This module
Hello,
I am having troubles to use the enum defined in the separate module.
When I try to access it, I am getting "Undefined symbol" error:
// CodeEnum.d
enum CodeEnum
{
OK = 200,
FAIL = 400
}
unittest
{
auto e = CodeEnum.OK; // Works!
}
// Reply.d
import CodeEnum;
On Sunday, 26 January 2014 at 14:17:18 UTC, Russel Winder wrote:
On Sun, 2014-01-26 at 12:11 +, Russel Winder wrote:
[…]
However with Python 2 the example from:
https://bitbucket.org/ariovistus/pyd/wiki/QuickStart
leads to:
This all sounds suspiciously like stuff I thought I'd alread
On Tuesday, 28 January 2014 at 22:50:27 UTC, Stanislav Blinov
wrote:
On Tuesday, 28 January 2014 at 22:35:31 UTC, Martin Cejp wrote:
I really wonder whether the rule could be relaxed a little
bit.
o_O How?
Not being a keyword except in places where it is used as such.
Only if it's not a k
Is there a way to implicitly convert *FROM* a base type? I have
an implicit conversion to a base type (float[2]) in a struct, but
now I'd like to be able to implicitly convert from a base type
(in this case a float[2]) to a struct.
Is this even allowed? Is it incorrect or unsafe? I'm still pre
On Saturday, 1 February 2014 at 19:26:03 UTC, TheFlyingFiddle
wrote:
On Friday, 31 January 2014 at 21:33:50 UTC, Mineko wrote:
So, I'm implementing some parallelism in my engine (maybe some
concurrency where appropriate later), and I'm having some
issues with thread safety, and synchronize ain'
On Friday, 31 January 2014 at 21:33:50 UTC, Mineko wrote:
So, I'm implementing some parallelism in my engine (maybe some
concurrency where appropriate later), and I'm having some
issues with thread safety, and synchronize ain't cutting it.
What I figure is that if I can get the IO class workin
On Tuesday, 28 January 2014 at 06:35:52 UTC, Dan Killebrew wrote:
Found this:
http://forum.dlang.org/thread/ntuysfcivhbphnhnn...@forum.dlang.org#post-mailman.1409.1339356130.24740.digitalmars-d-learn:40puremagic.com
If what Jonathan says is true, then
http://dlang.org/template-mixin.html shoul
thread_attachThis creates an instance of Thread class for the
main process thread during runtime initialization:
https://github.com/D-Programming-Language/druntime/blob/master/src/core/thread.d#L1792
oops, no, there's no malloc there.
But still it must be allocated somehow, probably GC is
substituted for C heap.
On Monday, 27 January 2014 at 09:44:50 UTC, Thejaswi Puthraya
wrote:
==11356== 16 bytes in 1 blocks are definitely lost in loss
record 1 of 2
==11356==at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==11356==by 0x43E366: thread_attachThis (in /home/theju/
28 matches
Mail list logo