On Wed, 30 Nov 2011 23:35:58 -, NMS nathanms...@gmail.com wrote:
Is there a cross-platform way to create a new process and get its i/o
streams? Like java.lang.Process?
No. It different on windows and unix platforms, tho most/many of the unix
platforms are similar.
std.process is
NMS wrote:
Is there a cross-platform way to create a new process and get its i/o
streams? Like java.lang.Process?
I doubt. However, you can use platform-specific popen() (POSIX) and _popen()
(Windows) for that. I recently talked about this on IRC. At the moment
Phobos uses system() ,
On 03/11/2011 23:58, Lishaak Bystroushaak wrote:
Hello.
Is there any way how to format date with formating strings?
snip
Yes. See the datetime stuff in
http://pr.stewartsplace.org.uk/d/sutil/
Stewart.
I can't find my thread in the archives yet, but I made a similar
inquiry a few days ago.
You can see a few examples for Windows here:
https://github.com/AndrejMitrovic/DWinProgramming/tree/master/Samples/Extra/RedirectChildHandle
On 04/11/2011 00:51, Jonathan M Davis wrote:
On Thursday, November 03, 2011 16:58 Lishaak Bystroushaak wrote:
Hello.
Is there any way how to format date with formating strings? Something
like strftime in python;
http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior
Not
We talked about that too on IRC - the conclusion was - we should have
std.pipe module with (at least) AnonymousPipe, and NamedPipe classes.
On Thu, 01 Dec 2011 11:28:50 -, Dejan Lekic dejan.le...@gmail.com
wrote:
We talked about that too on IRC - the conclusion was - we should have
std.pipe module with (at least) AnonymousPipe, and NamedPipe classes.
Definitely. I will have a hunt for my misplaced code but it had some sort
On Thu, 01 Dec 2011 11:29:52 -, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
I can't find my thread in the archives yet, but I made a similar
inquiry a few days ago.
You can see a few examples for Windows here:
On 12/1/11, Regan Heath re...@netmail.co.nz wrote:
I know these are basic examples, but I think in RedirectChildHandle.d,
CreateChildProcess, you should (ideally) be closing childStdoutWrite and
childStdinRead /after/ CreateProcess. If you don't you get 2 copies of
them, one in the child and
On 12/1/11, Regan Heath re...@netmail.co.nz wrote:
you should (ideally) be closing childStdoutWrite and
childStdinRead /after/ CreateProcess. If you don't you get 2 copies of
them, one in the child and one in the parent.
Ok so I should move CloseHandle(childStdoutWrite) immediately after a
On Thu, 01 Dec 2011 06:10:00 -0500, Regan Heath re...@netmail.co.nz
wrote:
On Wed, 30 Nov 2011 23:35:58 -, NMS nathanms...@gmail.com wrote:
Is there a cross-platform way to create a new process and get its i/o
streams? Like java.lang.Process?
No. It different on windows and unix
On Thu, 01 Dec 2011 08:24:25 -0500, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Thu, 01 Dec 2011 06:10:00 -0500, Regan Heath re...@netmail.co.nz
wrote:
std.process is rather limited in it's current incarnation but I think
Steve is working on a bit update..
It's ready for review,
Ahh, ok. Thank you, that helps quite a bit.
On 12/10/2011 23:41, bearophile wrote:
This code, that a sane language/language implementation refuses at
compile-time, runs:
It's perfectly legal code, so the best a compiler can correctly do is give a warning.
Some C(++) compilers understand printf and will warn if the format string
On Thursday, December 01, 2011 11:28:39 Stewart Gordon wrote:
On 04/11/2011 00:51, Jonathan M Davis wrote:
On Thursday, November 03, 2011 16:58 Lishaak Bystroushaak wrote:
Hello.
Is there any way how to format date with formating strings? Something
like strftime in python;
Ok, starting to feel like I'm missing something obvious...
The abstract keyword in the language reference states:
Functions declared as abstract can still have function bodies. This
is so that even though they must be overridden, they can still
provide �base class functionality.�
So, they must
On Thu, 01 Dec 2011 17:50:48 -, Adam a...@anizi.com wrote:
Ok, starting to feel like I'm missing something obvious...
This:
void main() {
Child child = new Child;
}
also produces the (expected) error. Basically dmd was letting you get
away with the abstract class
I saw that a few minutes after posting as well, but if the only time
it's going to actually check the definition is if I instantiate it,
well... that's not so good for me if I'm writing implementations to be
used at a later date.
Hm. Guess we'll see. :)
On Thu, 01 Dec 2011 18:50:48 +0100, Adam a...@anizi.com wrote:
Ok, starting to feel like I'm missing something obvious...
The abstract keyword in the language reference states:
Functions declared as abstract can still have function bodies. This
is so that even though they must be overridden,
On Thu, 01 Dec 2011 12:58:24 -0500, Regan Heath re...@netmail.co.nz
wrote:
On Thu, 01 Dec 2011 17:50:48 -, Adam a...@anizi.com wrote:
Ok, starting to feel like I'm missing something obvious...
This:
void main() {
Child child = new Child;
}
also produces the
I can see the case for a grand-child, but if a class does not provide
a definition for an abstract member, is that class not, by
association, abstract?
Classes become abstract if they are defined within an abstract
attribute, or if any of the virtual member functions within it are
declared as
Because the function in this case has no definition in the base
abstract class (Parent), but is referenced / called by Parent's
members. I did not want Parent to provide a default definition for the
function precisely because a large point of the abstract was that
method.
On Thu, 01 Dec 2011 19:19:49 +0100, Adam a...@anizi.com wrote:
I can see the case for a grand-child, but if a class does not provide
a definition for an abstract member, is that class not, by
association, abstract?
Of course. That's what I said. Or meant, at any rate.
Classes become
Is there an easy way to profile DMD similar to how DMD itself has
the -profile switch?
On 12/01/2011 07:42 PM, Nick Sabalausky wrote:
Is there an easy way to profile DMD similar to how DMD itself has
the -profile switch?
Use DMC, I guess. http://www.digitalmars.com/ctg/trace.html
Makeshift terrible implementation:
import std.range;
int[][] split(int[] src, int parts)
{
int[][] result;
int len = src.length / parts;
int iter;
while (!src.empty)
{
if (iter == parts-1)
{
result ~= src[];
break;
}
Found it: std.range.chunks
Hello again!
A third question on D:
Is there an argument type I can provide for a method signature
which would require a user to provide classinfo or a class name for
a class of a particular type?
That is, suppose I have a Class called Fruit.
Is there some constraint I can impose, either in the
Nevermind - sorry for the clutter.
For those who are apparently as dense as I am, this can be roughly
accomplished via Template specialization:
class Fruit {}
class Apple : Fruit {}
class Celery {}
void mustBeFruit(T : Fruit)() {
writeln(T.classinfo.name);
}
void main() {
.classinfo is for getting information about an object at __runtime__.
For the example given here, you don't even need templates:
void mustBeFruit(Fruit fruit)
{
writeln(fruit.classinfo.name);
}
Since Apple, Banana, and Orange inherit from Fruit, they __are__ Fruit and
can be passed to
I'm finding std.json extremely well written, with one glaring exception.
I can't seem to figure out how to do this:
JSONValue root = JSONValue(null, JSON_TYPE.OBJECT);
root.object[first_object] = JSONValue(null, JSON_TYPE.OBJECT);
root.object[first_string] = JSONValue(first_string,
On Thu, Dec 01, 2011 at 03:45:35PM -0700, Kai Meyer wrote:
I can't seem to figure out how to do this:
You might do it with a template that goes
through various types.
Check out web.d in here:
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/
and search for
On Thursday, December 01, 2011 22:33:00 Stewart Gordon wrote:
On 01/12/2011 16:44, Jonathan M Davis wrote:
On Thursday, December 01, 2011 11:28:39 Stewart Gordon wrote:
snip
I could've sworn it was you I was talking to about the stuff in my
library before. Are you an imposter?
Why
Ah; I should have clarified - I didn't want an *instance* of the
class, just to be able to restrict the signature or use of a method to
provide class info specific to a type of class.
On 01/12/2011 22:57, Jonathan M Davis wrote:
snip
There's a halfway decent chance that I posted in this thread prior to reading
anything about your library or before I looked at it at all.
And both Lishaak's and your computers had their clocks set several days fast at
the time?
Stewart.
On Friday, December 02, 2011 00:00:09 Stewart Gordon wrote:
On 01/12/2011 22:57, Jonathan M Davis wrote:
snip
There's a halfway decent chance that I posted in this thread prior to
reading anything about your library or before I looked at it at all.
And both Lishaak's and your computers
Stewart Gordon:
It's perfectly legal code,
If that code is legal, then in my opinion it's the rules of the language that
are wrong and in need to be changed :-)
Some C(++) compilers understand printf and will warn if the format string
doesn't match the arguments, but even this is rare AIUI.
On 2011-12-01 19:18, Steven Schveighoffer wrote:
On Thu, 01 Dec 2011 12:58:24 -0500, Regan Heath re...@netmail.co.nz
wrote:
On Thu, 01 Dec 2011 17:50:48 -, Adam a...@anizi.com wrote:
Ok, starting to feel like I'm missing something obvious...
This:
void main() {
Child child = new Child;
On 2011-12-01 19:14, Simen Kjærås wrote:
On Thu, 01 Dec 2011 18:50:48 +0100, Adam a...@anizi.com wrote:
Ok, starting to feel like I'm missing something obvious...
The abstract keyword in the language reference states:
Functions declared as abstract can still have function bodies. This
is so
39 matches
Mail list logo