Hi,
there is a behaviour which seems strange for me.
I have following structure
C:\Projects\ProjectA\main.d
C:\Projects\Reusuable\net\http.d
The content of main.d is:
module main;
import std.stdio;
import net.http;
int main()
{
return 0;
}
The content of http.d is:
module
On 15.08.2011 10:15, Andre wrote:
...
I compile the application with command:
dmd -IC:\Projects\Reusuable main.d
This works, but if I now edit the http.d file
and add an import statement like "import std.stdio;"
then the linker will output following error:
main.obj(main)
Error 42: Symbol
Am Mon, 15 Aug 2011 10:24:38 +0200 schrieb torhu:
> dmd -IC:\Projects\Reusuable main.d net\http.d
Hi torhu,
thanks a lot. This works.
Kind regards
Andre
Ok, this is a good one I think.
import std.string, std.algorithm, std.functional;
bool isANum( dchar chr ) {
return inPattern( chr, digits ~ `"+-.` );
}
void main() {
auto input = `abc123`;
auto indexEnd = -1;
indexEnd = count!( not!isANum )( input );
assert( indexEnd =
Thank you very much, that solved my issue.
C:\dir>htod -I c:\d\dm\include ocilib.h
Fatal error: unable to open input file 'stdlib.h'
You have an extra space there. Use:
htod -IC:\d\dm\include ocilib.h
That will work.
On Fri, 12 Aug 2011 17:51:50 -0400, bearophile
wrote:
Steven Schveighoffer:
> int main(in string[] args);
What would be the purpose of this?
Why do you use "in" in function arguments? To make sure you will not
modify the given array. I think it's not good practice to change the
lengt
On Fri, 12 Aug 2011 16:58:15 -0400, Ellery Newcomer
wrote:
On 08/12/2011 03:29 PM, Steven Schveighoffer wrote:
On Fri, 12 Aug 2011 15:54:53 -0400, Ellery Newcomer
wrote:
in std.container, the stable* container functions advocate that they
do not invalidate the ranges of their containers.
On Fri, 12 Aug 2011 18:29:00 -0400, Ellery Newcomer
wrote:
On 08/12/2011 03:54 PM, Jonathan M Davis wrote:
In the case of container that uses nodes - such as a linked list -
because you
can add and remove elements without affecting other elements, iterators
and
ranges don't tend to get
On Sun, 14 Aug 2011 23:00:26 -0400, Andrej Mitrovic
wrote:
Simplified (and slow) implementation:
T[] splitLength(T)(T arr, size_t count) if (isArray!T)
{
T[] result;
while (arr.length)
{
result ~= arr.take(count);
arr.popFrontN(count);
}
return result;
}
On 8/15/11, Steven Schveighoffer wrote:
> Ouch!
It's not that big of an ouch actually: http://codepad.org/m1zKlP0e
I seen what sendmail actually changes they arguments of command line for nice
output of "ps ax" command.
May be it changes his argc/argv for this?
I obtain immutable(byte)* and int where contained length of bytes block from C
library.
Can I convert this into byte[] without explict copying etc.
Something like:
byte* p; // bytes
int size; // size of bytes block
byte[] b;
b.length = size;
b.ptr = p;
// now b contains bytes from library
On Mon, Aug 15, 2011 at 12:16 PM, mimocrocodil <4deni...@gmail.com> wrote:
> I obtain immutable(byte)* and int where contained length of bytes block
> from C library.
>
> Can I convert this into byte[] without explict copying etc.
>
> Something like:
>
> byte* p; // bytes
> int size; // size of by
On 8/15/11 7:16 PM, mimocrocodil wrote:
Can I convert this into byte[] without explict copying etc.
[…]
byte* p; // bytes
int size; // size of bytes block
Simply slice the pointer: p[0 .. size]
David
Marco Leise:
> That's why Pascal uses another set of operators for integer divisions,
> namely 'div' and 'mod', so you can never get into that situation. The
> above code would have worked and in case step was an integer, the compiler
> would have complained about not using 'div'. I doubt th
On Mon, 15 Aug 2011 13:16:54 -0400, mimocrocodil <4deni...@gmail.com>
wrote:
I obtain immutable(byte)* and int where contained length of bytes block
from C library.
Can I convert this into byte[] without explict copying etc.
Something like:
byte* p; // bytes
int size; // size of bytes blo
Am 15.08.2011 19:16, schrieb mimocrocodil:
I obtain immutable(byte)* and int where contained length of bytes block from C
library.
Can I convert this into byte[] without explict copying etc.
Something like:
byte* p; // bytes
int size; // size of bytes block
byte[] b;
b.length = size;
b.ptr =
Steven Schveighoffer:
> int main(string[] _args)
> {
> const args = _args; // not modifiable copy
> }
Currently DMD accepts code like:
int main(in string[] args) { return 0; }
void main(in string[] args) {}
int main() { return 0; }
void main() {}
What I have asked is if it's worth changing
On 2011-08-13 04:13, Trass3r wrote:
I'm working on a tool to convert C header files to D modules based on
clang. But currently it's not a prioritized project.
I also played with the idea. Clang's Rewrite facilities should be
perfect for that.
Yeah, I'm using Rewrite, if I recall correctly.
On Mon, 15 Aug 2011 17:16:54 +, mimocrocodil wrote:
> I obtain immutable(byte)* and int where contained length of bytes block
> from C library.
>
> Can I convert this into byte[] without explict copying etc.
>
> Something like:
>
> byte* p; // bytes
> int size; // size of bytes block
>
> b
This will print the count of whitespace chars in a line:
writeln(count!isWhite(line));
What I need is the count of whitspace chars until the first
non-whitespace char is found, essentially I need a "countWhile"
template:
writeln(countWhile!isWhite(line));
Can I do this with existing templates s
On Mon, 15 Aug 2011 21:53:11 +0200, Andrej Mitrovic
wrote:
This will print the count of whitespace chars in a line:
writeln(count!isWhite(line));
What I need is the count of whitspace chars until the first
non-whitespace char is found, essentially I need a "countWhile"
template:
writeln(co
On Monday, August 15, 2011 12:53 Andrej Mitrovic wrote:
> This will print the count of whitespace chars in a line:
>
> writeln(count!isWhite(line));
>
> What I need is the count of whitspace chars until the first
> non-whitespace char is found, essentially I need a "countWhile"
> template:
>
> w
On 8/15/11 11:00 PM, Jonathan M Davis wrote:
On Monday, August 15, 2011 12:53 Andrej Mitrovic wrote:
This will print the count of whitespace chars in a line:
writeln(count!isWhite(line));
What I need is the count of whitspace chars until the first
non-whitespace char is found, essentially I ne
On Monday, August 15, 2011 02:25 Joel Christensen wrote:
> Ok, this is a good one I think.
>
> import std.string, std.algorithm, std.functional;
>
> bool isANum( dchar chr ) {
> return inPattern( chr, digits ~ `"+-.` );
> }
>
> void main() {
> auto input = `abc123`;
> auto indexEnd = -1;
>
> in
On Monday, August 15, 2011 14:09 David Nadlinger wrote:
> On 8/15/11 11:00 PM, Jonathan M Davis wrote:
> > On Monday, August 15, 2011 12:53 Andrej Mitrovic wrote:
> >> This will print the count of whitespace chars in a line:
> >>
> >> writeln(count!isWhite(line));
> >>
> >> What I need is the cou
On 08/15/2011 03:47 PM, Steven Schveighoffer wrote:
On Fri, 12 Aug 2011 17:51:50 -0400, bearophile
wrote:
Steven Schveighoffer:
> int main(in string[] args);
What would be the purpose of this?
Why do you use "in" in function arguments? To make sure you will not
modify the given array. I t
On Mon, 15 Aug 2011, Timon Gehr wrote:
> On 08/15/2011 03:47 PM, Steven Schveighoffer wrote:
> > On Fri, 12 Aug 2011 17:51:50 -0400, bearophile
> > wrote:
> >
> > > Steven Schveighoffer:
> > >
> > > > > int main(in string[] args);
> > > >
> > > > What would be the purpose of this?
> > >
> > >
On 08/15/2011 11:53 PM, Brad Roberts wrote:
On Mon, 15 Aug 2011, Timon Gehr wrote:
On 08/15/2011 03:47 PM, Steven Schveighoffer wrote:
On Fri, 12 Aug 2011 17:51:50 -0400, bearophile
wrote:
Steven Schveighoffer:
int main(in string[] args);
What would be the purpose of this?
Why do you
That doesn't work:
import std.algorithm;
import std.stdio;
import std.functional;
import std.uni;
void main()
{
auto line = " foo";
writeln(countUntil!(not!isWhite)(line));
}
test.d(9): Error: template std.algorithm.countUntil(alias pred = "a ==
b",R1,R2) if (is(typeof(startsWith!(pred)
On Monday, August 15, 2011 14:28 Jonathan M Davis wrote:
> On Monday, August 15, 2011 02:25 Joel Christensen wrote:
> > Ok, this is a good one I think.
> >
> > import std.string, std.algorithm, std.functional;
> >
> > bool isANum( dchar chr ) {
> > return inPattern( chr, digits ~ `"+-.` );
> > }
On Monday, August 15, 2011 15:15 Andrej Mitrovic wrote:
> That doesn't work:
>
> import std.algorithm;
> import std.stdio;
> import std.functional;
> import std.uni;
>
> void main()
> {
> auto line = " foo";
> writeln(countUntil!(not!isWhite)(line));
> }
>
> test.d(9): Error: template std.algori
Thanks, but I'll wait for the next release before I use it. In the
meantime I guess I'll use this monster:
array(until!(not!isWhite)(line)).length
Andrej Mitrovic:
> In the meantime I guess I'll use this monster:
>
> array(until!(not!isWhite)(line)).length
This is better:
import std.algorithm, std.range, std.ascii, std.functional;
void main() {
string line = " foo ";
size_t n = walkLength(until!(not!isWhite)(line));
assert(
Thanks!
subj
to Vijay Nayar:
Thanks!
Heh... Inside the my code this data also not be changed, so that I would agree
to
obtain something like
immutable byte[]
:)
On 16-Aug-11 10:22 AM, Jonathan M Davis wrote:
On Monday, August 15, 2011 14:28 Jonathan M Davis wrote:
On Monday, August 15, 2011 02:25 Joel Christensen wrote:
Ok, this is a good one I think.
import std.string, std.algorithm, std.functional;
bool isANum( dchar chr ) {
return inPattern( chr,
38 matches
Mail list logo