On 09/13/2014 05:34 PM, WhatMeWorry wrote:
aren't all strings literals?
Literals are values that are typed as is in source code:
http://en.wikipedia.org/wiki/Literal_%28computer_programming%29
Ali
On Sun, 14 Sep 2014 00:34:54 +
WhatMeWorry via Digitalmars-d-learn
wrote:
> So is one form (Empty strings versus null strings) considered
> better than the other? Or does it depend on the context?
one is better than another in the sense that blue is better than green
(or vice versa). ;-)
d
On Saturday, 13 September 2014 at 23:22:40 UTC, ketmar via
Digitalmars-d-learn wrote:
On Sat, 13 Sep 2014 22:41:38 +
AsmMan via Digitalmars-d-learn
wrote:
D string are actullay C-strings?
in no way. only string *LITERALS* are zero-terminated.
Ok. So I wrote the following:
char c = *(
On Saturday, 13 September 2014 at 22:41:39 UTC, AsmMan wrote:
D string are actullay C-strings?
No. But string *literals* are guaranteed to be 0-terminated for
easier interoperability with C code.
David
On Sat, 13 Sep 2014 22:41:38 +
AsmMan via Digitalmars-d-learn
wrote:
> D string are actullay C-strings?
in no way. only string *LITERALS* are zero-terminated.
signature.asc
Description: PGP signature
On Saturday, 13 September 2014 at 17:31:18 UTC, ketmar via
Digitalmars-d-learn wrote:
On Sat, 13 Sep 2014 17:09:56 +
WhatMeWorry via Digitalmars-d-learn
wrote:
I guess I was expecting them to be equivalent. I can
understand why both lengths are zero. But what is
emptyStr.ptr doing wit
On Sat, 13 Sep 2014 17:09:56 +
WhatMeWorry via Digitalmars-d-learn
wrote:
> I guess I was expecting them to be equivalent. I can understand
> why both lengths are zero. But what is emptyStr.ptr doing with
> the 42F080 value? I presume this is a address? If so, what does
> this address c
The name string is aliased to immutable(char)[]
Why was immutable chosen? Why not mutable. Or why not just make
another alias called
strung where it is aliased to mutable(char)[]
Also, since strings are arrays and arrays are structs with a
length and ptr
field, I ran the following code for
Hi!
struct Vector (T)
{
T[]arr;
T[] opSlice() { return arr; }
}
Vector!double v;
double[] d;
v[][] = d[] + d[];
//first [] call opSlise, second [] for array syntax
Best Regards,
Ilya
Thanks for your suggestion. It's not as attractive though, it
would be the same as v.arr[] =
On Saturday, 13 September 2014 at 08:09:15 UTC, Mike Parker wrote:
On 9/13/2014 7:44 AM, WhatMeWorry wrote:
// the following two lines compile cleanly but when executed,
I get
// D:\Projects\Derelict>02_SimpleOpenGL_3_3_program.exe
// object.Error: Access Violation
//
string
Operations like "ar1[] op= ar2[] op ar3[]" is only for arrays.
There is no operator overloading for this staff.
On Saturday, 13 September 2014 at 14:18:57 UTC, deed wrote:
struct Vector (T)
{
T[]arr;
void opSliceAssign (T[] a) { arr[] = a[]; }
}
unittest
{
auto v = Vector!double([1, 2]);
double[] d1 = [11, 12];
double[] d2 = [21, 22];
double[] d3 = new double[](2);
d3[] = d1[] + d2[];
asser
No, vibe provides synchronous non-blocking interface similar to
async/await.
struct Vector (T)
{
T[]arr;
void opSliceAssign (T[] a) { arr[] = a[]; }
}
unittest
{
auto v = Vector!double([1, 2]);
double[] d1 = [11, 12];
double[] d2 = [21, 22];
double[] d3 = new double[](2);
d3[] = d1[] + d2[];
assert (d3 == [11.+21., 12.+22.]);
assert (is(typeof(d1[] + d2[]
Consider the following code:
alias Sink = scope void delegate(const(char)[]);
private template generateAliases(int __i, __vars...) {
import std.conv : to;
static if(__i < __vars.length)
enum generateAliases = "alias " ~
__vars[__i].stringof ~ " =
Marc Schütz:
"Functions declared as abstract can still have function bodies.
This is so that even though they must be overridden, they can
still provide ‘base class functionality.’"
=> it's intentional
But also they can not have.
I don't think it's intentional. I think it's a temporary
lim
On Saturday, 13 September 2014 at 07:32:23 UTC, Marc Schütz wrote:
On Saturday, 13 September 2014 at 05:07:32 UTC, Trey Brisbane
wrote:
Hey all,
I have a class method defined like so:
abstract class MyClass {
public:
@property
abstract SomeClassType getField() pure nothrow
On Saturday, 13 September 2014 at 07:32:23 UTC, Marc Schütz wrote:
I thought it was an error, but then I found this in the
documentation:
http://dlang.org/attribute.html#abstract
"Functions declared as abstract can still have function bodies.
This is so that even though they must be overridde
On 9/13/2014 7:44 AM, WhatMeWorry wrote:
// the following two lines compile cleanly but when executed, I get
// D:\Projects\Derelict>02_SimpleOpenGL_3_3_program.exe
// object.Error: Access Violation
//
string glShadingLangVer =
to!string(glGetString(GL_SHADING_LANGUAGE_VERSION)
On Saturday, 13 September 2014 at 05:07:32 UTC, Trey Brisbane
wrote:
Hey all,
I have a class method defined like so:
abstract class MyClass {
public:
@property
abstract SomeClassType getField() pure nothrow
out(result) {
assert(result !is null, "Error: ge
20 matches
Mail list logo