Yigal Chripun wrote:
On 10/10/2009 00:36, Christopher Wright wrote:
Yigal Chripun wrote:
On 09/10/2009 00:38, Christopher Wright wrote:
It makes macros highly compiler-specific, or requires the compiler's
AST
to be part of the language.
Nemerle took the nuclear option, and its macros
Yigal Chripun wrote:
On 09/10/2009 00:38, Christopher Wright wrote:
It makes macros highly compiler-specific, or requires the compiler's AST
to be part of the language.
Nemerle took the nuclear option, and its macros are all-powerful. That's
a reasonable way of doing things. I'd be happy
Bill Baxter wrote:
It seems macros are implemented as compiler extensions. You compile
your macros into DLLs first, that then get loaded into the compiler as
plugins. On the plus side, doing things that way you really do have
access to any API you need at compile-time, using the same syntax as
Max Samukha wrote:
Is it possible to get types or aliases of all constructors of a class
in D2?
No.
__traits has some random functionality in this regard. It has a command
getVirtualFunctions which only returns virtual overloads. By virtual,
we mean appears in vtbl. So any non-private,
Justin Johansson wrote:
Jarrett Billingsley Wrote:
On Thu, Oct 8, 2009 at 8:10 PM, Justin Johansson n...@spam.com wrote:
I almost have to apologize for this question but ..
How does one initialize a static rectangular array (2-d matrix) in D1?
None of the following or other variations that
BCS wrote:
Hello Michal,
If one has a template instance, is it possible to get template name
and parameter type that was used for instantiating, at compile time?
consider:
class List (T) {}
List!(int) lst;
Foo (lst);
I want to create such template Foo which prints:
List!(int)
List
int
You
Saaa wrote:
I did get it to compile at one time, but didn't know how to use it,
like your code..
index( array, index2); //compiles and all, but how do I set the value?
index( array, index2) = -1; // doesn't work
If you're using d2, add 'ref' to the return type.
Otherwise, you need
Robert Fraser wrote:
Hi all,
Quick question: I want to use some unicode identifiers, but I get
unsupported char 0xe2, both with using and not using a BOM. The
characters in question are the superset/subset-equals operators: ⊇ and
⊆... Perhaps these are just unsupported by DMD (in which case,
Ary Borenszweig wrote:
When I compile this code I get stack overflow printed in the console.
Anyone know why?
---
int fact(int X)() {
if(X == 0) {
return 1;
} else {
int temp = fact!(X - 1)();
return X * temp;
}
}
const someVar = fact!(0)();
---
Like
BCS wrote:
Hello reimi,
i have 2 question here:
1) can anyone suggest good html parser with d binding?
IIRC ANTLR can generate D
The last supported version was 2.7.something. It depends on phobos,
possibly a rather old version of it (I don't know).
Fractal wrote:
Hello
Any body can explan me how to determine if a template argument is an array?
Thanks
Have a look at std.traits or tango.core.Traits. The appropriate way to
check is via the templates they define, since it's clearer. Looking at
the source will tell you how to replicate
Frits van Bommel wrote:
Nick Sabalausky wrote:
Can anyone think of a reasonable case where it would actually make
sense to override opCmp, but not opEquals? (that is, without
bastardizing them like in a C++ streams kind of way)
How about a struct you want to be opCmp()-comparable (which,
Lionello Lunesu wrote:
I like shared/const/immutable as much as the next guy, but there are now
2x2x3=12 ways to decorate a variable. Furthermore, by either declaring
the variable globally or locally (stack), we end up with 24 possible
declaration. See the code at the end of this post.
The
Lionello Lunesu wrote:
Christopher Wright dhase...@gmail.com wrote in message
news:gugs7b$70...@digitalmars.com...
Lionello Lunesu wrote:
I like shared/const/immutable as much as the next guy, but there are
now 2x2x3=12 ways to decorate a variable. Furthermore, by either
declaring
Saaa wrote:
Christopher Wright dhase...@gmail.com wrote in message
news:gu8v1b$1ut...@digitalmars.com...
Saaa wrote:
How do I return a variant type in D1?
After assessing that a variadic argument is an array, how do I check its
depth?
How do I set the variable given to me through
Tyro[a.c.edwards] wrote:
http://www.digitalmars.com/d/2.0/phobos/std_random.html#uniform
Above documentation provides the following example:
Random gen(unpredictableSeed);
// Generate an integer in [0, 1023]
auto a = uniform(0, 1024, gen);
// Generate a float in [0, 1)
Saaa wrote:
My first stab at the get function.
As you might see, I need help :D
Thanks!
How do I make the function take a variadic argument and get its type?
void get(in char[][] file, in char[] identifier, ...)
{
TypeInfo type = _arguments[0];
void* var = _argptr;
//
BCS wrote:
I find my self in need of a line drawing package. I need to pop a window
and draw lines and points. Text would be nice but I can live without it.
Most importantly, I need something that is dirt simple to get running. I
don't have time to dink around with libs (if I did have time I'd
Saaa wrote:
If the JSON writer won't write every item (which will be thousands of items)
on a new line and reading in multi arrays, then I think I need to witch to
Tango :D
Tango's JSON printer has options for pretty-printing and condensed
printing. The default is condensed; everything will
Saaa wrote:
Christopher Wright dhase...@gmail.com wrote in message
news:gtb02h$e4...@digitalmars.com...
Saaa wrote:
If the JSON writer won't write every item (which will be thousands of
items)
on a new line and reading in multi arrays, then I think I need to witch
to Tango :D
Tango's JSON
Frank Benoit wrote:
OPTLINK (R) for Win32 Release 8.00.1
Copyright (C) Digital Mars 1989-2004 All rights reserved.
C:\Project\dwtinst\dwt-rcp\lib\org.eclipse.core.databinding.lib(AbstractObservableList)
Offset F0567H Record
Type 00C3
Error 1: Previous Definition Different :
Qian Xu wrote:
Hi All,
We are redesigning a system (previously was written in C) using D.
We use Boundary-Controll-Entity-Pattern.
To wrap db table to entities is a very time consuming work.
Is there any framework or tips for multi-tier applications in D?
--Qian
At times like this, I think
grauzone wrote:
PS: another thing that possibly would bring a speed gain would be to
make dsss compile the whole project in one run, instead of invoking a
new dmd process for each source file. How do I need to change the
rebuild configuration to achieve this?
oneatatime = [yes|no]
You want
Georg Wrede wrote:
When creating templates, it is sometimes handy to print the type of
something. Is there a trivial way to print it?
writeln(Typeof T is: , typeof(t));
This doesn't work, but you get the idea.
For a class or interface:
writeln(Typeof T is: , t.classinfo.name);
TSalm wrote:
Le Sun, 01 Mar 2009 03:07:16 +0100, Christopher Wright
dhase...@gmail.com a écrit:
TSalm wrote:
Does something have an idea on how to do something like this ?
You don't. Templates cannot participate in polymorphism. I've dealt
with this in the past and ended up making another
downs wrote:
BCS wrote:
Reply to Jarrett,
On Fri, Feb 27, 2009 at 9:01 AM, Qian Xu quian...@stud.tu-ilmenau.de
wrote:
Hi All,
Is there any way to keep program alive, when an AV takes place?
It's possible on Windows in D, but that's because Windows reports
segfaults with the same
zvia wrote:
Is it true thr input way? what is din type (I didn't put its a declaration)??
Thrinput's Way was discredited in the late 1700's by a German theologian
named Albrecht Kirsch. It was already in decline due to its requirements
of extreme asceticism; many scholars, most notably Dr.
Mike L. wrote:
If the compiler can tell that B!(int) is a type, why can't it tell that it is a
child class of A!(int) ?
This is a bug. In template specializations, : means equality. In static
if, : means convertibility.
So, you can use:
template ADefaults(Type, AType)
{
static
Christopher Wright wrote:
Mike L. wrote:
If the compiler can tell that B!(int) is a type, why can't it tell
that it is a child class of A!(int) ?
This is a bug. In template specializations, : means equality. In static
if, : means convertibility.
This is only with template specializations
Denis Koroskin wrote:
On Sun, 25 Jan 2009 08:38:18 +0300, Tim M a...@b.com wrote:
class B : A,I
{
void foo() { A.foo(); }
}
void main()
{
}
It is too verbose and makes twice an overhead. I'd like to avoid this
solution.
Any reasonable compiler would inline the call to A.foo.
In
Check this out!
class Foo { int someField; }
pragma (msg, Foo.tupleof[0].stringof); // int
pragma (msg, Foo.tupleof[0].mangleof); // someField
Why is this? It's counterintuitive.
Christopher Wright wrote:
Christopher Wright wrote:
Check this out!
class Foo { int someField; }
pragma (msg, Foo.tupleof[0].stringof); // int
pragma (msg, Foo.tupleof[0].mangleof); // someField
Why is this? It's counterintuitive.
Oops, no. mangleof does report the mangled name of the input
Christopher Wright wrote:
Check this out!
class Foo { int someField; }
pragma (msg, Foo.tupleof[0].stringof); // int
pragma (msg, Foo.tupleof[0].mangleof); // someField
Why is this? It's counterintuitive.
Okay, no, this example is a shorter version of something else that
exemplified
Sergey Gromov wrote:
Comment out the traits and it compiles. Traits are supposed to be
compile-time. How's that possible for them to prevent compile-time
evaluation?
It's the amazing powers of the DMD CTFE engine! And it's why I don't use
d2 these days.
I think I'll dust off some old code
Jarrett Billingsley wrote:
On Tue, Jan 20, 2009 at 10:29 AM, Trass3r mrmoc...@gmx.de wrote:
It seems like there is no way to automatically get the class methods in D1
currently?!
__traits isn't supported, std.traits doesn't give anything usable, .tupleof
only gets the fields (plus only giving
Jason House wrote:
Silvio Ricardo Cordeiro wrote:
Is there any good reason why the following code doesn't work?
The function foo requires as its argument a delegate that
receives a B. This means that, because of the type soundness
of the D language, the delegate will only be called with
Rainer Deyke wrote:
Christopher Wright wrote:
You can create a COW array struct pretty easily. However, this will be
pretty slow in a lot of cases.
A built-in COW type does not need to be slow! The compiler can use
static analysis to eliminate unnecessary copies, and reference counting
can
Charles Hixson wrote:
A) Yes, it works the way that you say. This damages it's utility.
B) I'm replying to a question as to how typedef could reasonably be
extended.
The point of a typedef is to provide additional type safety. This would
not exist if you could implicitly cast back and
Zoran Isailovski wrote:
Oh... I've got the wrong impression from the papers about D. (But then, why
would someone design an *unsafe* language *by intention*??? For that, we've got
C and C++, don't we?)
Anyway, I've been looking for a modern and *safe* language, but without the
overkill of a
The Anh Tran wrote:
static double[N] dd = void;
dd is not a compile-time constant.
static auto tmp = f!(N).fn(dd);
The initializer of tmp must be a compile-time constant, but since dd is
not a compile-time constant, you can't use CTFE on fn.
Daniel White wrote:
That would be a bad idea. Then how would you do manual memory
management in the few cases that absolutely require it?
Two ways. Either:
a: being able to lock the variable so that the garbage collector
can't touch it until you unlock it.
If you have a reference to the
Kagamin wrote:
Hoenir Wrote:
Lutger schrieb:
There are a few changes that need to be done when porting code from D1 to
D2. It may be helpful to find out what those are at an early stage and
program your applications with these in mind. That will help when D2 is
more stabilized and you want to
Hey all,
How do I get environment variables in a D program? I specifically want
the path to a user's home folder.
Ta muchly.
Saaa wrote:
from the list (private, protected, public) pick public.
Note the difference between peel and peal.
:)
public YellowBanana: Banana
{
void doStuff()
{
bool e = peel(); //visible from derived
//class when defined protected or public.
}
}
Banana a =
Jarrett Billingsley wrote:
On Sun, Nov 9, 2008 at 10:18 PM, James [EMAIL PROTECTED] wrote:
i created to include file, 1 with 'module xxx' declaration and the other
without it. but i still can import both files. what is the diff here?
Not a lot. The module declaration doesn't serve much
45 matches
Mail list logo