On Tuesday 02 November 2010 15:02:04 Jesse Phillips wrote:
> Steven Schveighoffer Wrote:
> > It does not say that functions should be callable without parentheses,
> > because that mis-feature is deprecated. Essentially, to someone who is
> > new to D, there is no need to mention the historical fe
T.D.Spense:
> public TagNode(String name){
> this.name = name;
> this.children = new ArrayList(1);
> }
>
> public TagNode(String name, Node... children){
> this.children = Arrays.asList(children);
> for (Node child : children) {
> child.pare
Thanks,
The problem was that mciSendString was immediately returning control
to the caller after being called. This simple change fixed the
problem:
mciSendString("play myFile wait");
I'll reply to several posts at once.
The code comments you quoted weren't meant as a criticism. They are mostly notes
to myself in case I want to document my learning experience with D on some
personal website no one ever visits. I'll post criticisms separately if/when I
have any. :)
When I was s
On Tuesday, November 02, 2010 14:14:22 spir wrote:
> On Tue, 2 Nov 2010 12:47:21 -0700
>
> Jonathan M Davis wrote:
> > If they don't have the property attribute, then they won't work without
> > parens (and in fact, you won't be able to use parens with them). That is
> > how it's outlined in TPDL
Steven Schveighoffer Wrote:
> It does not say that functions should be callable without parentheses,
> because that mis-feature is deprecated. Essentially, to someone who is
> new to D, there is no need to mention the historical features of D. It
> does say that you need to put @property o
spir Wrote:
> On Tue, 02 Nov 2010 12:33:16 -0400
> Jesse Phillips wrote:
>
> > spir Wrote:
> >
> >
> > > * Why does D allow me redefining (data) slots in the subclass OddSquares,
> > > which exist in the superclass? (I did this first without noting, by copy
> > > & paste ;-)
> >
> > This is
On Tue, 02 Nov 2010 15:58:51 +0100, Don wrote:
> Jesse Phillips wrote:
>> I thought there was a Bug report on this, but I guess not. I say report
>> it. Ether it should compile or the compiler should error that a
>> constructor can not be nothrow.
>
> This has already been fixed in svn, and will
On Tue, 2 Nov 2010 12:47:21 -0700
Jonathan M Davis wrote:
> If they don't have the property attribute, then they won't work without
> parens
> (and in fact, you won't be able to use parens with them). That is how it's
> outlined in TPDL (The D Programming Language by Andrei Alexandrescu).
> H
On Tue, 02 Nov 2010 16:52:38 -0400, Jesse Phillips
wrote:
Steven Schveighoffer Wrote:
On Tue, 02 Nov 2010 15:54:13 -0400, Jesse Phillips
wrote:
> Calling functions without () is a legacy feature left over which is
how
> D use to do properties. Some will say this is going to be removed,
On Tue, 02 Nov 2010 16:35:39 -0400, spir wrote:
On Tue, 02 Nov 2010 12:33:16 -0400
Jesse Phillips wrote:
spir Wrote:
> * Why does D allow me redefining (data) slots in the subclass
OddSquares, which exist in the superclass? (I did this first without
noting, by copy & paste ;-)
This i
Steven Schveighoffer Wrote:
> On Tue, 02 Nov 2010 15:54:13 -0400, Jesse Phillips
> wrote:
>
> > Calling functions without () is a legacy feature left over which is how
> > D use to do properties. Some will say this is going to be removed, but
> > do not recall this ever being said (only th
On Tue, 02 Nov 2010 12:33:16 -0400
Jesse Phillips wrote:
> spir Wrote:
>
>
> > * Why does D allow me redefining (data) slots in the subclass OddSquares,
> > which exist in the superclass? (I did this first without noting, by copy &
> > paste ;-)
>
> This is either a bug or so that you don't
On Tue, 02 Nov 2010 15:54:13 -0400, Jesse Phillips
wrote:
Calling functions without () is a legacy feature left over which is how
D use to do properties. Some will say this is going to be removed, but
do not recall this ever being said (only that it was implied it would
happen if propert
Jonathan M Davis Wrote:
> I should point out that you forgot the save property, which is required for
> forward ranges (though not input ranges). Without it, any algorithm which
> processes the range will consume it.
Trying to ease this guy into ranges.
I did notice though, the InputRange int
spir Wrote:
> Hello,
>
> Is the D way to make read-only symbols (of a class, struct, module) to write
> a getter for a private symbols?
Yes, though it isn't like the getValue() from java.
@property int i() {return this.my_i;}
> Additional question: just realised one can omit () on func calls
On Tuesday 02 November 2010 12:33:41 spir wrote:
> Hello,
>
> Is the D way to make read-only symbols (of a class, struct, module) to
> write a getter for a private symbols?
>
> Additional question: just realised one can omit () on func calls! Is this
> systematic when a func has no param? I thoug
Hello,
Is the D way to make read-only symbols (of a class, struct, module) to write a
getter for a private symbols?
Additional question: just realised one can omit () on func calls! Is this
systematic when a func has no param? I thought it was not the case, because it
does not work with writel
I did some experiments using shared and I came across this problem:
-
struct Test
{
void test() {}
shared void test2()
{
(cast(Test)this).test();
}
void opCall() {}
}
void main()
{
shared
On Tuesday, November 02, 2010 09:33:16 Jesse Phillips wrote:
> spir Wrote:
> > * Why does D allow me redefining (data) slots in the subclass OddSquares,
> > which exist in the superclass? (I did this first without noting, by copy
> > & paste ;-)
>
> This is either a bug or so that you don't have n
On Tuesday, November 02, 2010 04:16:58 spir wrote:
> On Mon, 1 Nov 2010 20:40:30 -0700
>
> Jonathan M Davis wrote:
> > The term "pop" does _not_ mean that an element is returned but that it is
> > removed from the range. This is true for pretty much anything that uses a
> > pop function in any la
spir Wrote:
> * Why does D allow me redefining (data) slots in the subclass OddSquares,
> which exist in the superclass? (I did this first without noting, by copy &
> paste ;-)
This is either a bug or so that you don't have name clashes with all the super
classes (could really reduce the avai
On Tue, 02 Nov 2010 10:39:27 -0400
Jesse Phillips wrote:
> I'll come back with a more complete answer latter, but first.
>
> spir Wrote:
>
> > * I wrote Range as class, but I rather meant an interface. D does not let
> > me do that, apparently because there is no data slot in a D interface. Is
Jesse Phillips wrote:
I thought there was a Bug report on this, but I guess not. I say report it.
Ether it should compile or the compiler should error that a constructor can not
be nothrow.
This has already been fixed in svn, and will be in the next release. See
bug 3020.
nothrow is painful
I'll come back with a more complete answer latter, but first.
spir Wrote:
> * I wrote Range as class, but I rather meant an interface. D does not let me
> do that, apparently because there is no data slot in a D interface. Is then
> an interface a kind of data-less superclass? Or is there somet
Hello,
After the exchanges on ranges, I am experimenting around this notion as a way
to learn about D classes, subclassing, generics, etc...
In the code below, there are three obscure points for me:
* I wrote Range as class, but I rather meant an interface. D does not let me do
that, apparentl
On Sun, 31 Oct 2010 02:51:53 -0400, Don wrote:
nothrow actually prevents you from throwing anything. A nothrow function
may still perform operations which may throw a compiler-generated Error.
(eg, AssertError, OutOfMemoryError).
It's only a spec change which is required.
I think you meant
On Mon, 01 Nov 2010 03:50:12 -0400, Andreas Kaempf
wrote:
Hey folks!
Please enlight me with that prefix notation of 2-dimensional arrays! I
prepared a snippet giving me headaches:
auto int[2][3] test = [[11,12],[21,22],[31,32]];
foreach (x, row; test)
{
Stdout.format("x={}: ", x+1);
On Sun, 31 Oct 2010 19:20:04 -0400, bearophile
wrote:
Simen kjaeraas:
They take both, in fact:
auto cubes = map!((a){ return a*a*a; })(arr);
But that needs to be compile-time constant, so if you have several
functions, you need to put them inside a typetuple, or duplicate the
code. A
Nick Voronin:
> On yet another topic :) Is there alternative to stream.readf? Somehow while
> searching for explanation of unexpected behavior I got the idea that readf
> and streams considered to be second-class citizens in world of D and they are
> not a proper way to do things, so no one rea
On Mon, 1 Nov 2010 20:40:30 -0700
Jonathan M Davis wrote:
> The term "pop" does _not_ mean that an element is returned but that it is
> removed from the range. This is true for pretty much anything that uses a pop
> function in any language - stacks, lists, etc. It _is_ true that many
> implem
Hello.
I'm new to D and I stumbled upon something strange about readf while writing
some test code.
The code:
import std.stream;
import std.stdio;
int main(char[][] args)
{
string input = "2abc";
auto memstream = new TArrayStream!(string)(input);
int x;
memstrea
Hello all,
I would really appreciate some assistance on this. The intent is to
create a vocabulary/flashcard program with proper pronunciations.
Pronunciations are saved as individual mp3 files which I want to
play whenever a new term is displayed. My current attempt is simply
to get the the file
33 matches
Mail list logo