On Mon, 06 Sep 2010 05:32:28 +0900, Nick Sabalausky wrote:
This may be a stupid question:
Does std.socket encorporate or replace pipe usage? Ie, if I'm going to do
something along the lines of (psuedo-code):
auto parentToChild = pipe();
auto childToParent = pipe();
if(fork())
{
// talk to
On 09/07/2010 12:44 AM, bearophile wrote:
Andrej Mitrovic:
I'm sorry, but what does q{..} mean?
q{} is just a different syntax to write "" or ``
It's a controversial feature. q{} isn't recognized by editors as a string, so
they colour the syntax it contains normally as code, and not as a st
On Sun, 05 Sep 2010 09:40:59 -0400, BLS wrote:
On 05/09/2010 02:16, Jonathan M Davis wrote:
void foo(T)(T[] collection, T elem)
{
// Blah, whatever
}
I am curious, how this will look and feel once inout is working ?
inout void foo(T)(inout(T)[] collection, inout T elem)
{
// Bl
On 2010-09-07 14:49, Steven Schveighoffer wrote:
On Sun, 05 Sep 2010 09:40:59 -0400, BLS wrote:
On 05/09/2010 02:16, Jonathan M Davis wrote:
void foo(T)(T[] collection, T elem)
{
// Blah, whatever
}
I am curious, how this will look and feel once inout is working ?
inout void foo(T)(inout
On Sun, 05 Sep 2010 22:41:50 -0400, bearophile
wrote:
Tom Kazimiers:
How can I have a (temporary) dynamic array on stack and make references
to it (no copying)? I successively put integers in an array (but don't
know how much there will be in advance) with an appender!(int[]) and get
the dat
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
"typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function. "
From that I got the impression that the code below would print the same
result,
On Tue, 07 Sep 2010 08:56:15 -0400, Jacob Carlborg wrote:
On 2010-09-07 14:49, Steven Schveighoffer wrote:
On Sun, 05 Sep 2010 09:40:59 -0400, BLS wrote:
On 05/09/2010 02:16, Jonathan M Davis wrote:
void foo(T)(T[] collection, T elem)
{
// Blah, whatever
}
I am curious, how this will l
On 09/07/2010 03:15 PM, Steven Schveighoffer wrote:
On Tue, 07 Sep 2010 08:56:15 -0400, Jacob Carlborg wrote:
On 2010-09-07 14:49, Steven Schveighoffer wrote:
On Sun, 05 Sep 2010 09:40:59 -0400, BLS wrote:
On 05/09/2010 02:16, Jonathan M Davis wrote:
void foo(T)(T[] collection, T elem)
{
Hi all,
What's the best way to find an element into an array, drop it and shrink the
array inplace, in D2?
Thanks in advance, Paolo
Paolo Invernizzi wrote:
Hi all,
What's the best way to find an element into an array, drop it and shrink
the array inplace, in D2?
Thanks in advance, Paolo
T extract( T )( ref T[] haystack, const T element ) {
auto loc = indexOf( haystack, element );
T result = haystack[loc];
On Tue, 07 Sep 2010 09:28:18 -0400, Pelle wrote:
On 09/07/2010 03:15 PM, Steven Schveighoffer wrote:
On Tue, 07 Sep 2010 08:56:15 -0400, Jacob Carlborg wrote:
On 2010-09-07 14:49, Steven Schveighoffer wrote:
On Sun, 05 Sep 2010 09:40:59 -0400, BLS wrote:
On 05/09/2010 02:16, Jonathan M
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
"typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function. "
From that I got the impression that the code below would
07.09.2010 17:00, Jacob Carlborg пишет:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
"typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function. "
From that I got the impression that the
On 09/07/2010 04:33 PM, Steven Schveighoffer wrote:
Yes, a valid return. Your function should be:
void foo(void delegate(const(C) f) const
It helps to understand that inout/const/immutable has NOTHING to do with
code generation, it only has to do with limiting what compiles. For this
reason, an
Hi,
On 09/06/2010 04:55 AM, Jonathan M Davis wrote:
> Static arrays are value types, but dynamic arrays are reference types.
>
> [...]
>
> No array copying takes place anywhere in that program. If you want to
> copy an array, you'd do one of the following
>
> [...]
>
> Passing dynamic arrays to fu
Hi,
thanks for your tests.
On 09/06/2010 04:59 AM, bearophile wrote:
> My first test shows that it may work. But I have to grow the array
> backwards, and push back the array start, because that's how my stack
> grows (using alloca to allocate geometrically bigger chunks). So
> unless you want to
Steven Schveighoffer:
> Note that the new appender uses heap data to store its implementation, so
> it's not as quick as it could be. This is per Andrei's requirement that
> it be a reference type.
Thank you for your answers. But I don't fully understand your answer. Do you
mean it uses the
Paolo Invernizzi:
> What's the best way to find an element into an array, drop it and shrink
> the array inplace, in D2?
Inside the module std.array there is a commented out function that allows to
remove items. I don't know why it is commented out, maybe there is some bug.
You can find the in
Hi all, I have what is I suspect a silly question, but I am having a
total brainfart over this for some reason. I want to read an
arbitrary amount of floats from user input and then perform some
statistics work on them. For some reason, I can't figure out how to
get it to recognise when the user h
I get the following strange message when linking:
==
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 23: No Stack
first.obj(first)
Error 42: Symbol Undefined _D3std5stdio6stdoutS3std5stdio4File
first.obj(first)
Error 42: Symbol Undefin
On Tue, 07 Sep 2010 11:37:20 -0400, Pelle wrote:
On 09/07/2010 04:33 PM, Steven Schveighoffer wrote:
Yes, a valid return. Your function should be:
void foo(void delegate(const(C) f) const
It helps to understand that inout/const/immutable has NOTHING to do with
code generation, it only has to
To answer my own post :
the problems vanish when I add a main() method.
question : how do I automagically add a standard main method ?
regards, Oliver
On Tue, 07 Sep 2010 12:54:52 -0400, bearophile
wrote:
Steven Schveighoffer:
Note that the new appender uses heap data to store its implementation,
so
it's not as quick as it could be. This is per Andrei's requirement that
it be a reference type.
Thank you for your answers. But I don't f
Hello again,
I know the extern(C) mechanism, but how do I actually load a C-dll
such that my D-program has access to the functions of the C/C++ dll.
regards,
Oliver
On 2010-09-07 17:29, Don wrote:
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
"typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function. "
From that I got the impressi
Nick Sabalausky Wrote:
> Does anyone who's done this sort of thing in D before, on Win or Lin, know
> of anything else in particular to be aware of?
There's no fork on windows. If you want a multithreaded server, it's usually
implemented with threads on windows.
On 2010-09-07 17:34, Stanislav Blinov wrote:
07.09.2010 17:00, Jacob Carlborg пишет:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
"typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function.
OK Wrote:
> I know the extern(C) mechanism, but how do I actually load a C-dll
> such that my D-program has access to the functions of the C/C++ dll.
>
You just link to it, system loader will do actual loading for you automatically.
On 2010-09-07 17:37, Pelle wrote:
On 09/07/2010 04:33 PM, Steven Schveighoffer wrote:
Yes, a valid return. Your function should be:
void foo(void delegate(const(C) f) const
It helps to understand that inout/const/immutable has NOTHING to do with
code generation, it only has to do with limiting
"Kagamin" wrote in message
news:i660qi$nu...@digitalmars.com...
> Nick Sabalausky Wrote:
>
>> Does anyone who's done this sort of thing in D before, on Win or Lin,
>> know
>> of anything else in particular to be aware of?
>
> There's no fork on windows. If you want a multithreaded server, it's
If you are trying to compile a library, add -lib to make it not require a
main method.
On Tue, Sep 7, 2010 at 2:12 PM, OK wrote:
> To answer my own post :
> the problems vanish when I add a main() method.
> question : how do I automagically add a standard main method ?
>
> regards, Oliver
>
hello,
now I have written some code in first.d and added some extern(C) functions in
externs.d. How do I compile and link everything with
extern.lib ?
regards, Oliver
Steven Schveighoffer:
> An appender is an ouput range, so passing it into a function so the
> function can output to it is a requirement.
I see, that's useful. I will write a Pimp-less version of it, then (when I
don't need a range, but just a local accumulator).
Thank you for your always gent
OK wrote:
hello,
now I have written some code in first.d and added some extern(C) functions in
externs.d. How do I compile and link everything with
extern.lib ?
regards, Oliver
Recently there was a pretty thorough discussion about this:
http://www.digitalmars.com/d/archives/digitalmars/D/lea
Jacob Carlborg wrote:
On 2010-09-07 17:34, Stanislav Blinov wrote:
07.09.2010 17:00, Jacob Carlborg пишет:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
"typeof(this) will generate the type of what this would be in a
non-static member function, even if not
On Tue, 07 Sep 2010 14:54:46 -0400, Nick Sabalausky wrote:
"Kagamin" wrote in message
news:i660qi$nu...@digitalmars.com...
Nick Sabalausky Wrote:
Does anyone who's done this sort of thing in D before, on Win or Lin,
know
of anything else in particular to be aware of?
There's no fork on wi
> Beware of stack overflows.
And you may add another runtime test to see in what direction the stack grows.
Bye,
bearophile
Tom Kazimiers:
> But good to know that it would work with backward growing of the
> array - do have you an example of that?
Just created:
import std.stdio: writeln;
import std.c.stdlib: alloca;
void main() {
int n = 30;
alias int T;
enum int initialCapacity = 4;
static assert(in
Jacob Carlborg wrote:
On 2010-09-07 17:29, Don wrote:
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
"typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function. "
From
"Steven Schveighoffer" wrote in message
news:op.vioibdr2eav...@localhost.localdomain...
> On Tue, 07 Sep 2010 14:54:46 -0400, Nick Sabalausky wrote:
>
>> "Kagamin" wrote in message
>> news:i660qi$nu...@digitalmars.com...
>>> Nick Sabalausky Wrote:
>>>
Does anyone who's done this sort of th
Hello,
I followed the recommended threads on linking windows Dlls
Using the described tool "coffimplib" I was able to link to executables.
However, sometimes when using function from the windows library I get :
object.Error: Access Violation
during execution.
Is this problem known to someone and
I've tried all sorts of stuff and looked all over, but I'm completely at a
loss. How do I link in a static lib on the command line?
On Tuesday 07 September 2010 09:55:29 Max Mayrhofer wrote:
> Hi all, I have what is I suspect a silly question, but I am having a
> total brainfart over this for some reason. I want to read an
> arbitrary amount of floats from user input and then perform some
> statistics work on them. For some re
"Nick Sabalausky" wrote in message
news:i66oia$25s...@digitalmars.com...
> I've tried all sorts of stuff and looked all over, but I'm completely at a
> loss. How do I link in a static lib on the command line?
And I don't mean "with C" or anything like that, just ordinary D.
> type main.d
modul
On Tuesday 07 September 2010 18:23:59 Nick Sabalausky wrote:
> I've tried all sorts of stuff and looked all over, but I'm completely at a
> loss. How do I link in a static lib on the command line?
Don't you just include it as one of the arguments, like all of the .d files? I
don't know. I haven't
"Jonathan M Davis" wrote in message
news:mailman.129.1283909879.858.digitalmars-d-le...@puremagic.com...
> On Tuesday 07 September 2010 18:23:59 Nick Sabalausky wrote:
>> I've tried all sorts of stuff and looked all over, but I'm completely at
>> a
>> loss. How do I link in a static lib on the c
This is interesting, if you compile it with:
dmd test.d
It works. If you compile it with:
dmd -inline test.d
It doesn't compile and dmd returns:
test.d(5): Error: function D main is a nested function and cannot be accessed
from array
import std.algorithm: map;
import std.array: array;
void main(
On Tuesday 07 September 2010 19:58:01 bearophile wrote:
> This is interesting, if you compile it with:
> dmd test.d
> It works. If you compile it with:
> dmd -inline test.d
> It doesn't compile and dmd returns:
> test.d(5): Error: function D main is a nested function and cannot be
> accessed from a
Yea of course that does make sense, there ya go :)
You probably mess calling convention.
50 matches
Mail list logo