Named arguments are useful when you have a function that takes a large
number of parameters, the vast majority of which have default values.
For example, have a look at this constructor in wxWidgets:
http://docs.wxwidgets.org/trunk/classwx_frame.html#01b53ac2d4a5e6b0773ecbcf7b5f6af8
On 07/03/11 01:01, Caligo wrote:
On Sun, Mar 6, 2011 at 12:24 PM, Peter Alexander peter.alexander.au
http://peter.alexander.au@gmail.com http://gmail.com wrote:
On 6/03/11 4:22 PM, bearophile wrote:
So I think it's not worth adding to D.
But if you don't agree...
And I needed one. So here's a staticReduce a that appears to work,
uploaded as a github gist for anyone who is interested. That is all.
https://gist.github.com/783771
On 17/01/11 18:10, Andrei Alexandrescu wrote:
std.range has a function repeat that repeats one value forever. For
example, repeat(42) is an infinite range containing 42, 42, 42,...
The same module also has a function replicate that repeats one value a
specific number of times. In fact,
I was trying to walk a tree at compile time and I came up with this
method. It seems very elegant, but unfortunately it fails with a
recursive alias declaration error. I have a bad feeling there's no way
to fix this but I thought I'd ask in case anyone had any ideas.
On 21/11/10 22:39, bearophile wrote:
Gareth Charnock:
struct LeafType {
string Compile_not_ovloaded() {
return expression;
}
};
Note that D structs don't require the ending semicolon, so in practice it is
not used. And in D method names start with a lower
This code makes the DMD compiler segfault
struct LeafType {
string Compile_not_ovloaded() {
return expression;
}
};
struct MatrixASTNode {
LeafType Right;
string Compile() {
return Right.Compile_not_ovloaded();
}
};
void main() {
enum AST =
Done.
http://d.puremagic.com/issues/show_bug.cgi?id=5248
I'm sorry if I'm a bit over-cautious before submitting bugs.
On 21/11/10 22:18, Brad Roberts wrote:
On 11/21/2010 2:11 PM, Gareth Charnock wrote:
This code makes the DMD compiler segfault
struct LeafType {
string
This code makes the DMD compiler segfault
struct LeafType {
string Compile_not_ovloaded() {
return expression;
}
};
struct MatrixASTNode {
LeafType Right;
string Compile() {
return Right.Compile_not_ovloaded();
}
};
void
On 03/11/10 03:21, Robert Jacques wrote:
struct BinaryOp(L,string op,R) {
pragma(msg,Instansiating ~ typeof(this).stringof);
BinaryOp!(typeof(this),s,R1) opBinary(string s,R1)(R1 r) {
pragma(msg,Instansiating BinaryOp.opBinary ~L.stringof ~ op ~
R1.stringof);
return
On 29/10/10 18:35, Walter Bright wrote:
This is primarily a bug fix release.
http://www.digitalmars.com/d/1.0/changelog.html
http://ftp.digitalmars.com/dmd.1.065.zip
http://www.digitalmars.com/d/2.0/changelog.html
http://ftp.digitalmars.com/dmd.2.050.zip
This bug was also fixed.
I've been trying to correctly implement the interpreter
patten/expression templates in D (for reference this is a summary of the
C++ interpreter patten can be found here
http://www.drdobbs.com/184401627). I've run into a problem and I'm not
sure if it's a compiler bug or not. The testcase is:
On 03/11/10 00:54, bearophile wrote:
Is it correct for immutable struct fields to act like enum or static const
fields? (I don't think so, but I am wrong often):
struct Foo {
immutable int x = 1;
}
static assert(Foo.sizeof == 4);
void main() {}
More info in the D.learn thread:
On 03/11/10 02:20, Gareth Charnock wrote:
On 03/11/10 00:54, bearophile wrote:
Is it correct for immutable struct fields to act like enum or static
const fields? (I don't think so, but I am wrong often):
struct Foo {
immutable int x = 1;
}
static assert(Foo.sizeof == 4);
void main() {}
More
As one of those strange creatures who use emacs, I thank you for taking
this up! Sadly I'm not an elisper but if I find bugs I'll let you know.
On 25/10/10 07:32, Russel Winder wrote:
Walter asked me to post this to this list.
The Emacs D Mode project is at:
On 05/10/10 14:41, Michael Chen wrote:
I remember that one of D's goal is easy scientific computation.
However I haven't seen any linear algebra package for D2. My work
heavily relays on all kinds of matrix stuff (matrix multiplication,
factorization, linear system etc). I like D and am willing
On 05/10/10 16:31, Don wrote:
Gareth Charnock wrote:
On 05/10/10 14:41, Michael Chen wrote:
I remember that one of D's goal is easy scientific computation.
However I haven't seen any linear algebra package for D2. My work
heavily relays on all kinds of matrix stuff (matrix multiplication
I will definitely be checking this out. I've used CMake with C++ for
quite a large project and it's been very good at of getting the done
without being the infinite tower of turtles on turtles that autotools
seems to be.
(I never managed to learn autotools so perhaps they don't seem as bad
On 02/09/10 09:46, Jacob Carlborg wrote:
On 2010-09-02 09:48, Nick Sabalausky wrote:
Andrei Alexandrescuseewebsiteforem...@erdani.org wrote in message
news:i5ni8j$1nk...@digitalmars.com...
Time to zero in on the overall design and start working on the content.
Please give the design one more
PS: Google Chrome on a 1680x1050 resolution display.
I'm afraid I really like the red flare; it makes the website look more
visually appealing. A solid background colour would just look blander.
However, I agree with the comments about the c1.gif and d3.gif images.
They don't really fit with
On 01/09/10 16:49, user wrote:
To everyone reporting inconsistencies between Andrei's book and the
compiler -- please include TDPL or [tdpl] in the bug title, to make it
easier to search for them. These bugs have high priority.
To everyone reporting inconsistencies between Andrei's book and
On 01/09/10 21:50, Stanislav Blinov wrote:
Is it just me, or spam bots suddenly became incredibly clever?
You call that clever? O_o
For a bot. It almost seems as there is some intelligence behind this.
Well, a little too almost, maybe.
I checked and bug #1 isn't actually give up already,
On 26/08/10 07:57, Don wrote:
Walter Bright wrote:
bearophile wrote:
This is why I don't like a lot the current work done for the 64 bit
implementation.
A lot of groups cannot consider D unless it supports 64 bit compilation.
D2 has some design problems (I don't call them 'enhancement
--
The (C) arrays are not the same thing as dynamic arrays of dynamic arrays
because:
- Some algorithms are not designed for a triangle where rows may differ in
length. Testing that rows are all the same length at runtime wastes time, and
if you don't test it then it
On 03/08/10 15:19, Sam Hu wrote:
Base on D1:
interface IADsPropertyEntry : IDispatch {
mixin(uuid(05792c8e-941f-11d0-8529-00c04fd8d503));
...
Error when compile:
argument to mixin must be a string,not
mixin(uuid(05792c8e-941f-11d0-8529-00c04fd8d503))
cannot evaluate
So having got a collectors' edition TDPL, I though I'd have a try at
writing some concurrent code. The idea was a worker thread(s) would do
some work and write the results to some immutable objects. These would
get passed to an indexer thread that would do neat stuff like indexing
the
On 02/07/10 15:18, Heywood Floyd wrote:
On Jul 2, 2010, at 15:34 , Steven Schveighoffer wrote:
On Fri, 02 Jul 2010 09:32:39 -0400, Steven Schveighofferschvei...@yahoo.com
wrote:
On Fri, 02 Jul 2010 09:24:20 -0400, Heywood Floydsoul...@gmail.com wrote:
Good day!
Consider
// - - - -
On 16/07/10 02:08, Jonathan M Davis wrote:
On Thursday, July 15, 2010 17:40:26 Gareth Charnock wrote:
So having got a collectors' edition TDPL, I though I'd have a try at
writing some concurrent code. The idea was a worker thread(s) would do
some work and write the results to some immutable
As far as I'm concerned the inventor of Python should be beaten to
death with a sock full of tab
keys.
That mental image just made my day! :)
I don't actually know assembly language so no, this is all purely
empirical.
BCS wrote:
Hello Gareth,
I managed to get some free time to look at this and it would appear
that static foreach is slower than hand unrolling a loop. Fortunately
there are no detectable differences between hand
Jérôme M. Berger wrote:
Gareth Charnock wrote:
PS: Okay so I just had a looked at the matrix and vector classes in
Ogre3D and irrlicht. Looks like they both define v*v as element wise
multiplication but m*m is matrix multiplication. That just seems even
more inconsistent.
Eigen (http
I managed to get some free time to look at this and it would appear that
static foreach is slower than hand unrolling a loop. Fortunately there
are no detectable differences between hand unrolling a loop and building
the body of the loop in a compile time string and using a mixin. Results
are
Correction, two of the loops were going backwards (mixin and hand
unrolled). Fixed this but the conclusion remains the same.
Gareth Charnock wrote:
I managed to get some free time to look at this and it would appear that
static foreach is slower than hand unrolling a loop. Fortunately
Thanks. To quickly answer this:
- The version I'm seeing on github doesn't seem to have all the features
you're referencing (i.e. v*v). Why are some ops limited to */ and
other +-?
It was quite late (3am) when I typed up that email. I'm sorry if I got
the ops wrong. v*v was actually
I need a better name for ArgList. It originally made sense because
because I assumed I be using the tuple like this:
this(ArgList argList)
But then I ended up using it in a load of static foreaches.
I think it would be useful to actually be able to say static foreach
so that readers (and
I've put the beginnings of my matrix-vector library up on github
(between swizzling, generalising to N dimensions and making use of
static foreach this project quickly turned from a cleanup to a rewrite).
You can find it here.
http://github.com/gcharnock/phoboslinalgebra
Some highlights so
Walter Bright wrote:
Nick Sabalausky wrote:
Heh. I've surprised a lot of laymen, after telling them I'm a
programmer, by my opinions that most programmers are incompetent and
most software and consumer electronics are terrible. Seems hugely
ironic to those unfamiliar with the field, but being
Just got a chance to test the isInstanceOf template and it does (after
some fiddling) provide a workaround for this bug. Thanks.
Philippe Sigaud wrote:
On Fri, Apr 23, 2010 at 14:57, Robert Jacques sandf...@jhu.edu
mailto:sandf...@jhu.edu wrote:
PS. You can get things like this to work
Is this a bug, or am I being dense? I've tried it this on 2.036,2.042
and 2.043 and on each the compiler produces errors. Searched bugzilla
for template and instantiated and template and instantiate
struct A(uint N) {
}
void unary_op(uint N)(A!(N)) {
}
void main() {
A!(3) a3;
Thanks!
Robert Jacques wrote:
On Fri, 23 Apr 2010 10:25:35 -0300, Gareth Charnock
gar...@oerc.ox.ac.uk wrote:
Is this a bug, or am I being dense? I've tried it this on 2.036,2.042
and 2.043 and on each the compiler produces errors. Searched bugzilla
for template and instantiated and template
...er... ...
I think I'll just put on the dunce hat and stand in the corner then.
This is why, as someone with dyslexia, I like statically typed
languages. I hate finding out about these errors at runtime.
Lars T. Kyllingstad wrote:
Gareth Charnock wrote:
Is this a bug, or am I being dense
Clemens wrote:
Eric Poggel Wrote:
On 4/16/2010 10:41 PM, Andrei Alexandrescu wrote:
Generally I'd strongly suggest making operations free generic functions
instead of members.
I disagree on this one. It unnecessarily adds more names to an outer
namespace and makes code less readable:
Andrei Alexandrescu wrote:
On 04/16/2010 04:25 PM, Gareth Charnock wrote:
Okay, here goes. I've collected together the basic functionality that
would probably make a good starting point. As I've mentioned my code is
very messy and has bits missing (e.g. I never had a use for the cross
product
a reputation for not being as open as one
might like, but the general consensus seems to be that things are
getting better, which is why I'm posting first to check if the authors
of Phobos are open to the idea of having matrices, vectors and
quaternions and such.
Gareth Charnock
Lars T
wrote:
On 04/15/2010 01:49 PM, Gareth Charnock wrote:
As a side effect of my PhD project I've got a collection of mathematical
classes. I'd be happy to collect them together, tidy them up and donate
them to phobos the authors are interested in including them. Matrices
and vectors in particular get
of functionality be useful for phobos? At the moment, I
can't promise anything, I'm just trying to judge the interest should I
find time to look into it.
Gareth Charnock
I think this bug has been squished as well. Both test cases now compile
fine.
http://d.puremagic.com/issues/show_bug.cgi?id=3694
Walter Bright wrote:
Lots of meat and potatoes here, and a cookie! (spelling checker for
error messages)
http://www.digitalmars.com/d/1.0/changelog.html
dave eveloper wrote:
Ezneh Wrote:
So, it is not better to find a compromise between these libraries ?
Why they have to be two libraries rather than one which was designed by
larsivi, Walter Bright and Andrei Alexandrescu ?
I haven't seen larsivi around lately. Is it possible that there's a
Mike Parker wrote:
Walter Bright wrote:
Yigal Chripun wrote:
I've thought about building such a system for these forums many times.
Registration would not be required to post, but registering would
enable
features like voting on posts, establishing a profile, preferences,
etc.
That sounds
Yes it is possible and you don't even have to mess about with chroot. I
think the package you're looking for is ia32-libs. This is my dmd.conf file:
[Environment]
dflags=...@p%/../../src/phobos -...@p%/../../src/druntime/import
-l...@p%/../lib -L-L/lib32 -L-L/usr/lib32
I think the important
I was looking at the std.signals code in svn to find out how the magic
of the observer class not needing to inherit anything was done and I was
somewhat disappointed to see rt_attachDisposeEvent. Is this function
standardised or exposed anywhere? I can think of cases where being able
to listen
Bernard Helyer wrote:
On 11/12/09 10:48, Gareth Charnock wrote:
Is there any way to tell dmd
to just share them between threads?
__gshared type whatever;
Thanks. And now I see there was an article about that on website all
along. I guess my eyes must have just scanned over it. A good
I've been trying to link a d program to a c library (ncurses in this
case) on ubuntu 9.10 with dmd v2.036. Converting curses.c to a .d header
seemed to go okay when I try to link the files together I get this:
dmd -c main.d
dmd -c curses.d
dmd main.o curses.o -L/usr/lib/libncurses.a
53 matches
Mail list logo