The following code fails to compile:
double sim(Document doc, string query)
{
alias Tuple!(double, wij, double, wiq) Weights;
Document q = Document.fromString(query);
Weights[] wi;
foreach (s; StrFilt(query))
wi ~= Weights(doc.termFreq(s) *
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Pillsy wrote:
Hi, all,
I was wondering if there's any way to determine at compile time
whether a struct has a (non-trivial) destructor associated with it,
and whether there's any way to call that destructor without using
the delete operator. It
== Quote from div0 (d...@users.sourceforge.net)'s article:
[...]
Most important is this one, which scuppers any change of doing
a shared ptr like struct:
http://d.puremagic.com/issues/show_bug.cgi?id=3516
Yeah, that basically kills the idea until the bug is fixed. :(
Once it is, I think a
Thank you, I had no idea that scope was doing this.
I thought that when the docs said that it was being allocated on the stack
that I was getting struct like behavior.
Simen kjaeraas simen.kja...@gmail.com wrote in message
news:op.vc0qlpjovxi...@biotronic-pc.home...
| Larry Luther
div0 wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Pillsy wrote:
Hi, all,
I was wondering if there's any way to determine at compile time
whether a struct has a (non-trivial) destructor associated with it,
and whether there's any way to call that destructor without using
the delete
bearophile bearophileh...@lycos.com wrote in message
news:ht4g3r$vu...@digitalmars.com...
| Larry Luther:
|
| I did not get an error when building and running with DMD 2.042:
|
| I am using dmd v2.046, and I have taken the good habit of compiling
with -w (warnings on).
| It seems this error I
Larry Luther:
I'm nonplussed. Could you expand on why D class instances don't need to copy
their contents and instances of D structs do? While migrating C++ code to D
I've had to convert structs to classes because of the need for inheritance.
Why would the need to copy an instance's contents
Larry Luther:
Ok, I've added -w to compilation commands and I've switched back to pure text.
Good :-)
What am I missing?
I have modified a bit your D code like this, to have something with a main()
that runs:
import std.c.stdio: puts;
class A {
int x, y;
void copy(const A a) {
See:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.Darticle_id=110554
bearophile bearophileh...@lycos.com wrote in message
news:ht4krg$17l...@digitalmars.com...
| On the base of your long experience do you like D so far?
There are many things that I like and I strongly agree with the failings
of C++ mentioned in the docs. I don't like the asymmetry between
Larry Luther:
There are many things that I like and I strongly agree with the failings
of C++ mentioned in the docs.
D is designed by people that have a good experience of C++, but while probably
D avoids some C++ problems, it surely introduces a number of new issues :-)
I don't like the
On Thu, 27 May 2010 17:04:35 -0400, Larry Luther larry.lut...@dolby.com
wrote:
bearophile bearophileh...@lycos.com wrote in message
news:ht4krg$17l...@digitalmars.com...
| On the base of your long experience do you like D so far?
There are many things that I like and I strongly agree with
Steven Schveighoffer:
I have hoped that at some point, structs can be auto-composed,
without a vtable, but you still have to do this manually.
I don't understand what you mean here :-)
Bye,
bearophile
bearophile wrote:
Larry Luther:
Ok, I've added -w to compilation commands and I've switched back to pure text.
Good :-)
What am I missing?
I have modified a bit your D code like this, to have something with a main()
that runs:
import std.c.stdio: puts;
class A {
int x, y;
On Thu, 27 May 2010 17:47:20 -0400, bearophile bearophileh...@lycos.com
wrote:
Steven Schveighoffer:
I have hoped that at some point, structs can be auto-composed,
without a vtable, but you still have to do this manually.
I don't understand what you mean here :-)
I mean simple
On Thu, 27 May 2010 18:41:19 -0400, bearophile bearophileh...@lycos.com
wrote:
Thank you Steven for your explanations, I have done similar things in C
and D, but I didn't understand what you meant.
A is always put first, that way, a pointer to a B can always be used as
a pointer to an A.
16 matches
Mail list logo