On Wednesday 23 February 2011 22:41:53 Christopher Bergqvist wrote:
> Hi!
>
> I've run into an issue which I don't understand.
>
> Boiled down code:
> import std.regex;
>
> void main()
> {
>//string str = "sdf"; // works
>//const string str = "sdf"; // doesn't work
>immut
Hi!
I've run into an issue which I don't understand.
Boiled down code:
import std.regex;
void main()
{
//string str = "sdf"; // works
//const string str = "sdf"; // doesn't work
immutable str = "sdf"; // doesn't work
auto pat = regex(", *");
auto split = splitt
bearophile,
You do have a point there, and I actually expected that response.
I would have posted my attempt at implementation, but am unable to
transfer info between the computer I'm typing this message on and
the one I'm programming on at the moment.
I have no problems converting small problems
Oops, I mean, yields :S
El 24/02/2011 02:48, Tom escribió:
Hi, how can I create an empty element with current D2 std.xml Element
implementation?
stdout.writeln(new Element("foo")); // Shields instead of
Thanks in advance,
Tom;
Hi, how can I create an empty element with current D2 std.xml Element
implementation?
stdout.writeln(new Element("foo")); // Shields instead of
Thanks in advance,
Tom;
One more thing:
If your lib files are relative to your current working directory, then
you can just pass them to DMD. E.g. if your lib file is under the
subdir folder of your current working dir you can just use:
dmd main.d subdir\mylibfile.lib
But maybe you knew that already.
See this:
http://www.digitalmars.com/ctg/ctgLinkSwitches.html#scanlib
You pass switches to the linker via -L, so the switch might be:
dmd -L/SCANLIB
Of course you would have to update the LIB environment variable in
command line, or via a batch file before calling DMD:
> set lib=C:\DirWithLibFil
Hey!
May be a silly situation but i'm trying to append a search path for
libraries from the command line. I'm running under win32 with
DMD/OPTLINK and i use a batch file for compilation of my project.
Adding the path to sc.ini won't help because the project' sources
might be moving around in diffe
%u:
> I am hoping that one of you experienced programmers out
> there could lend me a hand converting this small program to D.
If you show specific problems some people here will try to help. But I think
most people are not willing to translate a multi-module C++ program to D for
you. If you ar
I requested some assistance with operator overlaoding yesterday
and I really appreciate the assistance provided. However, trying
to incorporate the example just confused me a little more, it does
not meld well with the code I translated from the tutorial I am
reading. I am hoping that one of you ex
I've tested on Ubuntu it still errors out.
On 2/24/11, Jesse Phillips wrote:
> I believe it is because
>
> shapes.Circle["CoolCircle"] = 25;
Huh?
> perhaps a a defining:
>
> enmu shapes : const(int[string])
>
> would work?
Nope.
enumtwobug.d(10): Error: non-constant expression
["CoolCircle":cast(const(int))50]
>
> Anyway with DMD 2.052
Andrej Mitrovic Wrote:
> // Works
> enum : int[string]
> {
> Circle = ["CoolCircle":50]
> }
>
> // Error: non-constant expression ["CoolCircle":50]
> enum shapes : int[string]
> {
> Circle = ["CoolCircle":50]
> }
>
> I can't find this in bugzilla.
I believe it is because
shapes.Ci
// Works
enum : int[string]
{
Circle = ["CoolCircle":50]
}
// Error: non-constant expression ["CoolCircle":50]
enum shapes : int[string]
{
Circle = ["CoolCircle":50]
}
I can't find this in bugzilla.
Thaks to everyone for your assistance.
== Auszug aus Sequ (u...@example.net)'s Artikel
> Quoted from Nrgyzer:
> > On windows you've to create a folder called "lib"
> > before you run the command above - I currently
> > can't say it exactly if it's needed on linux, too.
> I did need to create a 'lib' directory before running 'make -
flin
On 23/02/2011 19:56, Jonathan M Davis wrote:
You can overload the cast operator in D:
T opCast(T)() {...}
but it's for explicit cast only. There is not currently any way to do implicit
casts with an overloaded operator. You have to use alias this for that, which
may or may not do what be
On 23.02.2011 21:48, Simon wrote:
On 23/02/2011 18:42, Simon wrote:
On 23/02/2011 14:37, Dmitry Olshansky wrote:
On 23.02.2011 17:08, %u wrote:
Hi everyone,
Was hoping someone could help me make sense of this bit of C++ code:
class canvas
{
operator HDC() { return _hdc; }
protected:
canvas(H
On Wednesday, February 23, 2011 10:42:04 Simon wrote:
> On 23/02/2011 14:37, Dmitry Olshansky wrote:
> > On 23.02.2011 17:08, %u wrote:
> >> Hi everyone,
> >>
> >> Was hoping someone could help me make sense of this bit of C++ code:
> >>
> >> class canvas
> >> {
> >> operator HDC() { return _hdc;
On 23/02/2011 18:42, Simon wrote:
On 23/02/2011 14:37, Dmitry Olshansky wrote:
On 23.02.2011 17:08, %u wrote:
Hi everyone,
Was hoping someone could help me make sense of this bit of C++ code:
class canvas
{
operator HDC() { return _hdc; }
protected:
canvas(HDC hdc): _hdc(hdc) {}
HDC _hdc;
}
On 23/02/2011 14:37, Dmitry Olshansky wrote:
On 23.02.2011 17:08, %u wrote:
Hi everyone,
Was hoping someone could help me make sense of this bit of C++ code:
class canvas
{
operator HDC() { return _hdc; }
protected:
canvas(HDC hdc): _hdc(hdc) {}
HDC _hdc;
}
From what I understand, HDC is an a
Funog:
> In the case of an associative array, is it possible to retrieve both the
> value and key type? (D1)
template AAKeyType(T) {
alias typeof(T.keys[0]) AAKeyType;
}
template AAValType(T) {
alias typeof(T.values[0]) AAValType;
}
Bye,
bearophile
On Wed, 23 Feb 2011 10:34:04 -0500, spir wrote:
Hello,
I have read several times that alias this is a way to implement
inheritance for structs.
I am simply unable to imagine how to use this feature that way. Has
anyone an example?
It allows *some* simulation of inheritance. However, it
Hello,
I have read several times that alias this is a way to implement inheritance for
structs.
I am simply unable to imagine how to use this feature that way. Has anyone an
example?
As I understand it, alias this constructs a proxy that delegates some or all of
of its behaviour to its 'alia
http://d.puremagic.com/issues/show_bug.cgi?id=4419
On 23.02.2011 17:08, %u wrote:
Hi everyone,
Was hoping someone could help me make sense of this bit of C++ code:
class canvas
{
operator HDC() { return _hdc; }
protected:
canvas(HDC hdc): _hdc(hdc) {}
HDC _hdc;
}
From what I understand, HDC is an alias for HANDLE in Windows. So
static if ( is(abc U : U[]) )
... aliases U to whatever abc is an array of.
In the case of an associative array, is it possible to retrieve both the
value and key type? (D1)
Hi everyone,
Was hoping someone could help me make sense of this bit of C++ code:
class canvas
{
operator HDC() { return _hdc; }
protected:
canvas(HDC hdc): _hdc(hdc) {}
HDC _hdc;
}
>From what I understand, HDC is an alias for HANDLE in Windows. So
they are overloading canvas such th
Jonathan M Davis:
> Okay, so you need to do popFrontN(s, n - 1).
Right, silly me :-) I need to read error messages.
> I'm too used to arrays which allow you to use that sort of syntax.
Me too.
Thank you,
bye,
bearophile
On Wednesday 23 February 2011 04:34:28 bearophile wrote:
> Jonathan M Davis:
> > Assuming that it's a forward range rather than an input range:
> >
> > auto s = range.save;
> > s.popFrontN(n - 1);
> > writeln(s.front);
>
> This program gives:
> test.d(5): Error: no property 'popFrontN' for type
>
Jonathan M Davis:
> Assuming that it's a forward range rather than an input range:
>
> auto s = range.save;
> s.popFrontN(n - 1);
> writeln(s.front);
This program gives:
test.d(5): Error: no property 'popFrontN' for type 'Recurrence!(fun,int,2u)'
import std.stdio, std.array, std.range;
void mai
Quoted from Nrgyzer:
> On windows you've to create a folder called "lib"
> before you run the command above - I currently
> can't say it exactly if it's needed on linux, too.
I did need to create a 'lib' directory before running 'make -flinux.mak DC=dmd'.
> After it compiled, you can copy all the
32 matches
Mail list logo