* Paul D. Anderson paul.d.removethis.ander...@comcast.andthis.net [2012-04-13
07:50:31 +0200]:
I'm trying to add formatted output to my decimal arithmetic module.
Decimals should format like floating point, using 'E', 'F' and 'G',
etc.
I would expect a format string like %9.6e to parse as
On 13.04.2012 1:48, Joseph Rushton Wakeling wrote:
On 12/04/12 21:54, bearophile wrote:
for( t=recordsRemaining-1; t=limit; --t)
y2 *= top--/bottom--;
Generally packing mutation of variables inside expressions is quite
bad style. It makes code less easy to understand and translate, and
On 13.04.2012 2:50, Joseph Rushton Wakeling wrote:
On 12/04/12 23:34, Dmitry Olshansky wrote:
Aye, and in general community does appreciate any enhancements via
pull requests
on github:
https://github.com/D-Programming-Language
OK, I'll see what I can do. I'd like to discuss and refine the
* James Miller ja...@aatch.net [2012-04-13 19:16:48 +1200]:
* Paul D. Anderson paul.d.removethis.ander...@comcast.andthis.net
[2012-04-13 07:50:31 +0200]:
I'm trying to add formatted output to my decimal arithmetic module.
Decimals should format like floating point, using 'E', 'F' and 'G',
On 13/04/12 01:44, bearophile wrote:
final size_t select(ref UniformRNG urng)
in {
assert(_recordsRemaining 0);
assert(_sampleRemaining 0);
} body {
...
}
OK. I'm confused by these asserts, because if I go beyond what is acceptable by
calling select() even after I've
Dmitry Olshansky:
I believe it's something that reasonable people may disagree on.
To me it's perfectly easy to see what return x++; does.
I agree that return x++; is not too bad for a human reader, but code with
mutation inside expressions (mostly written by other people) has caused me tons
Joseph Rushton Wakeling:
final size_t select(ref UniformRNG urng)
in {
assert(_recordsRemaining 0);
assert(_sampleRemaining 0);
} body {
...
}
OK. I'm confused by these asserts,
What's confusing? I don't understand. It's contract-based programming, the code
is
On 13-04-2012 05:25, Jesse Phillips wrote:
On Friday, 13 April 2012 at 01:10:40 UTC, Alex Rønne Petersen wrote:
How do I pass a library search path to DMD on Windows?
I would love to know too!
Only place I found was to edit sc.ini sorry.
It seems that -L+path does the trick... I only found
On 13/04/12 13:10, bearophile wrote:
What's confusing? I don't understand. It's contract-based programming, the code
is essentially the same as before:
http://dlang.org/dbc.html
No, I understand the principle; I just don't understand why the code is running
without errors being displayed
On Sunday, 25 March 2012 at 15:59:21 UTC, Jacob Carlborg wrote:
On 2012-03-25 17:22, Kevin Cox wrote:
I would reccomend Qt as well. You will get native
cross-platform
widgets with great performance. I am not sure how far QtD is
but I know
it once had a lot of development on it.
I don't
On Sunday, 25 March 2012 at 15:14:04 UTC, Jacob Carlborg wrote:
It would also be possible to use Cocoa, as you do with
Objective-C, but that wouldn't be very practically. There's
also a DMD fork that directly supports interfacing with
Objective-C:
http://michelf.com/projects/d-objc/
Why do
If I have something like:
static int var = myFunction();
dmd will evaluate myFunction() at compile time. If it can't, it
gives me a compile error, doesn't it? If I'm not wrong, static
force this.
If i don't use static, dmd will try to evaluate myfunction() at
compile time, and if it can't,
On Fri, 13 Apr 2012 14:52:05 +0200, Andrea Fontana nos...@example.com
wrote:
If I have something like:
static int var = myFunction();
dmd will evaluate myFunction() at compile time. If it can't, it gives me
a compile error, doesn't it? If I'm not wrong, static force this.
Indeed.
If i
Kevin Cox wrote:
I would reccomend Qt as well. You will get native cross-platform
widgets with great performance. I am not sure how far QtD is but I know
it once had a lot of development on it.
AFAIR, QtD is at the alpha stage. It's based on QtJambi, but there is
another SMOKE generator,
Hi,
I am planning to use D for creating native applications on Mac OS
X. For that, of course, D must interact with the Cocoa API. I
have no knowledge of how this bindings could be done. I've
already looked at Cocado[1] and do know the Michel Fortin's
D-ObjC bridge[2], and would like to be
On 2012-04-13 14:47, Rizo Isrof wrote:
On Sunday, 25 March 2012 at 15:59:21 UTC, Jacob Carlborg wrote:
On 2012-03-25 17:22, Kevin Cox wrote:
I would reccomend Qt as well. You will get native cross-platform
widgets with great performance. I am not sure how far QtD is but I know
it once had a
On 2012-04-13 14:51, Rizo Isrof wrote:
On Sunday, 25 March 2012 at 15:14:04 UTC, Jacob Carlborg wrote:
It would also be possible to use Cocoa, as you do with Objective-C,
but that wouldn't be very practically. There's also a DMD fork that
directly supports interfacing with Objective-C:
That's strange, so why writeln make it compile faster? :)
I can't post the code, i'll try to reproduce it...
On Friday, 13 April 2012 at 13:01:03 UTC, Simen Kjaeraas wrote:
On Fri, 13 Apr 2012 14:52:05 +0200, Andrea Fontana
nos...@example.com wrote:
If I have something like:
static int var
On 2012-04-13 15:34, Rizo Isrof wrote:
Hi,
I am planning to use D for creating native applications on Mac OS X. For
that, of course, D must interact with the Cocoa API. I have no knowledge
of how this bindings could be done. I've already looked at Cocado[1] and
do know the Michel Fortin's
On Friday, 13 April 2012 at 09:10:37 UTC, James Miller wrote:
snip/
So I made the pull request, the documentation you need to read
is here:
https://github.com/Aatch/phobos/commit/cda3c079ee32d98a017f88949c10097840baa075
Hopefully it helps.
--
James Miller
Thanks. That did the trick.
Paul
I am trying to create a file in ~/.config
My code is:
[code]
import std.stdio;
void main()
{
auto f = File(~/.config/minas.txt, w);
}
[/code]
However, an exception is thrown.
std.exception.ErrnoException@std/stdio.d(288): Cannot open file
`~/.config/minas.txt' in mode `w' (No such
Try using the $HOME environment variable.
Use std.path.expandTilde() -
http://dlang.org/phobos/std_path.html#expandTilde
On 13.4.2012 18:02, Minas wrote:
I am trying to create a file in ~/.config
My code is:
[code]
import std.stdio;
void main()
{
auto f = File(~/.config/minas.txt, w);
}
[/code]
However, an exception
On 04/13/2012 02:41 AM, Joseph Rushton Wakeling wrote:
On 13/04/12 01:44, bearophile wrote:
final size_t select(ref UniformRNG urng)
in {
assert(_recordsRemaining 0);
assert(_sampleRemaining 0);
} body {
...
}
OK. I'm confused by these asserts, because if I go beyond what is
acceptable
On Friday, 13 April 2012 at 04:16:52 UTC, Jesse Phillips wrote:
On Wednesday, 11 April 2012 at 19:33:58 UTC, Xan wrote:
Hi,
With helloworld program named with score or underscore, I
receive the following __annoying__ error:
$ gdmd-4.6 hola-temp.d
hola-temp.d: Error: module hola-temp has
I'd just like to verify that my understanding of T : T* in this template is
correct:
struct S(T : T*)
{
T t;
}
It's my understanding that it's requiring that the template argument be
implicitly convertible to a pointer to that type. However, as this
stackoverflow question shows:
On Friday, April 13, 2012 14:47:45 Jonathan M Davis wrote:
I'd just like to verify that my understanding of T : T* in this template is
correct:
struct S(T : T*)
{
T t;
}
It's my understanding that it's requiring that the template argument be
implicitly convertible to a pointer to that
On Friday, 13 April 2012 at 18:47:55 UTC, Jonathan M Davis wrote:
I'd just like to verify that my understanding of T : T* in this
template is
correct:
struct S(T : T*)
{
T t;
}
It's my understanding that it's requiring that the template
argument be
implicitly convertible to a pointer to
On Friday, April 13, 2012 21:04:07 Jakob Ovrum wrote:
First, the argument type must match the form T*. The T can be any
type; there is only one constraint here, the pointer head. So
obviously, the argument type must be a pointer to anything to
match T*, e.g. void*, shared(int)**,
On Friday, 13 April 2012 at 16:41:01 UTC, Bystroushaak wrote:
Use std.path.expandTilde() -
http://dlang.org/phobos/std_path.html#expandTilde
Thank you very much! That did the trick!
auto f = File(expandTilde(~/.config/test.txt,w));
On 13/04/12 19:49, Ali Çehreli wrote:
This is a complicated issue that touches how in contracts are not inherited. I
think your issue is because the interface does not define any in contracts,
effectively allowing every call to select(). Please start reading here: :)
You're absolutely right.
Hai,
After watching Walter's video at Lang.NEXT, I have wanted to know
how contracts inheritance works.
In the following code, I don't understand why foo.bar(2)
works...but with the sames contracts in the foo function it
doesn't work.
http://paste.pocoo.org/show/3Ab5IiQk6hTiJ0jAFZWv/
On 04/13/2012 03:07 PM, Eyyub wrote:
Hai,
After watching Walter's video at Lang.NEXT, I have wanted to know how
contracts inheritance works.
In the following code, I don't understand why foo.bar(2) works...but
with the sames contracts in the foo function it doesn't work.
On Friday, 30 March 2012 at 00:20:16 UTC, TJB wrote:
On Thursday, 29 March 2012 at 15:15:35 UTC, Jesse Phillips
wrote:
On Thursday, 29 March 2012 at 08:55:41 UTC, Johannes Pfau
wrote:
The command Jesse posted is missing a -L-lscid and you'll
probably
also need -L-L/usr/local/lib
So the
On Friday, 13 April 2012 at 23:06:38 UTC, TJB wrote:
OK. I now can compile a simple program that imports a module
from the SciD library. How do I do something a little more
interesting like initialize a vector or matrix and do some
linear algebra with it?
Thanks so much for your help.
From the FaQ:
NaNs have the interesting property in that whenever a NaN is
used as an operand in a computation, the result is a NaN.
Therefore, NaNs will propagate and appear in the output
whenever a computation made use of one. This implies that a NaN
appearing in the output is an
On 4/13/2012 8:12 PM, Alex Rønne Petersen wrote:
On 13-04-2012 05:25, Jesse Phillips wrote:
On Friday, 13 April 2012 at 01:10:40 UTC, Alex Rønne Petersen wrote:
How do I pass a library search path to DMD on Windows?
I would love to know too!
Only place I found was to edit sc.ini sorry.
It
On Saturday, April 14, 2012 06:00:35 F i L wrote:
From the FaQ:
NaNs have the interesting property in that whenever a NaN is
used as an operand in a computation, the result is a NaN.
Therefore, NaNs will propagate and appear in the output
whenever a computation made use of one. This
Am 14.04.2012 06:00, schrieb F i L:
struct Foo {
int x, y;// ready for use.
float z, w; // messes things up.
float r = 0; // almost always...
}
how often in your code is 0 or 0.0 the real starting point?
i can't think of any situation except counters or
So it's what I thought, the only reason is based on a faulty
premise, IMO.
Jonathan M Davis wrote:
Types default to the closest thing that they have to an invalid
value so that
code blows up as soon as possible if you fail to initialize a
variable to a
proper value and so that it fails
On Saturday, 14 April 2012 at 05:19:38 UTC, dennis luehring wrote:
Am 14.04.2012 06:00, schrieb F i L:
struct Foo {
int x, y;// ready for use.
float z, w; // messes things up.
float r = 0; // almost always...
}
how often in your code is 0 or 0.0 the real
On Saturday, April 14, 2012 07:41:33 F i L wrote:
You're supposed to initialize them or assign them
to appropriate values before using them.
sure, but if they always default to _usable_ constants no
expectations are lost and no bugs are created.
No. You always have a bug if you don't
42 matches
Mail list logo