On 2013-12-04 01:53:39 +, Shammah Chancellor said:
On 2013-12-03 23:49:47 +, Max Klyga said:
On 2013-12-03 23:02:13 +, Shammah Chancellor said:
On 2013-12-03 21:51:20 +, Max Klyga said:
On 2013-12-03 02:45:44 +, Shammah Chancellor said:
I'm not particularly familiar wi
This is intended behavior change from 2.064.
http://dlang.org/class#field-init
[...]
Kenji Hara
Interesting, useful, and a surprise. Thank you!
On Wednesday, 4 December 2013 at 01:52:09 UTC, bearophile wrote:
H. S. Teoh:
The first rule of floating-point comparisons is that you never
use ==.
So I suggested to disallow the == among FP numbers in D (and
allow FP comparisons with "is" or with specialized functions,
including one functi
On 2013-12-03 23:49:47 +, Max Klyga said:
On 2013-12-03 23:02:13 +, Shammah Chancellor said:
On 2013-12-03 21:51:20 +, Max Klyga said:
On 2013-12-03 02:45:44 +, Shammah Chancellor said:
I'm not particularly familiar with the syntax being used in the variet
of monad examples
H. S. Teoh:
The first rule of floating-point comparisons is that you never
use ==.
So I suggested to disallow the == among FP numbers in D (and
allow FP comparisons with "is" or with specialized functions,
including one function that does what == does today).
For the original poster, for
On Tuesday, 3 December 2013 at 17:47:47 UTC, Dejan Lekic wrote:
On Tuesday, 3 December 2013 at 10:43:06 UTC, Puming wrote:
Hi:
I followed the steps in http://dlang.org/dmd-linux.html, but
when I build a simple hello world program with:
rdmd hello.d
I get the following error:
rdmd hello.d
/
On Tuesday, 3 December 2013 at 23:17:29 UTC, H. S. Teoh wrote:
Thanks for the reply and the link, it gives me more confidence
that I'm understanding things a bit better. I finally feel like
I've opened the lid on the black box of float precision.
I found a great set of articles which I'm work
On 2013-12-03 23:02:13 +, Shammah Chancellor said:
On 2013-12-03 21:51:20 +, Max Klyga said:
On 2013-12-03 02:45:44 +, Shammah Chancellor said:
I'm not particularly familiar with the syntax being used in the variet
of monad examples. I'm trying to figure out how this is differe
On 12/04/2013 12:02 AM, Shammah Chancellor wrote:
I get the gist of that, but it seems like the range concept with UFCS
provides the same thing? E.G. range.map().flatten().map()?
Well, informally speaking, this is roughly an instance of a Monad.
Does it really not accomplish the same thing
OK, I've had a look into the code in std.math finally understand
it, I think. I was confused about maxRelativeError and
maxAbsoluteError then I found this also:
http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
(...If you want to count numbers near zero but of opposite s
On Tue, Dec 03, 2013 at 11:03:48PM +0100, ed wrote:
> Hi All,
>
> I'm learning programming and chose D because it is the best :D But,
> I've hit floating point numbers and I'm stuck on some of the basics.
>
> What is the proper way to do floating point comparisons, in
> particular I need to check
On 2013-12-03 21:51:20 +, Max Klyga said:
On 2013-12-03 02:45:44 +, Shammah Chancellor said:
I'm not particularly familiar with the syntax being used in the variet
of monad examples. I'm trying to figure out how this is different
from UFCS on InputRanges. It seems like std.algorit
Hi All,
I'm learning programming and chose D because it is the best :D
But, I've hit floating point numbers and I'm stuck on some of the
basics.
What is the proper way to do floating point comparisons, in
particular I need to check if a value is zero?
For example, given "real x = someCalcu
On 2013-12-03 02:45:44 +, Shammah Chancellor said:
I'm not particularly familiar with the syntax being used in the variet
of monad examples. I'm trying to figure out how this is different
from UFCS on InputRanges. It seems like std.algorithm implements
something which accomplished the
On Tuesday, 3 December 2013 at 20:36:22 UTC, Benji wrote:
I am using Xubuntu, 64bit, and GDC as compiler
Any IDE? I've seen ide consoles buffer differently because the
runtime sees the target as a pipe instead of a user-interactive
terminal.
On Tuesday, 3 December 2013 at 20:36:22 UTC, Benji wrote:
On Tuesday, 3 December 2013 at 19:33:47 UTC, Ali Çehreli wrote:
On 12/03/2013 09:12 AM, Benji wrote:
Hello,
in order to have correctly displayed output (before reading
something
from stdin),
I must call stdout.flush().
I am surprised
On 12/03/2013 12:36 PM, Benji wrote:
On Tuesday, 3 December 2013 at 19:33:47 UTC, Ali Çehreli wrote:
On 12/03/2013 09:12 AM, Benji wrote:
Hello,
in order to have correctly displayed output (before reading something
from stdin),
I must call stdout.flush().
I am surprised that you need that. Wh
On Tuesday, 3 December 2013 at 19:33:47 UTC, Ali Çehreli wrote:
On 12/03/2013 09:12 AM, Benji wrote:
Hello,
in order to have correctly displayed output (before reading
something
from stdin),
I must call stdout.flush().
I am surprised that you need that. What is your platform?
Normally, stdi
On Tuesday, 3 December 2013 at 16:52:29 UTC, Ali Çehreli wrote:
On 12/03/2013 06:45 AM, Chris wrote:
> I became aware of uninitialized variable. I think that the
latter
> behavior is the correct one (segfault > crash). But why did
it work
> correctly in the other D program, how did the C variabl
On 12/03/2013 09:12 AM, Benji wrote:
Hello,
in order to have correctly displayed output (before reading something
from stdin),
I must call stdout.flush().
I am surprised that you need that. What is your platform?
Normally, stdin and stdout are "tied". Reading from stdin flushes stdout
automat
On Tuesday, 3 December 2013 at 17:49:32 UTC, H. S. Teoh wrote:
On Tue, Dec 03, 2013 at 06:12:20PM +0100, Benji wrote:
Hello,
in order to have correctly displayed output (before reading
something from stdin),
I must call stdout.flush().
Sometimes, it's really annoying, especially when it is
nece
On Tuesday, 3 December 2013 at 10:43:06 UTC, Puming wrote:
Hi:
I followed the steps in http://dlang.org/dmd-linux.html, but
when I build a simple hello world program with:
rdmd hello.d
I get the following error:
rdmd hello.d
/usr/bin/ld: cannot find -l:libphobos2.a
I have copied dmd2/linux
On Tue, Dec 03, 2013 at 06:12:20PM +0100, Benji wrote:
> Hello,
> in order to have correctly displayed output (before reading
> something from stdin),
> I must call stdout.flush().
> Sometimes, it's really annoying, especially when it is necessarry to
> call it 10 times.
>
> For example:
> write("
Hello,
in order to have correctly displayed output (before reading
something from stdin),
I must call stdout.flush().
Sometimes, it's really annoying, especially when it is necessarry
to call it 10 times.
For example:
write("Enter some string: ");
stdout.flush();
string a = readln();
write("A
In core.thread I don't see a portable way to pin a thread to a
specific core, or at least pin the thread to whatever core it is
currently running in.
I found this solution, but it's for Windows only.
http://www.gamedev.net/blog/1140/entry-2254424-setting-thread-affinity-on-windows-in-d/
I can
On 12/03/2013 06:45 AM, Chris wrote:
> I became aware of uninitialized variable. I think that the latter
> behavior is the correct one (segfault > crash). But why did it work
> correctly in the other D program, how did the C variable get initialized?
Undefined behavior sometimes manifests itself
On Monday, 2 December 2013 at 21:28:48 UTC, lomereiter wrote:
On Monday, 2 December 2013 at 20:53:10 UTC, Namespace wrote:
OMG now I get it why in 2.064 importing std.regex makes visible
std.uni.isWhite all of a sudden.
Unicorns cannot be white, as they are already pink & invisible.
At leas
On Tue, Dec 03, 2013 at 04:16:04PM +0100, Adam D. Ruppe wrote:
[...]
> BTW private names should be outright invisible outside the module.
> At least private things at module scope. I get really annoyed with
> "public symbol foo from module bar conflicts with private symbol foo
> from module baz". G
On Tuesday, 3 December 2013 at 07:34:37 UTC, Jonathan M Davis
wrote:
They create a conflicting symbol in the importing module's
scope.
That's why you should never use them at this point.
Well, that's sometimes useful, it helps get rid of conflict
errors quickly, easily, and explicitly.
It s
On Tuesday, 3 December 2013 at 12:43:08 UTC, bearophile wrote:
You can file an enhancement request for the documentation, or
fix the docs yourself.
https://github.com/D-Programming-Language/dlang.org/pull/427
El 03/12/13 14:10, Puming ha escrit:
> On Tuesday, 3 December 2013 at 11:17:27 UTC, Jordi Sayol wrote:
>> El 03/12/13 11:43, Puming ha escrit:
>>> Hi:
>>>
>>> I followed the steps in http://dlang.org/dmd-linux.html, but when I build a
>>> simple hello world program with:
>>>
>>> rdmd hello.d
>>>
>
On Tuesday, 3 December 2013 at 14:18:35 UTC, John Colvin wrote:
On Tuesday, 3 December 2013 at 13:05:20 UTC, Mike Parker wrote:
On 12/3/2013 9:31 PM, John Colvin wrote:
You should be fine to free in that way as long as you haven't
done
anything crazy like separately static linking libc.
I
On Tuesday, 3 December 2013 at 13:05:20 UTC, Mike Parker wrote:
On 12/3/2013 9:31 PM, John Colvin wrote:
You should be fine to free in that way as long as you haven't
done
anything crazy like separately static linking libc.
I wouldn't advise this in the general case. When you have
complet
On Tuesday, 3 December 2013 at 13:05:20 UTC, Mike Parker wrote:
On 12/3/2013 9:31 PM, John Colvin wrote:
You should be fine to free in that way as long as you haven't
done
anything crazy like separately static linking libc.
I wouldn't advise this in the general case. When you have
complet
On Tuesday, 3 December 2013 at 11:17:27 UTC, Jordi Sayol wrote:
El 03/12/13 11:43, Puming ha escrit:
Hi:
I followed the steps in http://dlang.org/dmd-linux.html, but
when I build a simple hello world program with:
rdmd hello.d
I get the following error:
rdmd hello.d
/usr/bin/ld: cannot fin
On 12/3/2013 9:31 PM, John Colvin wrote:
You should be fine to free in that way as long as you haven't done
anything crazy like separately static linking libc.
I wouldn't advise this in the general case. When you have complete
end-to-end control, sure. But if, for example, you're using a dyn
On Tuesday, 3 December 2013 at 11:10:13 UTC, lomereiter wrote:
Did you install binaries or build the compiler from source?
I used the dmd.2.064.2.zip, because when I install the rpm
binary, it says there are dependency issues.
Chris:
std.c.stdlib.free() is mentioned on the "How to interface to C"
page (http://dlang.org/interfaceToC.html). So maybe that needs
an update.
You can file an enhancement request for the documentation, or fix
the docs yourself.
I'll file a little bug report for the other library deprecat
On Tuesday, 3 December 2013 at 12:31:16 UTC, John Colvin wrote:
On Tuesday, 3 December 2013 at 10:57:51 UTC, Chris wrote:
I have a C module that dynamically allocates memory for a
string like so:
char *result = (char*)malloc(length + 1); // 'length' has been
calculated
When I call it from D
On Tuesday, 3 December 2013 at 10:57:51 UTC, Chris wrote:
I have a C module that dynamically allocates memory for a
string like so:
char *result = (char*)malloc(length + 1); // 'length' has been
calculated
When I call it from D (via extern (C)), is it ok to free it
from there like so:
voi
El 03/12/13 11:43, Puming ha escrit:
> Hi:
>
> I followed the steps in http://dlang.org/dmd-linux.html, but when I build a
> simple hello world program with:
>
> rdmd hello.d
>
> I get the following error:
>
> rdmd hello.d
> /usr/bin/ld: cannot find -l:libphobos2.a
>
> I have copied dmd2/linu
Did you install binaries or build the compiler from source?
I have a C module that dynamically allocates memory for a string
like so:
char *result = (char*)malloc(length + 1); // 'length' has been
calculated
When I call it from D (via extern (C)), is it ok to free it from
there like so:
void callFunction() {
auto result = callToCFunction(); // Re
Hi:
I followed the steps in http://dlang.org/dmd-linux.html, but when
I build a simple hello world program with:
rdmd hello.d
I get the following error:
rdmd hello.d
/usr/bin/ld: cannot find -l:libphobos2.a
I have copied dmd2/linux/lib64/libphobos2.a to /usr/lib64, but ld
still can't find
On Monday, 2 December 2013 at 16:52:51 UTC, bearophile wrote:
Atila Neves:
How would that go in this case?
An example usage:
void main() {
int[float][string] aa;
aa["foo"][1.5] = 1;
}
Bye,
bearophile
Oh. That makes sense. Doh!
I guess I was focussing on "key to AA of..." and that
On Tuesday, 3 December 2013 at 03:14:46 UTC, Jesse Phillips wrote:
On Monday, 2 December 2013 at 13:30:44 UTC, Atila Neves wrote:
It seems that assigning an AA to another makes both point at
the same data only if the first array has data to begin with.
Is that the expected behaviour?
Atila
On Tuesday, 3 December 2013 at 08:28:23 UTC, Ali Çehreli wrote:
That works for some types as both enum and immutable have their
problems:
* enum is no good for arrays and AAs as it is very likely to be
unnecessarily slow.
* immutable is no good for types that contain mutable
references at
On 12/02/2013 06:45 PM, Shammah Chancellor wrote:
> I'm not particularly familiar with the syntax being used in the variet
> of monad examples. I'm trying to figure out how this is different from
> UFCS on InputRanges. It seems like std.algorithm implements something
> which accomplished the
On 12/01/2013 11:48 PM, Maxim Fomin wrote:
>> 1) Prefer enum first because enum values can be used for template
>> instantiations.
>
> You can instatiate templates not only with enums. Main pro for enums is
> that they are CT values.
The confusion is, some const values are CT values as well.
>>
On 12/02/2013 11:32 PM, Jacob Carlborg wrote:
> On 2013-12-03 07:36, CJS wrote:
>> In python a common performance tip for joining many strings together is
>> to use the join method. So, for example, instead of
>> "a" + "b" + "c"
>> use
>> ''.join(["a","b","c"]).
>> The idea is to avoid creating t
50 matches
Mail list logo