Hi,
This program loops through a string until it finds a number and gives
the position of it.
The first assert works, but not the second one.
import std.algorithm;
void main() {
static bool isNumber( char input, char dummy ) {
if ( ( input >= '0' && input <= '9' ) ||
On Sunday, August 14, 2011 20:50:03 Joel Christensen wrote:
> Hi,
>
> This program loops through a string until it finds a number and gives
> the position of it.
>
> The first assert works, but not the second one.
>
> import std.algorithm;
>
> void main() {
> static bool isNumber( char in
On Sunday, August 14, 2011 03:23:39 Jonathan M Davis wrote:
> On Sunday, August 14, 2011 20:50:03 Joel Christensen wrote:
> > Hi,
> >
> > This program loops through a string until it finds a number and gives
> > the position of it.
> >
> > The first assert works, but not the second one.
> >
> >
On Sunday, August 14, 2011 03:23:39 Jonathan M Davis wrote:
> On Sunday, August 14, 2011 20:50:03 Joel Christensen wrote:
> > Hi,
> >
> > This program loops through a string until it finds a number and gives
> > the position of it.
> >
> > The first assert works, but not the second one.
> >
> >
Hello I am trying to get to a gmp interface for D2. I have some trouble to get
that to work, however. Perhaps someone has an idea what I am doing wrong. I
must admit I am not sure this is a D issue or a swig issue or something else.
The interface file for swig
cat gmpd.i
%module gmpd
%{
#include
== Quote from Oliver (oliver.ruebenkoe...@web.de)'s article
> Hello I am trying to get to a gmp interface for D2. I have some trouble to get
> that to work, however. Perhaps someone has an idea what I am doing wrong. I
> must admit I am not sure this is a D issue or a swig issue or something else.
Thanks Iain,
I'll contact the swig team about it.
Oliver
On 8/14/11 1:29 PM, Oliver wrote:
Hello I am trying to get to a gmp interface for D2. I have some trouble to get
that to work, however. Perhaps someone has an idea what I am doing wrong. I
must admit I am not sure this is a D issue or a swig issue or something else.
[…]
/opt/usr/local/bin/gdc
Shouldn't there be an interface to GMP and MPFR in Phobos by default?
Thanks David,
so when I
gcc -fPIC -c gmpd_wrap.c
gcc -shared -Wl,-soname,libgmpd_wrap.so.1 -o libgmpd_wrap.so.1.0.1 gmpd_wrap.o
-lgmp
ln -s libgmpd_wrap.so.1.0.1 libgmpd_wrap.so
/opt/usr/local/bin/gdc main.d gmpd.d gmpd_im.d -I. -L. -lgmpd_wrap
I get the
/usr/bin/ld: __gmpn_ior_n: TLS definit
On 8/14/11 2:34 PM, Oliver wrote:
/opt/usr/local/bin/gdc main.d gmpd.d gmpd_im.d -I. -L. -lgmpd_wrap
You don't need to link the .so in (although I'm surprised to see that it
produces linker errors, I didn't remember that there are name collisions
with the default settings), it will be loaded
== Quote from David Nadlinger (s...@klickverbot.at)'s article
> On 8/14/11 2:34 PM, Oliver wrote:
> > /opt/usr/local/bin/gdc main.d gmpd.d gmpd_im.d -I. -L. -lgmpd_wrap
> You don't need to link the .so in (although I'm surprised to see that it
> produces linker errors, I didn't remember that there
On 8/14/11 3:03 PM, Oliver wrote:
I did have to copy the libgmpd_wrap* to some place were the linker could find
it,
of course.
Alternatively, you could set LD_LIBRARY_PATH to where your library
resides. If there is demand, I could definitely look into adding static
linking support to SWIG (i
== Quote from David Nadlinger (s...@klickverbot.at)'s article
> On 8/14/11 3:03 PM, Oliver wrote:
> > I did have to copy the libgmpd_wrap* to some place were the linker could
> > find it,
> > of course.
> Alternatively, you could set LD_LIBRARY_PATH to where your library
> resides. If there is dem
Where I can find description of Exception class?
I seen this URLs, but they do not contain this information:
http://www.d-programming-language.org/phobos/std_exception.html
http://www.d-programming-language.org/phobos/core_exception.html
http://www.d-programming-language.org/errors.html
mimocrocodil wrote:
>Where I can find description of Exception class?
>
>I seen this URLs, but they do not contain this information:
>
>http://www.d-programming-language.org/phobos/std_exception.html
>http://www.d-programming-language.org/phobos/core_exception.html
>http://www.d-programming-languag
This seems ancient, but maybe it could help:
http://www.dsource.org/projects/bindings/browser/trunk/gmp
Johannes Pfau: thanks!
Next question:
Why do we always have to send a text message with a standard class of Exception?
After all, it might be never used, for example due to the fact that error
messages are not sent
to the user "as is": exception can be analyzed and translated for
international
On Sunday, August 14, 2011 15:48:36 mimocrocodil wrote:
> Johannes Pfau: thanks!
>
> Next question:
>
> Why do we always have to send a text message with a standard class of
> Exception?
>
> After all, it might be never used, for example due to the fact that error
> messages are not sent to the
On 8/13/11 9:42 PM, Simen Kjaeraas wrote:
On Sun, 14 Aug 2011 01:15:29 +0200, mimocrocodil <4deni...@gmail.com>
wrote:
Hi!
I am want to extend available enum to provide more items to them.
How I can do this job without manual copying of exsisting enum items?
If what you want is a new enum t
Am 03.08.2011, 19:21 Uhr, schrieb Steven Schveighoffer
:
On Wed, 03 Aug 2011 13:14:50 -0400, Andrej Mitrovic
wrote:
Take a look at this:
import std.stdio;
import core.thread;
void main()
{
foreach (x; 0 .. 1000)
{
Thread.sleep(dur!("usecs")(999));
writeln(x);
Am 09.07.2011, 00:45 Uhr, schrieb Andrej Mitrovic
:
This is just an observation, not a question or anything.
void main()
{
enum width = 100;
double step = 1 / width;
writeln(step); // 0
}
I've just had this bug in my code. I forgot to make either width or 1
a floating-point typ
Is there something in Phobos with which I could do:
auto arr = [1, 2, 3, 4, 5, 6];
int[][] newarr = arr.splitLength(2);
assert(newarr.length == 3);
?
On Sunday, August 14, 2011 20:50:03 Joel Christensen wrote:
> Hi,
>
> This program loops through a string until it finds a number and gives
> the position of it.
>
> The first assert works, but not the second one.
>
> import std.algorithm;
>
> void main() {
> static bool isNumber( char in
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;
}
Strings are an exception again, that code won't work for strings. Damn..
On Monday, August 15, 2011 04:49:59 Andrej Mitrovic wrote:
> Is there something in Phobos with which I could do:
>
> auto arr = [1, 2, 3, 4, 5, 6];
>
> int[][] newarr = arr.splitLength(2);
> assert(newarr.length == 3);
I could have sworn that there was a function that did this, but I can't find
On 14-Aug-11 10:44 PM, Jonathan M Davis wrote:
On Sunday, August 14, 2011 03:23:39 Jonathan M Davis wrote:
On Sunday, August 14, 2011 20:50:03 Joel Christensen wrote:
Hi,
This program loops through a string until it finds a number and gives
the position of it.
The first assert works, but not
On 15-Aug-11 2:55 PM, Jonathan M Davis wrote:
On Sunday, August 14, 2011 20:50:03 Joel Christensen wrote:
Hi,
This program loops through a string until it finds a number and gives
the position of it.
The first assert works, but not the second one.
import std.algorithm;
void main() {
On 15-Aug-11 5:21 PM, Joel Christensen wrote:
On 15-Aug-11 2:55 PM, Jonathan M Davis wrote:
On Sunday, August 14, 2011 20:50:03 Joel Christensen wrote:
Hi,
This program loops through a string until it finds a number and gives
the position of it.
The first assert works, but not the second one.
30 matches
Mail list logo