On 1/30/15 5:28 PM, Ali Çehreli wrote:
On 01/30/2015 11:59 AM, chardetm wrote:
struct Container {
private RedBlackTree!int _rbtree = new RedBlackTree!int;
I think you are expecting the new expression to be be executed for every
object individually. It is not the case: That new
On 1/30/15 7:29 PM, Ali Çehreli wrote:
On 01/30/2015 01:28 PM, Ary Borenszweig wrote:
On 1/30/15 5:28 PM, Ali Çehreli wrote:
On 01/30/2015 11:59 AM, chardetm wrote:
struct Container {
private RedBlackTree!int _rbtree = new RedBlackTree!int;
I think you are expecting
On 11/29/14, 3:48 PM, ketmar via Digitalmars-d-learn wrote:
On Sat, 29 Nov 2014 15:37:32 +
Joakim via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
build time for the whole DMD compiler with standard library,
using
G++: 100 seconds. yea, no kidding.
gdc: i don't even want
On 11/21/14, 1:59 PM, Marc Schütz schue...@gmx.net wrote:
On Friday, 21 November 2014 at 15:00:31 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 20 Nov 2014 14:23:23 -0300
Ary Borenszweig via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
This way you avoid silly typing
On 11/21/14, 2:46 PM, Adam D. Ruppe wrote:
On Friday, 21 November 2014 at 17:43:27 UTC, Ary Borenszweig wrote:
What's concatenation by juxtaposition?
When foo bar turns into foobar. The two string literals are right
next to each other, no operator or anything else in between, so
On 11/20/14, 9:05 AM, uri wrote:
On Thursday, 20 November 2014 at 10:41:24 UTC, bearophile wrote:
uri:
It's by design
And it's a nice handy design.
Bye,
bearophile
For Wysiwyg strings I agree that it's great but I prefer C/C++/Python
like behaviour for double quoted strings. I guess it's
On 9/4/14, 5:03 PM, Nordlöw wrote:
Are there any programming languages that extend the behaviour of
comparison operators to allow expressions such as
if (low value high)
?
This syntax is currently disallowed by DMD.
I'm aware of the risk of a programmer misinterpreting this as
On 9/4/14, 7:03 PM, Nordlöw wrote:
On Thursday, 4 September 2014 at 22:02:20 UTC, Nordlöw wrote:
D can also, in this case, do (or will do) common sub-expression
elimination because it has a strict memory model (const and
immutability) and function purity (template inference).
Correction: foo
On 8/29/14, 10:41 AM, Mike James wrote:
Hi,
Looking at the DMD Source Guide it says The lexer transforms the file
into an array of tokens.
Why is this step taken instead of, say, just calling a function that
returns the next token (or however many required for the look-ahead)?
Regards,
On 8/21/14, 6:38 AM, MarisaLovesUsAll wrote:
tl;dr - how to get child classname from inherited parent function at
compile time?
class A { string getName(); };
class B { };
B foo = new B;
assert(foo.getName() == B);
...
Hi! I'm stuck at one issue, and I don't know how to solve it. I think
this
On 8/12/14, 6:31 PM, H. S. Teoh via Digitalmars-d-learn wrote:
On Tue, Aug 12, 2014 at 08:23:30PM +, Jonathan M Davis via
Digitalmars-d-learn wrote:
On Tuesday, 12 August 2014 at 19:03:58 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
tl;dr: there are so many ways template code can go
On 8/6/14, 2:59 PM, H. S. Teoh via Digitalmars-d-learn wrote:
On Wed, Aug 06, 2014 at 05:54:23PM +, Patrick via Digitalmars-d-learn wrote:
I know that there is no prescribed order that the .values array will
be sorted in, however I'm curious if the order is deterministic based
on keys.
If
On 7/25/14, 1:06 PM, Justin Whear wrote:
On Thu, 24 Jul 2014 22:00:43 +, Pavel wrote:
On Thursday, 24 July 2014 at 16:09:25 UTC, Justin Whear wrote:
On Thu, 24 Jul 2014 16:04:01 +, Pavel wrote:
Thanks to all you folks who explained in operator for me. My bad.
Let's focus on the real
On 7/25/14, 6:39 PM, Jonathan M Davis wrote:
On Friday, 25 July 2014 at 21:33:23 UTC, Timothee Cour via
Digitalmars-d-learn wrote:
Is there a function for doing this?
myrange.at(i)
(with meaning of myrange.dropExactly(i).front)
it's a common enough operation (analog to myrange[i]; the naming is
On 7/24/14, 1:09 PM, Justin Whear wrote:
On Thu, 24 Jul 2014 16:04:01 +, Pavel wrote:
Thanks to all you folks who explained in operator for me. My bad.
Let's focus on the real problem, which is JSON wrapper class. Is it
needed? Wouldn't it be better to get AA from parseJSON?
The
On 7/24/14, 1:58 PM, Justin Whear wrote:
On Thu, 24 Jul 2014 13:49:27 -0300, Ary Borenszweig wrote:
Nope, a JSON can only be an array or an object (hash).
Ary, can you point out the place in the spec where this is specified?
Not to be pedantic, but the spec only seems to define a JSON value
On 7/16/14, 10:22 AM, bearophile wrote:
Kagamin:
Report for the problem when a temporary fixed-size array is assigned
to a slice, which is escaped.
I think this is already in Bugzilla. But the point is: you can't solve
this problem locally and with small means. You need a principled
solution
On 7/11/14, 4:46 AM, bearophile wrote:
pgtkda:
How can i get the number of items which are currently hold in a DList?
Try (walkLength is from std.range):
mydList[].walkLength
Bye,
bearophile
So the doubly linked list doesn't know it's length? That seems a bit
inefficient...
This doesn't work:
class Foo {
this() {
this = new Foo;
}
}
Error: Cannot modify 'this'
However you can do this:
class Foo {
this() {
auto p = this;
*p = new Foo();
}
}
It even changes the value of this!
Should that compile? I mean, it's the same as modifying 'this'...
On 6/28/14, 6:21 PM, H. S. Teoh via Digitalmars-d-learn wrote:
On Sat, Jun 28, 2014 at 05:40:19PM -0300, Ary Borenszweig via
Digitalmars-d-learn wrote:
This doesn't work:
class Foo {
this() {
this = new Foo;
}
}
Error: Cannot modify 'this'
However you can do this:
class Foo
On 6/24/14, 4:13 PM, Jacob Carlborg wrote:
On 2014-06-24 04:34, John Carter wrote:
So in Ruby and R and Scheme and... I have happily used map / collect for
years and years.
Lovely thing.
So I did the dumb obvious of
string[] stringList = map!...;
And D barfed, wrong type, some evil
On 6/23/14, 6:18 PM, John Carter wrote:
I guess between perl and Ruby and Scheme etc. I got used to creating
hybrid containers
Want a pair of [string, fileList]? Just make an Array with two items,
one a string, one and array of strings. Done.
D barfed... leaving me momentarily stunned...
On 5/15/14, 1:31 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Thu, 15 May 2014 01:29:23 +
Kapps via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wednesday, 14 May 2014 at 23:50:34 UTC, Meta wrote:
On the topic of lazy, why *is* it so slow, exactly? I thought
On 5/13/14, 5:43 PM, anonymous wrote:
On Tuesday, 13 May 2014 at 19:53:17 UTC, Tim Holzschuh via
Digitalmars-d-learn wrote:
If I also want to create a RegEx to filter string-expressions a la
xyz , how would I do this?
At least match( src, r^\ (.*) $\ ); doesn't seem to work and I
couldn't
On 5/12/14, 5:37 AM, JR wrote:
Given that...
1. importing a module makes it compile the entirety of it, as well as
whatever it may be importing in turn
2. templates are only compiled if instantiated
3. the new package.d functionality
...is there a reason *not* to make every single
On 5/4/14, 6:04 PM, Mark Isaacson wrote:
I'm looking for a means to associate a key with a value and iterate over
said container in-order. My natural choice in C++ would be std::map.
When I look in std.container, I see that there is a RedBlackTree
implementation, however this does not associate
Hi,
I'd like to generate a toString() method for my classes. For example:
---
import std.stdio;
class Foo {
int x;
int y;
// mixin ...?
}
void main() {
auto foo = new Foo;
foo.x = 1;
foo.y = 2;
writeln(foo); // prints Foo(x = 1, y = 2)
}
---
I tried using getAllMembers, but
On 3/26/14, 11:47 AM, Adam D. Ruppe wrote:
On Wednesday, 26 March 2014 at 14:16:08 UTC, Ary Borenszweig wrote:
I'd like to generate a toString() method for my classes. For example:
Try this:
override string toString() {
import std.conv;
string s;
s
On 3/26/14, 11:47 AM, Adam D. Ruppe wrote:
On Wednesday, 26 March 2014 at 14:16:08 UTC, Ary Borenszweig wrote:
I'd like to generate a toString() method for my classes. For example:
Try this:
override string toString() {
import std.conv;
string s;
s
On 3/17/14, 12:11 PM, Spacen Jasset wrote:
On Monday, 17 March 2014 at 14:39:16 UTC, Adam D. Ruppe wrote:
On Monday, 17 March 2014 at 14:31:54 UTC, Spacen Jasset wrote:
Thanks. What devilish magic allows for the syntax 60.days? (how does
it work)
There's a function in core.time:
Duration
Hi,
I just read this nice article about slices:
http://dlang.org/d-array-article.html
So I tried this code to see if I understood it correctly:
---
import std.stdio;
void main() {
auto a = new int[5];
auto b = a;
a[0] = 1;
for(auto i = 0; i 100; i++) {
a ~= 0;
}
a[0] =
On 1/28/14, 3:17 PM, Chris wrote:
On Tuesday, 28 January 2014 at 17:18:44 UTC, Ary Borenszweig wrote:
On 1/28/14, 11:30 AM, bearophile wrote:
Ary Borenszweig:
In Ruby you can do this:
class Foo
def end
1
end
end
Foo.new.end
Ruby is a different language from D, they define code
On 1/28/14, 10:00 AM, Ola Fosheim Grøstad
ola.fosheim.grostad+dl...@gmail.com wrote:
On Tuesday, 28 January 2014 at 12:58:29 UTC, Stanislav Blinov wrote:
I really wonder whether the rule could be relaxed a little bit.
o_O How?
If body never appears after a ., and is only before a { then
On 1/28/14, 11:30 AM, bearophile wrote:
Ary Borenszweig:
In Ruby you can do this:
class Foo
def end
1
end
end
Foo.new.end
Ruby is a different language from D, they define code safety in quite
different ways.
Bye,
bearophile
Having a method named end doesn't make the language
On 12/11/13 8:05 AM, bioinfornatics wrote:
On Wednesday, 11 December 2013 at 11:00:40 UTC, QAston wrote:
On Wednesday, 11 December 2013 at 10:49:43 UTC, bioinfornatics wrote:
Hi,
Little question,
I'm looking a jdbc like in D ?
Does this exists ?
Thanks
https://github.com/buggins/ddbc - see
On 12/5/13 2:15 PM, Steve Teale wrote:
Here I feel like a beginner, but it seems very unfriendly:
import std.stdio;
struct ABC
{
double a;
int b;
bool c;
}
ABC[20] aabc;
void foo(int n)
{
writefln(n: %d, aabc.length: %d, n, aabc.length);
if (n aabc.length)
On 12/5/13 4:59 PM, Maxim Fomin wrote:
t and have these surprises all of the time just because a negative
length doesn't make sense... I don't know, I feel it's not the right
way to do it.
ulong, it's the same thing.
On 11/26/13 7:00 PM, Namespace wrote:
On Tuesday, 26 November 2013 at 21:37:49 UTC, Jonas Drewsen wrote:
Isn't it a bug that the assertion is triggered for this:
class Test3 {}
void main()
{
assert( (new Test3()) == (new Test3()) );
}
Tried it on http://dpaste.dzfl.pl/ as well.
/Jonas
On 11/23/13 7:57 PM, H. S. Teoh wrote:
void delegate(Event) dg = (Event e) {
if (e == ...)
queue.remove(dg); // NG: Still complains 'dg' isn't
defined
};
Split it in declaration and initialization:
void delegate(Event) dg;
dg = (Event e) {
On 11/16/13 7:41 AM, Max Klyga wrote:
On 2013-11-16 05:04:20 +, Jonathan M Davis said:
I really don't understand this. OptionalT is one of the most useless
ideas
that I've ever seen in Java. Just use null.
Optional specifies explicitly that value can be absent and forces client
to check
On 8/14/13 2:26 PM, Andre Artus wrote:
On Sunday, 11 August 2013 at 17:01:46 UTC, Yota wrote:
On Friday, 9 August 2013 at 17:35:18 UTC, monarch_dodra wrote:
On Friday, 9 August 2013 at 15:28:10 UTC, Manfred Nowak wrote:
michaelc37 wrote:
WTF - -1 is greater than 7
From the docs:
It
On 7/31/13 12:05 PM, bearophile wrote:
Daniel Kozak:
is there a way for AA to behave same as PHP?
D associative arrays are based on hashing, so they do not keep the order
of the items. This is true in Python too. The Python standard library
has a hash-based ordered dict that keeps the
On 7/31/13 12:56 PM, H. S. Teoh wrote:
On Wed, Jul 31, 2013 at 12:51:25PM -0300, Ary Borenszweig wrote:
On 7/31/13 12:05 PM, bearophile wrote:
Daniel Kozak:
is there a way for AA to behave same as PHP?
D associative arrays are based on hashing, so they do not keep the
order of the items
On 7/17/13 4:33 AM, Jacob Carlborg wrote:
On 2013-07-17 05:27, JS wrote:
With heavy ctfe code generation usage is it possible to have the d
compiler output the source code after all mixin templates have been
used? This way it is easier to visually check for errors in the
generated code.
I
On 7/17/13 11:38 AM, JS wrote:
On Wednesday, 17 July 2013 at 14:18:25 UTC, John Colvin wrote:
On Wednesday, 17 July 2013 at 14:09:28 UTC, JS wrote:
Ok, spoke too soon again,
my string requires compound splitting:
foreach(ss; split(s, ,))
{
split(ss, |); // ss can't be read at compile time
On 7/12/13 5:38 PM, ixid wrote:
On Friday, 12 July 2013 at 20:30:59 UTC, bearophile wrote:
ixid:
Similarly what are D user's potential issues with Go-like semi-colon
rules? And would this be possible as a subset of current D code?
Such changes will not happen even in D4. Walter is strongly
On 2/21/13 8:34 PM, Jonathan M Davis wrote:
On Friday, February 22, 2013 00:06:26 bearophile wrote:
Jonathan M Davis:
D doesn't
bother to check, so you get the natural consequence of mixing
them. I'm quite
sure that the fact that it works that way is an accident. It
was never
intentially made
On 2/17/13 7:25 PM, Jonathan M Davis wrote:
On Sunday, February 17, 2013 23:00:19 Michael wrote:
That's not the meaning of static in that context.
As I understand a static class can't be instantiated.
I have no idea how you came to that conclusion.
Probably because of this:
On Thursday, 10 January 2013 at 17:36:15 UTC, Raphaël Jakse wrote:
Le 10/01/2013 10:23, monarch_dodra a écrit :
On Thursday, 10 January 2013 at 03:29:21 UTC, Peter Summerland
wrote:
The only thing I'd want to be able to do is:
//
foreach ( ; 0 .. 5)
{
writeln(hello);
}
//
If I
On 05/29/2010 06:38 PM, Duke Normandin wrote:
Back again...
As an introductory tutorial, I'm now using:
http://www.dsource.org/projects/tutorials/wiki/InitializingVariablesExample
BTW, somebody fix that page - the `writefln' statements are missing
the %d and %s.
char[] password = sesame;
Walter Bright wrote:
bearophile wrote:
Walter Bright:
Are you sure? What's the mistake in the code?
This is the code in the Overview, it prints 1899:
http://codepad.org/lzRtggEL
This is the code I have suggested in bugzilla, it prints 1027:
http://ideone.com/D9ZqQ
Wolfram Alpha says they
Nrgyzer wrote:
Hello everybody,
I'm trying to create a (very) simple DLL by using D. Now I want export values -
is there any way do this... for example:
Example:
mydll.d:
export int i;
mydll2.d:
export int i = 99;
dll.d:
// Copied from http://www.digitalmars.com/d/2.0/dll.html
test.d:
Ellery Newcomer wrote:
Are there any good libraries for ctfe/code generation?
I don't know, things like parsing support for compile time strings,
string formatting, type - string
My project seems to be growing ctfe, and it's all horribly hacky and
ugly code.
I think all ctfe code is
Ellery Newcomer wrote:
Are there any good libraries for ctfe/code generation?
I don't know, things like parsing support for compile time strings,
string formatting, type - string
My project seems to be growing ctfe, and it's all horribly hacky and
ugly code.
I think all ctfe code is
bearophile wrote:
Ary Borenszweig:
My point is, if you are going to pow, you will need std.math, so it'll
always be a burden to import it by hand when using it. ^^
Can the automatic import happen only iff a module uses the ^^fp?
Bye,
bearophile
That's what I'm asking for.
Don wrote:
Lars T. Kyllingstad wrote:
Don wrote:
bearophile wrote:
So far I've just given a light reading of the code. Notes:
- pow(x, 2) and sqrt(y) can be written as x ^^ 2 and y ^^ 0.5 (but
you have to import std.math anyway, because of a bug).
That's not a bug. It's intentional. x ^^
Don wrote:
Ary Borenszweig wrote:
Don wrote:
Lars T. Kyllingstad wrote:
Don wrote:
bearophile wrote:
So far I've just given a light reading of the code. Notes:
- pow(x, 2) and sqrt(y) can be written as x ^^ 2 and y ^^ 0.5 (but
you have to import std.math anyway, because of a bug
bearophile wrote:
While looking for possible attribute problems to add to Bugzilla, I have seen
the following D2 program compiles and runs with no errors or warnings:
static foo1() {}
final foo2() {}
ref foo3() {}
enum void foo5() {}
nothrow foo4() {}
pure foo6() {}
static int x1 = 10;
static
Trass3r wrote:
Cast the instance to the base class and call the method?
Surprisingly this does compile.
What are the rules for casting between classes?
Normally you can cast A to B if B inherits from A. But this seems not to
be the case in D. The following compiles without complains:
The following compiles:
import std.stdio;
interface I {
}
class A : I {
}
class B {
}
int main() {
I i = new A();
A a = cast(A) i;
B b = cast(B) i; // shouldn't compile
B c = cast(B) a; // shouldn't compile
writeln(a);
writeln(b);
writeln(c);
return 0;
}
But two lines
Steven Schveighoffer wrote:
On Mon, 08 Mar 2010 10:12:53 -0500, Ary Borenszweig
a...@esperanto.org.ar wrote:
Steven Schveighoffer wrote:
On Mon, 08 Mar 2010 09:38:08 -0500, Ary Borenszweig
a...@esperanto.org.ar wrote:
An instance of A can never be an A, so why the cast is allowed?
Aside
Don wrote:
Phil Deets wrote:
On Mon, 28 Dec 2009 16:18:46 -0500, Simen kjaeraas
simen.kja...@gmail.com wrote:
Apart from C legacy, is there a reason to assume anything we don't
know what
is, is an int? Shouldn't the compiler instead say 'unknown type' or
something
else that makes sense?
Don wrote:
BCS wrote:
Hello Ary,
Don wrote:
Phil Deets wrote:
On Mon, 28 Dec 2009 16:18:46 -0500, Simen kjaeraas
simen.kja...@gmail.com wrote:
Apart from C legacy, is there a reason to assume anything we don't
know what
is, is an int? Shouldn't the compiler instead say 'unknown type' or
bearophile wrote:
Tomek Sowiñski:
How do I achieve this with std.format?
I think you can't (and I haven't had the need to do it).
It's somtimes needed with I18N code.
Chad J wrote:
Given an Expression object in dmd, I'd like to know how many
subexpressions it contains and, even better, iterate over them. I'd
like to do this in a general way, without having to create cases for all
of the different kinds of Expressions. Is there some way to do this
that I've
Ellery Newcomer wrote:
On 11/30/2009 12:32 PM, Chad J wrote:
Ellery Newcomer wrote:
On 11/30/2009 03:53 AM, Ary Borenszweig wrote:
Chad J wrote:
Given an Expression object in dmd, I'd like to know how many
subexpressions it contains and, even better, iterate over them. I'd
like to do
Michael Mittner wrote:
Hi!
I'm trying to do something like this (in D1):
class Foo
{
// ...
}
class Bar(T) : Foo
{
// ...
}
alias Bar!(int) IntBar;
alias Bar!(Mars) MarsBar;
void main()
{
Foo x = new MarsBar();
}
Common base class, one derived template class and a bunch of
Sam Hu wrote:
Greetings!
How to set value to non-static variable in a static method within a class?
Given below code:
import std.stdio;
class InputDialog
{
string name;
static string s_name;
static this()
{
s_name=;
Simen Kjaeraas wrote:
Ary Borenszweig a...@esperanto.org.ar wrote:
How can I know at compile time if all of the following are true for a
given symbol s:
1. s is a function
2. the return type is a class that extends from class foo.Bar
3. the function has three arguments
How can I know at compile time if all of the following are true for a
given symbol s:
1. s is a function
2. the return type is a class that extends from class foo.Bar
3. the function has three arguments and it is not variadic
4. the first argument is an int
5. the second argument is a
bearophile wrote:
Steven Schveighoffer:
int c = (){return a + b;}();
You can also write:
int c = {return a + b;}();
Bye,
bearophile
Shorter:
int c = a + b;
Joel Christensen wrote:
I've got one project working ok, but not another. Things like working at
the start of the main function but not at the end, and not in other
functions.
Hi Joel,
Do you have something in the Error Log (Window - Show View - Error
Log)? How is your project configured?
Ellery Newcomer wrote:
Phil Deets wrote:
Hi, is there a way to add members to an enum based on conditional
compilation symbols. I tried
enum Tag {
A, B,
version (symbol) {
C, D,
}
E,
}
but it doesn't work. I know I could do
version (symbol) {
enum Tag { A, B, C, D, E }
}
Steven Schveighoffer wrote:
On Mon, 12 Oct 2009 05:26:58 -0400, bearophile
bearophileh...@lycos.com wrote:
What's wrong with this code?
struct MemoryPool(T) {
alias T[100_000 / T.sizeof] Chunk;
Chunk*[] chunks;
}
struct Foo {
int x;
MemoryPool!(Foo) pool;
}
void main() {}
It
Jarrett Billingsley wrote:
On Thu, Oct 8, 2009 at 11:25 AM, Don nos...@nospam.com wrote:
Jarrett Billingsley wrote:
On Thu, Oct 8, 2009 at 4:00 AM, Don nos...@nospam.com wrote:
So it looks to me like the mechanics of it are basically identical.
Just Nemerle's syntax is nicer.
Only with
Trass3r wrote:
Phil Deets schrieb:
I tried Descent, but it didn't work well at all with my D2 program. It
also didn't support building. I'll look into Poseidon. Thanks.
D2 support isn't that good in Descent yet.
Exactly. I think the parser is ported up to 2.030 but I didn't test it a
lot
Sam Hu escribió:
div0 Wrote:
You must have two different HANDLEs around.
The one in phobos is aliased to void* and there is no LoadLibraryEx call
in phobos, so you must be using something else.
Try using the FQN of the import where you are getting the LoadLibraryEx
from.
Thanks for your help.
Hi,
I'm trying to fetch a module's dependencies with the deps switch, but it
gives me an empty list.
dmd main.d -deps=foo.txt
foo.txt is empty.
main.d is:
---
module main;
import other;
int main(char[][] args) {
someVariable = 3;
return 0;
}
---
and someVariable is
div0 wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jarrett Billingsley wrote:
On Fri, Aug 21, 2009 at 1:36 PM, div0d...@users.sourceforge.net wrote:
That's what he's suggesting, and it does make sense. When you write a
template, *either* it's meant to be used as a mixin, *or* it's
div0 wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ary Borenszweig wrote:
div0 wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jarrett Billingsley wrote:
On Fri, Aug 21, 2009 at 1:36 PM, div0d...@users.sourceforge.net wrote:
That's what he's suggesting, and it does make sense
bearophile escribió:
Jarrett Billingsley:
C++ has static initialization that occurs before main() too. It's just..
hidden.
I see. I have to learn more about C++. Thank you.
--
Lars T. Kyllingstad:
This is good news! The restrictions you are referring to, are they any of
Harry escribió:
Again hello,
char[6] t = ragain ~ cast(char)7 ~ rhello;
If you want the result to be again7hello, then no. You must do:
char[6] t = ragain ~ '7' ~ rhello;
or:
char[6] t = ragain ~ (cast(char)('0' + 7)) ~ rhello;
Saaa escribió:
struct S
{
int i;
}
S[char[]] aa;
void main() {
aa[test].i = 10;
}
Error: ArrayBoundsError
D1.046
looks like a bug to me or can't structs be aa's?
But you never inserted anything in aa[test].
You must do:
S s;
aa[test] = s;
aa[test].i = 10;
or:
S s;
s.i = 10;
aa[test]
asd wrote:
I'm trying to get D-ObjC bridge working and I'm getting weird errors triggered
somewhere deeply in a mix of templates and mixins that's too hard for me to
understand.
How can I analyze such problem in D? Is it possible to tell dmd to run only
compile-time functions/templates and
Ary Borenszweig wrote:
asd wrote:
I'm trying to get D-ObjC bridge working and I'm getting weird errors
triggered somewhere deeply in a mix of templates and mixins that's too
hard for me to understand.
How can I analyze such problem in D? Is it possible to tell dmd to run
only compile-time
Brad Roberts escribió:
Jarrett Billingsley wrote:
On Tue, Jul 21, 2009 at 11:53 PM, Brad Robertsbra...@puremagic.com wrote:
Jesse Phillips wrote:
On Wed, 22 Jul 2009 01:37:38 +0100, Stewart Gordon wrote:
Jesse Phillips wrote:
According to the documentation having amp; in a tag will be
Lars T. Kyllingstad wrote:
Lars T. Kyllingstad wrote:
Haruki Shigemori wrote:
Hi.
The std.cstream.dout has a member function dout.flush.
But the std.stdio has not a function flush or a similar function.
Why? Don't you want to have it?
Give me the std.stdio.flush!
All the write functions in
AxelS escribió:
BCS Wrote:
You can't. The D runtime (and most other runtimes) don't ever reduce the
amount of memory they keep in the heap. If you where to allocate another
25MB right after that function you would see no change in the memory usage.
The good news is that with virtual memory,
Robert Clipsham escribió:
Ary Borenszweig wrote:
I've seen both Tango and phobos documentation and it's really hard to
navigate. Consider this:
class HttpPost {
void[] write(Pump pump)
}
Pump has no link on it. I can't tell what Pump is. I can see the
source code (in the web page
Lars T. Kyllingstad escribió:
robby wrote:
i'm using D1/Tango. sorry, im not sure to how to explain the error
messages, but if you need to look a t full code, here is the link
http://www.ibsensoftware.com/download.html
thanks again.
Several places in that code, I notice things like this:
Stewart Gordon escribió:
Jarrett Billingsley wrote:
On Fri, Jun 26, 2009 at 5:54 PM, Ary Borenszweiga...@esperanto.org.ar
wrote:
Is is ok that this compiles without errors?
class Foo {
alias errorProne this;
}
Errors as expected on 1.042; compiles on 2.029.
If I had to guess, it's
Sam Hu escribió:
John C Wrote:
Object.factory requires a fully qualified class name, so if class Dog resides in module
animals, call Object.factory(animals.Dog).
It works now.Great!Thanks so much!
But...may I ask how do you know that?(requires full name).I went through the
object.di but
Paul D. Anderson wrote:
Paul D. Anderson Wrote:
Is there a way to see the source for a D program after the mixins and
templates, etc., are expanded?
I get occasional error messages saying I've got incompatible types, for
example, but the error message only makes sense when I mentally
BCS escribió:
Hello Ary,
BCS escribió:
Hello BCS,
void main()
{
int s;
mixin(s) = 5;
}
-
Line 4: found '=' when expecting ';'
http://www.digitalmars.com/d/1.0/expression.html#MixinExpression
(mixin(s)) = 5;
Given that the above works, it looks like the parser prematurely
commits to a
BCS escribió:
Reply to Paul,
Is there a way to see the source for a D program after the mixins and
templates, etc., are expanded?
Descent has a compile time view that is supposed to do some of this.
If you are only looking at string mixins you can use pragma(msg, string)
to view the
grauzone wrote:
BCS wrote:
Hello grauzone,
http://groups.google.com/group/net.lang.c/msg/66008138e07aa94c
Many people (even Brian Kernighan?) have said that the worst feature
of C is that switches don't break automatically before each case
label.
Oh god, that's from 1984, and even today
Saaa wrote:
What kind of fall-throughs were these?
A:
case value1:
case value2:
case valueN:
code1();
break;
B:
case value1:
code1();
case value2:
code2();
break;
The solution is to forbid fallthrough, and change the switch syntax:
switch(value) {
case 1:
case 2:
//
Saaa wrote:
How do you know? BCS didn't reply to my idea.
Your idea was to give an error on the case (B) he uses. Or did I miss
something?
You missed the alternative syntax to get the same behaviour. But it's a
very subtle difference.
Saaa wrote:
You missed the alternative syntax to get the same behaviour. But it's a
very subtle difference.
Do you mean the multiple cases?
http://www.digitalmars.com/d/1.0/statement.html#SwitchStatement
Yes, but make the multiple cases the *only* way to make case
statements fallthrough.
Saaa wrote:
Yes, but make the multiple cases the *only* way to make case
statements fallthrough. That would be the change.
That is the same as giving an error on case B, right?
Well, yes, but you also have to prepare your mind for the change. This
is a huge step.
(nah, just kidding,
1 - 100 of 114 matches
Mail list logo