On Wednesday, 6 November 2013 at 10:32:01 UTC, Namespace wrote:
On Wednesday, 6 November 2013 at 10:21:38 UTC, evilrat wrote:
On Wednesday, 6 November 2013 at 10:13:07 UTC, Namespace wrote:
Should I open a bug for this?
you should fix ur sc.ini first to use visual studio linker for
x64 and o
I'm trying to use BinaryHeap and i found out that i cannot use
foreach(). My question is, there is any other way to do it?, can
i iterate a BinaryHeap?
On Thursday, 7 November 2013 at 01:37:24 UTC, Shammah Chancellor
wrote:
How does one reflect on all the classes in a module?
__traits(allMembers, your_module)
There's two easy ways to get your_module: __traits(parent,
some_top_level_symbol0 or mixin("module.name.here");
allMembers gives a l
How does one reflect on all the classes in a module? I would like to
read their attributes and generate an enum from attributes on said
classes.
On Wednesday, 6 November 2013 at 12:19:26 UTC, Timon Gehr wrote:
How about just adding full granularity?
By condition:
@visibleIf!true // public
@visibleIf!(isSubtypeOf!(typeof(this))) // protected
By explicit enumeration:
@visible!(getModule!(typeof(this))) // private
On Thursday, 7 November 2013 at 00:07:25 UTC, ChrisG wrote:
My question is: what's the status of D's struct Unique? It
looks like struct RefCounted is current, but I can't tell with
Unique. There's several comments in the source that say:
doesn't work yet. It seems like some of it could be made
On Tuesday, 5 November 2013 at 21:01:40 UTC, John J wrote:
On 11/05/2013 11:00 AM, bearophile wrote:
How to solve such little troubles? A possible idea is to add
to D
another attribute, a kind of "private private" that is
enforced inside
the same module. It could be named "super private" becaus
Hi, I've been following the D language off and on for several
years, have read Andrei's D book, but haven't ever posted here
before. Mostly, I come from a C++ and C# background. Recently, I
was playing with D using the derelict bindings for the SDL
library.
The SDL library uses handles in the
On Wednesday, 6 November 2013 at 21:57:47 UTC, bearophile wrote:
Dicebot:
"Typedef implementation sucks"? ;)
So do you suggest to open some enhancement request/bug report
on Typedef?
Bye,
bearophile
Sure. get enough such reports and we may even get it back as
language feature :) (I thin
On Wed, Nov 06, 2013 at 11:52:56PM +0100, Namespace wrote:
> On Wednesday, 6 November 2013 at 22:43:18 UTC, Dicebot wrote:
> >On Wednesday, 6 November 2013 at 22:41:08 UTC, Atila Neves wrote:
> >>I know, but I keep having to refer back to that and even then I
> >>didn't know about the syntax these
On Wednesday, 6 November 2013 at 22:43:18 UTC, Dicebot wrote:
On Wednesday, 6 November 2013 at 22:41:08 UTC, Atila Neves
wrote:
I know, but I keep having to refer back to that and even then
I didn't know about the syntax these guys just posted! ;)
Well, it is mentioned in the list of `is` usag
On Wednesday, 6 November 2013 at 22:41:08 UTC, Atila Neves wrote:
I know, but I keep having to refer back to that and even then I
didn't know about the syntax these guys just posted! ;)
Well, it is mentioned in the list of `is` usage cases down that
link. It is very ugly part of the language b
On Wednesday, 6 November 2013 at 21:52:04 UTC, Dicebot wrote:
On Wednesday, 6 November 2013 at 21:49:52 UTC, Atila Neves
wrote:
Wow. It didn't even occur to me that `is` could be used like
that. I think that operator is the hardest part of the
language for me to grok. Thanks guys!
http://dlan
On Wednesday, 6 November 2013 at 22:33:48 UTC, Gary Willoughby
wrote:
The above code retrieves all of the current project's modules
and then grabs each module's unit test blocks. The only trouble
is that the module's unit tests are kinda rolled into one
function as show by the 'func' variable a
foreach (module_; ModuleInfo)
{
auto func = module_.unitTest;
func(); // run tests;
}
The above code retrieves all of the current project's modules and
then grabs each module's unit test blocks. The only trouble is
that the module's unit tests are kinda rolled into one function
as show
Dicebot:
"Typedef implementation sucks"? ;)
So do you suggest to open some enhancement request/bug report on
Typedef?
Bye,
bearophile
On Wednesday, 6 November 2013 at 21:49:52 UTC, Atila Neves wrote:
Wow. It didn't even occur to me that `is` could be used like
that. I think that operator is the hardest part of the language
for me to grok. Thanks guys!
http://dlang.org/expression.html#IsExpression ;)
Wow. It didn't even occur to me that `is` could be used like
that. I think that operator is the hardest part of the language
for me to grok. Thanks guys!
On Wednesday, 6 November 2013 at 21:36:52 UTC, Daniel Davidson
wrote:
I don't think it works that way, as how could a compile time
test module know about modules that have pulled it in?
Exactly. __traits work during compile-time. If module is not
imported, it is not known during compile-time -
On Wednesday, 6 November 2013 at 21:26:09 UTC, Dicebot wrote:
On Wednesday, 6 November 2013 at 21:07:47 UTC, Gary Willoughby
wrote:
Unfortunately this still suffers the same problem in that you
need a module symbol name to do anything. I need to get all
module symbols at compile time.
You nee
On Wednesday, 6 November 2013 at 21:07:47 UTC, Gary Willoughby
wrote:
Unfortunately this still suffers the same problem in that you
need a module symbol name to do anything. I need to get all
module symbols at compile time.
You need only symbol name of your root compiled module which
imports
On Wednesday, 6 November 2013 at 19:56:19 UTC, Dicebot wrote:
module aaa;
import std.string;
template Alias(alias S)
{
alias Alias = S;
}
void main()
{
import std.string;
foreach (symbol_name; __traits(allMembers, aaa))
{
alias symbol =
Sorry about that, I have already spent all my rage on this
decision but with no result. Releasing incomplete features as in
good old times.
Am 06.11.2013 21:14, schrieb Dicebot:
On Wednesday, 6 November 2013 at 20:02:42 UTC, Benjamin Thaut wrote:
Well I encounter strange linker errors since 2.064. The question is if
it is supposed to be used when compiling the executable or when
compiling the static library.
You are trying to thin
On Wednesday, 6 November 2013 at 20:02:42 UTC, Benjamin Thaut
wrote:
Well I encounter strange linker errors since 2.064. The
question is if it is supposed to be used when compiling the
executable or when compiling the static library.
You are trying to think about it about a normal feature with
Am 06.11.2013 20:48, schrieb Dicebot:
On Wednesday, 6 November 2013 at 19:33:10 UTC, Benjamin Thaut wrote:
Could someone please explain the new -allinst compiler flag? Is it
supposed to be used on static libraries or on the executable using
templates from those static libraries?
Kind Regards
Be
module aaa;
import std.string;
template Alias(alias S)
{
alias Alias = S;
}
void main()
{
import std.string;
foreach (symbol_name; __traits(allMembers, aaa))
{
alias symbol = Alias!(__traits(getMember, aaa, symbol_name));
On Wednesday, 6 November 2013 at 19:33:10 UTC, Benjamin Thaut
wrote:
Could someone please explain the new -allinst compiler flag? Is
it supposed to be used on static libraries or on the executable
using templates from those static libraries?
Kind Regards
Benjamin Thaut
It is a hack that retu
Could someone please explain the new -allinst compiler flag? Is it
supposed to be used on static libraries or on the executable using
templates from those static libraries?
Kind Regards
Benjamin Thaut
As part of developing the DUnit framework i'm looking into
executing the unit test at a more fine grain level. The new
'getUnitTests' trait looks interesting but it's value is a symbol
of an aggregate (e.g. struct/class/module).
foreach (module_; ModuleInfo)
{
i
On Wednesday, 6 November 2013 at 18:16:04 UTC, Maxim Fomin wrote:
I think that reason for such behavior is the way used defined
operator overloading functions are implemented, not the
language per se, so programmers confuse themselves.
What about other possible reason - "Typedef implementation
On Wednesday, 6 November 2013 at 18:02:32 UTC, Ali Çehreli wrote:
> But such
> expectations need not correspond to language rules (try to
think from
> from language laywer perspective).
I still argue that the expression -expr must have the same type
as expr.
> In bearophile case, I guess
> Ty
06-Nov-2013 00:36, Charles Hixson пишет:
On 11/05/2013 05:34 AM, Dmitry Olshansky wrote:
05-Nov-2013 02:20, Charles Hixson пишет:
On 11/03/2013 01:46 AM, Dmitry Olshansky wrote:
03-Nov-2013 02:37, Charles Hixson пишет:
I'm contemplating an associative array that will eventually grow to be
an
On Wed, Nov 06, 2013 at 06:59:53PM +0100, Maxim Fomin wrote:
> On Wednesday, 6 November 2013 at 17:49:41 UTC, H. S. Teoh wrote:
> >
> >The GC will take care of cleaning up the old data.
> >
> >
> >T
>
> Unfortunately it will not take care of calling struct destructors.
That applies regardless of
On 11/06/2013 09:46 AM, Maxim Fomin wrote:
> On Wednesday, 6 November 2013 at 17:10:34 UTC, Ali Çehreli wrote:
>>
>> I would be very surprised if unary "-" produced a different type from
>> the operand:
>>
>> Ali
>
> Operator does not produce type, it produces value of expression, and
> type of e
On Wednesday, 6 November 2013 at 17:49:41 UTC, H. S. Teoh wrote:
The GC will take care of cleaning up the old data.
T
Unfortunately it will not take care of calling struct destructors.
On Wednesday, 6 November 2013 at 17:10:34 UTC, Ali Çehreli wrote:
I would be very surprised if unary "-" produced a different
type from the operand:
Ali
Operator does not produce type, it produces value of expression,
and type of expression happens not to be the type you expected.
But suc
On Wed, Nov 06, 2013 at 05:15:34PM +0100, Gary Willoughby wrote:
> A simple request but i'm failing hard. How do i re-init an
> associative array?
[...]
Just assign null to it:
import std.stdio;
void main() {
int[string] aa;
aa["a"] = 1;
On 11/06/2013 03:04 AM, bearophile wrote:
import std.typecons: Typedef;
alias Foo = Typedef!double;
void main() {
auto a1 = Foo(1);
pragma(msg, typeof(a1));
auto a2 = 1.Foo;
pragma(msg, typeof(a2));
auto a3 = Foo(-1);
pragma(msg, typeof(a3));
auto a4 = -1.Foo;
On Wednesday, 6 November 2013 at 16:49:44 UTC, Daniel Davidson
wrote:
On Wednesday, 6 November 2013 at 16:41:19 UTC, Gary Willoughby
wrote:
I looked at that but apparently it leaves the array in an
unsafe state.
Source:
http://forum.dlang.org/thread/iu3ll6$2d48$1...@digitalmars.com
Is tha
On Wednesday, 6 November 2013 at 16:41:19 UTC, Gary Willoughby
wrote:
I looked at that but apparently it leaves the array in an
unsafe state.
Source:
http://forum.dlang.org/thread/iu3ll6$2d48$1...@digitalmars.com
Is that still the case? The following seems to work just fine.
Maybe Kenji h
On Wednesday, 6 November 2013 at 16:34:13 UTC, Daniel Davidson
wrote:
On Wednesday, 6 November 2013 at 16:15:36 UTC, Gary Willoughby
wrote:
A simple request but i'm failing hard. How do i re-init an
associative array? This is obviously not the way:
import std.stdio;
void main(
On Wednesday, 6 November 2013 at 16:41:19 UTC, Gary Willoughby
wrote:
x.clear();
I looked at that but apparently it leaves the array in an
unsafe state.
Source:
http://forum.dlang.org/thread/iu3ll6$2d48$1...@digitalmars.com
Wow! Good to know, thanks!
On Wednesday, 6 November 2013 at 16:15:36 UTC, Gary Willoughby
wrote:
A simple request but i'm failing hard. How do i re-init an
associative array? This is obviously not the way:
import std.stdio;
void main(string[] args)
{
int[string] x;
On Wednesday, 6 November 2013 at 16:15:36 UTC, Gary Willoughby
wrote:
A simple request but i'm failing hard. How do i re-init an
associative array? This is obviously not the way:
import std.stdio;
void main(string[] args)
{
int[string] x;
A simple request but i'm failing hard. How do i re-init an
associative array? This is obviously not the way:
import std.stdio;
void main(string[] args)
{
int[string] x;
x["hello"] = 1;
x["world"] = 2;
writ
qznc:
Operator precedence of "." is higher than unary minus.
Is this good?
However, what is Typedef for?
It's to create a differently named type, useful for stronger
static typing, to increase code clarity and avoid some bugs.
If you have a function like this:
double foo(in double x,
On 11/06/2013 04:34 AM, Tyro[17] wrote:
I’m sure the following table is missing a few items but am unclear
what they are. For starters these <>, <>=, >>>, , !<>, !<>=
belong on the table but I’m not sure where. I am also not sure if
these ..., @, # belong there at all. There might be other errors
On Wednesday, 6 November 2013 at 10:46:39 UTC, Adam Ryczkowski
wrote:
...All the samples I use are shipped with the DMD32 D Compiler
v2.063.2 instalation package for Windows. I've just reinstalled
D to make sure that.
no, i mean its not get updated to fetch with phobos changes.
though it shou
On Wednesday, 6 November 2013 at 13:00:17 UTC, Atila Neves wrote:
The title isn't very clear but I wasn't sure how to phrase it
without code. Basically what I want to do is this (won't
compile):
struct Foo(int N) {
}
void func(T)(T obj) if(is(T:Foo)) {
}
void func(T)(T obj) if(!is(T:Foo)) {
On Wednesday, 6 November 2013 at 10:38:29 UTC, Adam Ryczkowski
wrote:
Thank you for the answer.
This is the contents of the build.bat, which is shipped with
the D instalation:
..\..\windows\bin\shell all.sh
Can you tell me, what is outdated?
pi sample at least has compile errors.
...All the samples I use are shipped with the DMD32 D Compiler
v2.063.2 instalation package for Windows. I've just reinstalled D
to make sure that.
On Wednesday, 6 November 2013 at 10:21:38 UTC, evilrat wrote:
On Wednesday, 6 November 2013 at 10:13:07 UTC, Namespace wrote:
Should I open a bug for this?
you should fix ur sc.ini first to use visual studio linker for
x64 and optlink for x86, you can use dmd 2.064.2 installer now
to do so a
On 11/05/2013 05:00 PM, bearophile wrote:
1) I usually write more than one class or struct inside each D module,
unlike in Java. But sometimes when I move that class or struct elsewhere
(during refactoring, or in other situations) I get access errors to
private fields. Those errors were already i
On Wednesday, 6 November 2013 at 11:04:05 UTC, bearophile wrote:
import std.typecons: Typedef;
alias Foo = Typedef!double;
void main() {
auto a1 = Foo(1);
pragma(msg, typeof(a1));
auto a2 = 1.Foo;
pragma(msg, typeof(a2));
auto a3 = Foo(-1);
pragma(msg, typeof(a3));
aut
The title isn't very clear but I wasn't sure how to phrase it
without code. Basically what I want to do is this (won't compile):
struct Foo(int N) {
}
void func(T)(T obj) if(is(T:Foo)) {
}
void func(T)(T obj) if(!is(T:Foo)) {
}
Foo by itself isn't a type, but I don't want to limit func
insta
On Tue, 05 Nov 2013 16:00:41 -, bearophile
wrote:
1) I usually write more than one class or struct inside each D module,
unlike in Java. But sometimes when I move that class or struct elsewhere
(during refactoring, or in other situations) I get access errors to
private fields. Those
On Wednesday, 6 November 2013 at 13:00:17 UTC, Atila Neves wrote:
The title isn't very clear but I wasn't sure how to phrase it
without code. Basically what I want to do is this (won't
compile):
struct Foo(int N) {
}
void func(T)(T obj) if(is(T:Foo)) {
}
void func(T)(T obj) if(!is(T:Foo)) {
On Friday, 1 November 2013 at 20:29:54 UTC, Jonathan M Davis
wrote:
On Friday, November 01, 2013 14:28:55 Daniel Davidson wrote:
On Thursday, 31 October 2013 at 19:39:44 UTC, Jonathan M Davis
Deep copying is not the only reason to have a postblit. Smart
pointers such as
std.typecons.RefCounte
Thank you for the answer.
This is the contents of the build.bat, which is shipped with the
D instalation:
..\..\windows\bin\shell all.sh
Can you tell me, what is outdated?
import std.typecons: Typedef;
alias Foo = Typedef!double;
void main() {
auto a1 = Foo(1);
pragma(msg, typeof(a1));
auto a2 = 1.Foo;
pragma(msg, typeof(a2));
auto a3 = Foo(-1);
pragma(msg, typeof(a3));
auto a4 = -1.Foo;
pragma(msg, typeof(a4));
}
It prints:
Typede
On Wednesday, 6 November 2013 at 01:04:10 UTC, Jonathan M Davis
wrote:
On Wednesday, November 06, 2013 00:22:13 Namespace wrote:
OPTLINK (R) for Win32 Release 8.00.13
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
Debug\Foo.obj Offset 0H
On Wednesday, 6 November 2013 at 10:13:07 UTC, Namespace wrote:
Should I open a bug for this?
you should fix ur sc.ini first to use visual studio linker for
x64 and optlink for x86, you can use dmd 2.064.2 installer now to
do so automatically.
On Wednesday, 6 November 2013 at 09:02:57 UTC, Adam Ryczkowski
wrote:
I installed the DMD32 D Compiler v2.063.2 into C:\
I try to complie and test the dserver.d sample specifically, but
when I run build.bat in the dmd2\samples\d directory, I've got
the following errors.
C:\D\dmd2\samples\d>..\.
On Wednesday, 6 November 2013 at 07:46:00 UTC, Jacob Carlborg
wrote:
Which other languages? "private" in Ruby and Java is not the
same.
The one's which implement private as meaning accessible to the
class only.
On Wednesday, 6 November 2013 at 07:46:00 UTC, Jacob Carlborg
wrote:
Which other languages? "private" in Ruby and Java is not the
same.
The one's which implement private as meaning accessible to the
class only.
I installed the DMD32 D Compiler v2.063.2 into C:\
I try to complie and test the dserver.d sample specifically, but
when I run build.bat in the dmd2\samples\d directory, I've got
the following errors.
C:\D\dmd2\samples\d>..\..\windows\bin\shell all.sh
shell 1.05
..\..\windows\bin\dmd d2html
d2ht
On 11/06/2013 02:36 AM, Jacob Carlborg wrote:
On 2013-11-06 08:28, John J wrote:
Thanks Jacob,
I guess I have to compile and distribute a FreeTDS.dll, and it only
works for win32
FreeTDS works on Posix platforms. I wrote that code on Mac OS X. We use
FreeTDS in production, running servers on
68 matches
Mail list logo