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
Jason House wrote:
I was chatting on #gdb earlier today and it sounds like getting a patch for the
d programming language into gdb shouldn't be too bad. There's a patches
mailing list and some kind of paperwork to resolve copyright issues.
Is there any legal/copyright issues that prevent the
Lars Ivar Igesund wrote:
druntime should certainly not become any bigger (in scope), as that would
defeat the purpose of separating the runtime from userspace in the first place.
The topic of common userspace functionality should be kept separate from the
topic of druntime.
Okay, how about
Bill Baxter wrote:
It's not?
foreach(i; things) {
if (i==a) continue;
if (i==b) break;
if (i==d) return;
if (i==c) goto somewhere;
}
Those are all fairly common things to do from inside the 'dg' call.
The int is how the compiler distinguishes which case got you out of
Ary Borenszweig wrote:
If the compiler can transform a foreach into an opApply call, passing
the foreach body and converting breaks to return 1 statements... can't
opApply be specified as:
int opApply(void delegate(ref uint) dg) { // note: delegate returns void
}
and the compiler transforms
dsimcha wrote:
Every once in a while, it comes up on this NG that a significant limitation of
templates is that they can't add virtual functions to classes. Of course,
removing this limitation for the general case is impossible w/o completely
changing the compilation model in ways that are bad
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:
void iterateOverArray(T)(T[] arr){
foreach (i; 0..arr.length)
yield(arr[i]);
}
Coroutines are the slowest option, but the easiest to write. It takes 32
instructions or so to switch to or from a coroutine on x86. I'm not sure
how that translates in terms of memory
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
Andrei Alexandrescu wrote:
John Reimer wrote:
The danger, of course, is that Tango will not be taken seriously again
for D 2.0. If Tango manages to garner the lion-share of popularity as
they did with D 1.0 (LDC compiler suite is one example of the
significant sway Tango has had on D 1.0 ),
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
bearophile wrote:
Nick Sabalausky:
Isn't that kind of a common thing with profilers in general?
Any physical measure alters the thing to be measured, but with a good enough
brain you can generally invent ways to decrease such alteration to tolerable
levels. So it's a matter of inventing
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
Benji Smith wrote:
Nick Sabalausky wrote:
John Reimer terminal.n...@gmail.com wrote in message
news:28b70f8c119528cb42154f5d1...@news.digitalmars.com...
Hello Nick,
But, of course, adjectives (just like direct/indirect objects) are
themselves nouns.
Umm... May I make a little correction
Miles wrote:
-
int func1() { return 1; }
auto a = func1; // 'a' is a pointer to func1
auto b = func1;// ERROR, or deprecated way of above
auto c = func1(); // calls func1 and returns int 1
int function() func2 = func1;
Walter Bright wrote:
Christopher Wright wrote:
Stewart Gordon wrote:
Stewart Gordon wrote:
snip
Walter, before you go and implement any of this, I must point out
that it's spelt memorization and memorize. (Or memorisation
and memorise if you're British, but that's an aside.)
Or maybe
Denis Koroskin wrote:
On Thu, 08 Jan 2009 03:45:08 +0300, Vishaal vish...@nospam.com wrote:
Properties, such as array.length, should return lvalues to allow:
a.length += 8;
or other similar statements.
I'd like to point out another related issue that everyone seems to miss.
snip struct
Bill Baxter wrote:
But the call for a memoization thingy I just don't get. No way that
should be a compiler feature, just far too many ways to memoize with
too many different tradeoffs. And a memoizing wrapper function
basically loses nothing in terms of expressiveness.
--bb
The ability for
Björn T. Herzig wrote:
where can I get that version? I'm currently using dmd_2.014-052208_i386.deb
from the download page. never saw a newer version. Right now my only
possibility to use D is inside of an ubuntu vm which is not really the greatest
way... i'd really like to know if dmd will be
Stewart Gordon wrote:
Stewart Gordon wrote:
snip
Walter, before you go and implement any of this, I must point out that
it's spelt memorization and memorize. (Or memorisation and
memorise if you're British, but that's an aside.)
Or maybe not...
http://en.wikipedia.org/wiki/Memoization
Nick Sabalausky wrote:
Lurker lur...@mailinator.com wrote in message
news:gkanpu$2l9...@digitalmars.com...
Design by Contract is a registered trademark[1] of Interactive Software
Engineering, Inc. in the United States
http://en.wikipedia.org/wiki/Design_by_contract
Does Digital Mars has
Nick Sabalausky wrote:
I have a need for an inexpensive (preferably freeware or open-source,
obviously), alternate to using XML and an XML viewer (such as MindFusion's
XML Viewer). The main problem with XML is that I need something that will
allow node names to contain any arbitrary text
Weed wrote:
Who agrees with me? There are still ideas as it is possible to solve
this problem and not to destroy language?
When you reply to your reply to your reply to your post and nobody else
replies to any of your posts, you might start thinking that nobody
agrees with you, or cares
Don wrote:
Daniel Keep wrote:
Chad J wrote:
Cool, but don't name it FixedInt unless it implements fixed point
arithmetic.
Fine, but don't name it 'Integer' or 'Int' unless it can store any
value in the set of integers; you know, the infinite one that doesn't
have that stupid 1 + T.max =
Don wrote:
Some observations based on the use cases to date:
(1)
a += b is ALWAYS a = a + b (and likewise for all other operations).
opXXXAssign therefore seems to be a (limited) performance optimisation.
The compiler should be allowed to synthesize += from +. This would
almost halve the
Don wrote:
The creation of temporaries during expressions is something I'm
currently working on solving. The case you mentioned is addressed by a
proposal I made long ago:
The easiest way is to add an intermediate struct. This takes a fair bit
of manual effort, though, and prevents you from
mastrost wrote:
So why is this code accepted by the compiler?
I'm not sure whether it's intentional, but a pure function is correct
for mutable input as well as invariant input (barring threading issues),
so this avoids code duplication.
Andrei Alexandrescu wrote:
Well I'm not going to continue this asinine but you said this/but I
didn't mean that exchange as it's a waste of your time and mine, to say
nothing about that Christmas spirit.
On Christmas day you can't get sore. Your fellow man you must adore.
There's time to rob
Weed wrote:
It not syntactic sugar. I suggest not to waste time at all performance
on run-time initialization of objects and check of side conditions on a
course of performance of the program.
Sorry, syntactic sugar and some minor optimizations.
Don wrote:
There's been some interesting discussion about operator overloading over
the past six months, but to take the next step, I think we need to
ground it in reality. What are the use cases?
I think that D's existing opCmp() takes care of the plethora of trivial
cases where , = etc are
Nick Sabalausky wrote:
Yigal Chripun yigal...@gmail.com wrote in message
news:gj6e3m$1il...@digitalmars.com...
two things:
a) current hardware is 64bit (if you go and buy a PC),
Ah ha, there's that usual if you go and buy a PC catch. Which begs the
question, why would I? My existing system
Tim Keating wrote:
Supporting .net would give you access to the most modern and probably
best-currently-supported Windows API. It would, if you counted Mono, add a very
nice cross-platform UI framework. Finally, depending on what version was
supported, it might enable you to write Silverlight
Denis Koroskin wrote:
Slightly off-topic.
How would you implement, say, LIKE condition? Similar to the following, perhaps:
Query query = Select(a).Where(id.Like(%substring%));
You could implement == the same way:
Query query = Select(a).Where(id.EqualsTo(5));
downs way:
auto query1 =
John Reimer wrote:
Hello Derek,
Just thinking out aloud ...
If two modules import each other and this can be 'fixed' by instead
having both modules as a single module, what is stopping the compiler
from just pretending that they are a single module for compilation
purposes?
This does assume
Tim M wrote:
I dont think the allround ide is a problem anymore with eclipse
available. Whats missing is a good gui builder. If you know of one other
than entice though can you please reply with the links.
No top-posting, please.
I use Glade. It works reasonably well for small projects.
BCS wrote:
Reply to Ary,
And a question: what would you like to see next in Descent?
Better template support. I now have 2 libs that are just flat uneditable
under descent (scrapple.units and scrapple.dparse) both bring it down to
a stand still if not crash and hand it out right. I'd love
dsimcha wrote:
== Quote from Christopher Wright (dhase...@gmail.com)'s article
It means that you can't use one block for objects of multiple types.
Sure you can, without being any worse off than under the current scheme. Mark
the
contents of the memory as an array of void*s. This would
Jim Hewes wrote:
Maybe it's better to think of memory and non-memory resources as different
things and handle them differently as opposed to lumping them together using
the same mechanism. I'm not sure if there is already a way to deal with this
in D as I'm not quite that familiar with D.
It
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
dsimcha wrote:
== Quote from Sean Kelly (s...@invisibleduck.org)'s article
== Quote from Christopher Wright (dhase...@gmail.com)'s article
This isn't unreasonable, and it really just depends on how complete and
how fast D's runtime reflection is.
This would incur more memory overhead as well
Brad Roberts wrote:
However, since it really is a pub/sub system, it'd be interesting to look
for interesting one - many programatic use cases that could take
advantage of it.
I'm looking into creating a service bus with twitter as its transport
mechanism. Unfortunately, I think it won't be
Jim Hewes wrote:
Yes. Thanks for the example. I do that sort of thing a lot, and it
applies to anything with a handle such as mutexes, files, etc. In
garbage-collected languages, what am I supposed to do there? It would
seem that garbage collection and exceptions don't play nice together. Or
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
Nick Sabalausky wrote:
I'd rather have a type that all other types derive from. Sort of like
Object (or is it object?), but serves as the base type for all types,
not just classes. Not sure if this would be possible though (having vtables
for every int and char in the program doesn't sound
Ary Borenszweig wrote:
Jarrett Billingsley escribió:
On Sun, Dec 7, 2008 at 7:12 AM, Ary Borenszweig [EMAIL PROTECTED]
wrote:
definition of toString that does match. Most of the time ADL leads to
confusing behavior, which is why it was dropped in D.
But the overloading is obvious! It looks
Sergey Gromov wrote:
Not correct. C++ uses the same rules to build overload sets as D. That
is, a function declaration in an inner scope hides any function
declarations with the same name in outer scopes. I /think/ there should
be a good rationale behind this design.
I've been using C++
Fawzi Mohamed wrote:
So yes one could probably switch back to the old Phobos style.
I would guess that it is not really a common situation for a program to
become single threaded again, though...
Fawzi
At work, we have a single-threaded application -- everything happens on
the GUI thread.
Gregor Richards wrote:
I ran into a situation where I needed (essentially) the visitor pattern, but
the visitor pattern sucks, so I wanted to make something like class extensions
instead (that is, methods added to a class outside of the class definition).
I usually use this pattern but make
Nick Sabalausky wrote:
Christopher Wright [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Nick Sabalausky wrote:
On a side note, stack overflows are still possible anyway (whether
functional or imperative). Is there a reason (other than inertia) that
stack frames aren't set up like
Justin wrote:
Ahh, I thought it would some stupid oversight on my part. This works:
module functionliteral;
import std.stdio;
static void main() {
int[] values = [1,2,4,8];
writefln(Reduce(values, function int(int x, int y) { return x + y; }));
writefln(Reduce(values,
Nick Sabalausky wrote:
On a side note, stack overflows are still possible anyway (whether
functional or imperative). Is there a reason (other than inertia) that stack
frames aren't set up like a dynamic array to grow as needed? (Of course, I
can understand not doing that during a debug build
BCS wrote:
Reply to Tomas,
The problem is that B has two vtables that implement the interface I.
However, in A.addChild, i.parent get's the first one (introduced by
A), and in main, it gets the second one (J , which derived from I).
The identity check then fails because the pointers aren't the
bearophile wrote:
Christopher Wright Wrote:
I don't know what this is doing. That code fragment won't compile, and
it isn't showing usage.
Sorry:
struct _add { T opCall(T.init + T.init)(T x) { return x+x; } }
_add add;
Now you can give it to a function, without the need of specializing
bearophile wrote:
But at the moment I haven't found ways to unit test the first two static
asserts, so I just put tests in the unittest for them, and I comment them out
to make the unittest run.
assert (!is (typeof (nest(1, 1, 1; // int is not callable
If you're using d2:
assert
Tony wrote:
On libraries:
I am replacing (lots done already) the C++ std library. It's icky.
You must be a bored masochist.
Bill Baxter wrote:
On Sun, Nov 23, 2008 at 3:25 PM, Jarrett Billingsley
[EMAIL PROTECTED] wrote:
On Sat, Nov 22, 2008 at 11:40 PM, Sam S E [EMAIL PROTECTED] wrote:
Does foreach use delegates? Isn't that unnecessary overhead?
--Sam
It does use delegates, for iterating over most types. When
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.
dsimcha wrote:
== Quote from bearophile ([EMAIL PROTECTED])'s article
D is a fringe language, and it's not an easy one (system language and all that),
so there's never shortage of unusual people in this newsgroup :-)
Java groups are so boooring compared to this one :-)
Bear hugs,
bearophile
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 =
Marcin Kuszczak wrote:
Please remember that I am not saying that entities are solution for everything. I am just saying that in many cases (most?) it is sufficient enough to use entities instead objects. Especially when you have to use data in presentation layer.
In my program I needed graph
Marcin Kuszczak wrote:
Christopher Wright wrote:
Aarti_pl wrote:
...and this high-level design is IMHO mistake. Especially mapping
relations from db to objects.
Well maybe someone will give me examples where domain objects are more
useful than relations? From my observations presentation
Aarti_pl wrote:
dolive pisze:
the ddbi progress is too really slow, difficult to look forward toĄŁ
data nucleus is more high-level like Hibernate.
...and this high-level design is IMHO mistake. Especially mapping
relations from db to objects.
Well maybe someone will give me examples where
Walter Bright wrote:
Christopher Wright wrote:
Even better, will the large body of existing bugs ever be fixed?
10 to 20 get fixed every release.
True, sorry. I just tend to run into a few of them consistently that
haven't gotten in yet.
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
Introducing DUnit 0.2, with even more inconsistent capitalization!
Wow, it's been ages. I've been working off trunk so long I didn't
realize there was a 0.1 release.
Wow.
We've come a long way in the past eight months. About as long as I could
have come in two weeks, if I were paying
401 - 471 of 471 matches
Mail list logo