On Mon, 24 Nov 2014 06:56:08 +
Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Hi,
in following example the @property method needs the ()
otherwise compiler error for row 24 is thrown.
I cannot judge, whether the compiler behaves correct or not.
Kind regards
On Monday, 24 November 2014 at 08:35:08 UTC, ketmar via
Digitalmars-d-learn wrote:
On Mon, 24 Nov 2014 06:56:08 +
Andre via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Hi,
in following example the @property method needs the ()
otherwise compiler error for row 24 is
Is there any way to set separator? For example I want use '/' or
':'?
And could anybody explain me how the cast is work. How to
understand which types to which may be casted?
On Monday, November 24, 2014 10:33:16 Suliman via Digitalmars-d-learn wrote:
Is there any way to set separator? For example I want use '/' or
':'?
No. toISOString and toISOExtString support the ISO and Extended ISO formats
from the ISO standard, and std.datetime does not currently support
On Monday, November 24, 2014 10:38:55 Suliman via Digitalmars-d-learn wrote:
And could anybody explain me how the cast is work. How to
understand which types to which may be casted?
Look at the documentation for opCast. That's how the casting is done. But
what it comes down to is
SysTime -
Thanks a lot for the info.
Kind regards
André
On Monday, 24 November 2014 at 09:26:16 UTC, Marc Schütz wrote:
On Monday, 24 November 2014 at 08:35:08 UTC, ketmar via
Digitalmars-d-learn wrote:
a known thing. not sure if this is a known *bug* (seems that
almost
nobody cares). compiler is
what range/algorithm allows me to make projections from one
sequence to another?
that is, in C#, this is the Select method
(http://msdn.microsoft.com/en-us/library/vstudio/bb548891%28v=vs.100%29.aspx)
example in C#:
class ProjectionWanted
{
public int field1 { get; set; }
public int
Ramon:
example in C#:
class ProjectionWanted
{
public int field1 { get; set; }
public int field2 { get; set; }
public int field3 { get; set; }
}
void Foo(ListProjectionWanted list)
{
var list_projected = list.Select(l = new { l.field1,
l.field2 });
// list_projected elements now
What is the difference between lazy and eager ranges?
(I guess, the lazy one has not yet queried the elements)
On Monday, 24 November 2014 at 15:44:02 UTC, Ramon wrote:
What is the difference between lazy and eager ranges?
(I guess, the lazy one has not yet queried the elements)
The lazy returns a range that once iterated gives the results one
at a time (so the function allocates no heap memory).
I can't understand why foreach loop produce every line by line,
while it's fuctional analog print lines on one string:
foreach(f; file.byLine())
{
writeln(f);
}
auto file = File(foo.txt,r);
file
.byLine()
.writeln;
file content:
-
first sring
second string
-
On Mon, 24 Nov 2014 19:04:34 +
Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I can't understand why foreach loop produce every line by line,
while it's fuctional analog print lines on one string:
the two samples are not the same, they doing completely different
On 11/24/2014 11:04 AM, Suliman wrote:
I can't understand why foreach loop produce every line by line, while
it's fuctional analog print lines on one string:
foreach(f; file.byLine())
{
writeln(f);
f is a char[] and writeln prints all strings as their contents i.e.
first string is
On 11/24/2014 11:30 AM, ketmar via Digitalmars-d-learn wrote:
File.byLine returns *output* *range*.
Although the range is used for outputting, it is still an InputRange. :)
Ali
On Mon, 24 Nov 2014 11:41:43 -0800
Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On 11/24/2014 11:30 AM, ketmar via Digitalmars-d-learn wrote:
File.byLine returns *output* *range*.
Although the range is used for outputting, it is still an InputRange. :)
ah,
On Monday, 24 November 2014 at 20:23:57 UTC, Suliman wrote:
thanks! But how I can skip first line?
My varian:
auto lines = foo.txt.File
.byLine
.filter!(f=f[0] != f[0]);
With 'drop' from std.range:
auto lines = foo.txt.File
.byLine
Thanks! But is there any way to do it with std.algorithm?
Can be skipOver used for it?
Hi all,
I'm playing a bit with D and SDL using DerelictOrg on debian 6.
I've installed SDL2, SDL_mixer2 and the latest packages
DerelictUtil and DerelictSDL2.
I can display some stuffs and interact with the keys.
Now I'm trying to add music and sounds but each time I try to
access a function
@safe
class Y { }
@safe
class X { }
@safe
class Z
{
int x;
this()
{
if (typeid(X) == typeid(Y)) x = 1; // Compile Error
else x = 2;
}
}
void main() { new Z; }
// test.d(19): Error: safe function 'test.Z.this'
// cannot call system function 'object.opEquals'
An enumeration contains a small number of distinct elements:
enum Colors { red, green, yellow, brown }
While an integral numeric value encodes a scalar:
uint x;
x = 120;
x++;
A sufficiently common pattern in my code is to have something
intermediate: that has a small group of special
In some D programs I'm using this coding pattern:
struct Foo {
// Instance fields here.
@disable this();
this(in string[] data) pure @safe
in {
// Many pre-conditions here.
} out(result) {
// Some post-conditions here.
} body {
// ...
}
On Monday, 24 November 2014 at 21:19:40 UTC, torea wrote:
Hi all,
I'm playing a bit with D and SDL using DerelictOrg on debian 6.
I've installed SDL2, SDL_mixer2 and the latest packages
DerelictUtil and DerelictSDL2.
I can display some stuffs and interact with the keys.
Now I'm trying to add
On Monday, 24 November 2014 at 23:27:58 UTC, Jack wrote:
It's a common error but did you load the Mixer and SDL
libraries?
DerelictSDL2Mixer.load();
DerelictSDL2.load();
And some code or output from gdb would be most helpful.
Oh.. I didn't know about the DerelictSDL2Mixer.load()!
I thought
On Monday, November 24, 2014 22:12:08 Eric via Digitalmars-d-learn wrote:
@safe
class Y { }
@safe
class X { }
@safe
class Z
{
int x;
this()
{
if (typeid(X) == typeid(Y)) x = 1; // Compile Error
else x = 2;
}
}
void main() { new Z; }
//
On Tuesday, 25 November 2014 at 02:48:43 UTC, Jonathan M Davis
via Digitalmars-d-learn wrote:
On Monday, November 24, 2014 22:12:08 Eric via
Digitalmars-d-learn wrote:
@safe
class Y { }
@safe
class X { }
@safe
class Z
{
int x;
this()
{
if (typeid(X) == typeid(Y)) x =
On Tuesday, 25 November 2014 at 03:42:50 UTC, Eric wrote:
I'm finding it really hard to write robust classes in D
due to all the problems with Object.
I wish Object didn't have any methods. One thing I do is kinda
act as if it didn't and make my own interfaces instead.
27 matches
Mail list logo