I'm currently reading about floating point literal and came to this
part:
FloatLiteral:
...
Integer ImaginarySuffix
Integer FloatSuffix ImaginarySuffix
Integer RealSuffix ImaginarySuffix
Going to the Integer link, it is defined as:
Integer:
...
On Tuesday, 1 March 2016 at 05:05:40 UTC, Jack Stouffer wrote:
In Python, I can do this:
my_obj = Obj()
string_from_func = func()
setattr(my_obj, string_from_func, 100)
Say func() returns "member1" or "member2", the setattr would
then set either one of those to 100.
Is there any
On Tuesday, 1 March 2016 at 01:31:56 UTC, Jirka wrote:
Ok, that would throw some OOM exception instead so I wouldn't
need to bother with it, is there something else in the GC that
would override it during class instance allocation? I am
finding it weird that ErrnoException doesn't let you
On Tuesday, 1 March 2016 at 04:48:01 UTC, Adam D. Ruppe wrote:
On Tuesday, 1 March 2016 at 04:18:11 UTC, Nicholas Wilson wrote:
What is causing these errors? I'm using \t and \n in string
all over the place and they work.
I don't think there's enough context to know for sure... but my
guess
In Python, I can do this:
my_obj = Obj()
string_from_func = func()
setattr(my_obj, string_from_func, 100)
Say func() returns "member1" or "member2", the setattr would then
set either one of those to 100.
Is there any equivalent in D?
On Tuesday, 1 March 2016 at 04:18:11 UTC, Nicholas Wilson wrote:
What is causing these errors? I'm using \t and \n in string all
over the place and they work.
I don't think there's enough context to know for sure... but my
guess is you forgot to close one of the quotes a couple lines
above.
line 620:
for(auto i = 1; i < pits3.length - 2; i++)
{
f.write(params3[i].fixup_T,"\t", pits3[i],",");
}
f.write(params3[$-2].fixup_T,"\t", pits3[$-1]);
f.write(")\n\t\t{typeof(return) _p;\n\t\t", m2,"(",mainVarName);
for(auto i = 1; i < pits3.length - 2; i++)
{
I'm working on a chess engine side-project, and I'm starting to
get into profiling and optimization.
One of the optimizations I've made involves some inline assembly,
and I ran across some apparently bizarre behavior today, and I
just wanted to double-check that I'm not doing something wrong.
On Monday, 29 February 2016 at 23:41:51 UTC, Chris Wright wrote:
On Mon, 29 Feb 2016 21:55:49 +, Jirka wrote:
Yes, that I understand, but the "new" operator can lead to
other system calls (?), could they overwrite it?
Yes. Most obviously, the GC uses malloc, which will set errno
to
On Mon, 29 Feb 2016 21:55:49 +, Jirka wrote:
> Yes, that I understand, but the "new" operator can lead to other system
> calls (?), could they overwrite it?
Yes. Most obviously, the GC uses malloc, which will set errno to ENOMEM
on failure.
On 02/29/2016 02:40 PM, Chris Katko wrote:
I want
to link to piece of D code at run-time. I want my D program to load,
scan for files which are whatever D-equivalent of a DLL/SO is, and load
those as well. Calling library functions, and having them call my core
functions.
It's the same as in
On Monday, 29 February 2016 at 22:12:37 UTC, jmh530 wrote:
On Monday, 29 February 2016 at 19:02:27 UTC, Chris Katko wrote:
Hello. Dlang newbie here.
Does D support run-time loading of D modules?
Basically, I'm looking to create an application with a plugin
interface.
I've seen a few posts,
On Monday, 29 February 2016 at 19:02:27 UTC, Chris Katko wrote:
Hello. Dlang newbie here.
Does D support run-time loading of D modules?
Basically, I'm looking to create an application with a plugin
interface.
I've seen a few posts, but they're dated and it's hard to keep
up with "What is
On Sunday, 28 February 2016 at 14:59:22 UTC, Mike Parker wrote:
On Sunday, 28 February 2016 at 13:10:20 UTC, Jirka wrote:
I have a question about ErrnoException. When I throw it (throw
new ErrnoException()), won't it overwrite the errno value
before it can capture it?
Its constructor [1]
Use a constructor instead.
On Monday, 29 February 2016 at 21:03:46 UTC, pham wrote:
Should codes below be compiled?
import std.stdio;
class Test
{
enum string[string] WorkAA =
[
"foo": "work"
];
immutable string[string] NotWorkAA1 =
[
"foo": "not
Should codes below be compiled?
import std.stdio;
class Test
{
enum string[string] WorkAA =
[
"foo": "work"
];
immutable string[string] NotWorkAA1 =
[
"foo": "not work"
];
string[string] NotWorkAA2 =
On Monday, 29 February 2016 at 19:02:27 UTC, Chris Katko wrote:
Hello. Dlang newbie here.
Does D support run-time loading of D modules?
Basically, I'm looking to create an application with a plugin
interface.
I've seen a few posts, but they're dated and it's hard to keep
up with "What is
Hello. Dlang newbie here.
Does D support run-time loading of D modules?
Basically, I'm looking to create an application with a plugin
interface.
I've seen a few posts, but they're dated and it's hard to keep up
with "What is the proper way to do X" when things change rapidly.
Last thing I
On Monday, 29 February 2016 at 12:43:39 UTC, Chris wrote:
What's the best way to make an assoc array fit for
multi-threading? If this is not possible what would be the best
alternative?
Say, for example, `data` is used by a class that is globally
accessible to all threads. E.g. like this:
On Sunday, 28 February 2016 at 03:08:14 UTC, mahdi wrote:
Thanks.
So the author was plain wrong about using enums instead of
strings. The misconception is due to assuming we can use
`string` variables at compile time but we cannot (as they are
run-time data).
Not exactly either.
auto square_root(T)(T x) if (isBasicType!T)
in
{
assert(x >= 0);
}
out (result)
{
assert((result * result) <= x && (result+1) * (result+1) > x);
}
body
{
return cast(long)std.math.sqrt(cast(real)x);
}
void main()
{
import std.stdio: writeln;
writeln(square_root(2));
}
Dne
Dne 29.2.2016 v 15:38 Ozan via Digitalmars-d-learn napsal(a):
T square_root(T)(T x) if (isBasicType!T) {
in
{
assert(x >= 0);
}
out (result)
{
assert((result * result) <= x && (result+1) * (result+1) > x);
}
body
{
return cast(long)std.math.sqrt(cast(real)x);
}
import
On Monday, 29 February 2016 at 14:38:52 UTC, Ozan wrote:
Is it possible to combine template conditions and contracts?
Like in the following
T square_root(T)(T x) if (isBasicType!T) {
in
{
assert(x >= 0);
}
out (result)
{
assert((result * result) <= x && (result+1) * (result+1) >
x);
On Monday, 29 February 2016 at 14:58:46 UTC, Alex Parrill wrote:
On Monday, 29 February 2016 at 14:50:51 UTC, Suliman wrote:
I am trying to check relative path on Linux for exists.
string mypath = "~/Documents/imgs";
~ is expanded by your shell. It is not a relative path, and
system calls
I am trying to check relative path on Linux for exists.
import std.stdio;
import std.path;
import std.file;
import std.string;
string mypath = "~/Documents/imgs";
void main()
{
if(!mypath.exists)
{
writeln(mypath, " do not exists");
}
On Monday, 29 February 2016 at 14:50:51 UTC, Suliman wrote:
I am trying to check relative path on Linux for exists.
import std.stdio;
import std.path;
import std.file;
import std.string;
string mypath = "~/Documents/imgs";
void main()
{
if(!mypath.exists)
{
On Monday, 29 February 2016 at 13:10:36 UTC, Edwin van Leeuwen
wrote:
On Monday, 29 February 2016 at 12:45:36 UTC, Suliman wrote:
On Monday, 29 February 2016 at 12:34:02 UTC, Edwin van Leeuwen
wrote:
Should it be like this?
http://www.everfall.com/paste/id.php?80k9jsgdx6o3
"versions":
Is it possible to combine template conditions and contracts?
Like in the following
T square_root(T)(T x) if (isBasicType!T) {
in
{
assert(x >= 0);
}
out (result)
{
assert((result * result) <= x && (result+1) * (result+1) > x);
}
body
{
return cast(long)std.math.sqrt(cast(real)x);
On Monday, 29 February 2016 at 12:45:36 UTC, Suliman wrote:
On Monday, 29 February 2016 at 12:34:02 UTC, Edwin van Leeuwen
wrote:
Should it be like this?
http://www.everfall.com/paste/id.php?80k9jsgdx6o3
"versions": ["VibeCustomMain"],
"versions": ["USE_MYSQL"],
As far as I know all
On Monday, 29 February 2016 at 12:34:02 UTC, Edwin van Leeuwen
wrote:
On Monday, 29 February 2016 at 12:27:04 UTC, Suliman wrote:
For example I have got app that depended on DDBC. In
configuration section DDBC related on:
"libs-posix": [
"sqlite3",
"pq"
]
Does it's mean that it will try to
What's the best way to make an assoc array fit for
multi-threading? If this is not possible what would be the best
alternative?
Say, for example, `data` is used by a class that is globally
accessible to all threads. E.g. like this:
string[string] data; // defined somewhere
public string
On Monday, 29 February 2016 at 12:27:04 UTC, Suliman wrote:
For example I have got app that depended on DDBC. In
configuration section DDBC related on:
"libs-posix": [
"sqlite3",
"pq"
]
Does it's mean that it will try to find this 2 libs in any
case? Even I do not use them.
If I do not
For example I have got app that depended on DDBC. In
configuration section DDBC related on:
"libs-posix": [
"sqlite3",
"pq"
]
Does it's mean that it will try to find this 2 libs in any case?
Even I do not use them.
If I do not need them what I should to do? Fix
~/.dub/packages/ddbc and
On 2016-02-29 12:58, Guest62942 wrote:
On Monday, 29 February 2016 at 11:48:35 UTC, Suliman wrote:
I have never tried to build my code on Linux (Ubuntu). Now I have error:
/usr/bin/ld: cannot find -levent
/usr/bin/ld: cannot find -levent_pthreads
Where I can get this lib?
On Monday, 29 February 2016 at 11:48:35 UTC, Suliman wrote:
I have never tried to build my code on Linux (Ubuntu). Now I
have error:
/usr/bin/ld: cannot find -levent
/usr/bin/ld: cannot find -levent_pthreads
Where I can get this lib?
I have never tried to build my code on Linux (Ubuntu). Now I have
error:
/usr/bin/ld: cannot find -levent
/usr/bin/ld: cannot find -levent_pthreads
Where I can get this lib?
On 29.02.2016 12:06, Suliman wrote:
On Windows next code work fine:
int len = fullimgurl.length;
On Linux DMD get error that:
Error: cannot implicitly convert expression (fullimgurl.length) of type
ulong to int
Why on every OS length have different size?
On Windows, the compiler flag -m32 is
On 01/03/16 12:06 AM, Suliman wrote:
On Windows next code work fine:
int len = fullimgurl.length;
On Linux DMD get error that:
Error: cannot implicitly convert expression (fullimgurl.length) of type
ulong to int
Why on every OS length have different size?
Its not OS dependent, its arch
On Windows next code work fine:
int len = fullimgurl.length;
On Linux DMD get error that:
Error: cannot implicitly convert expression (fullimgurl.length)
of type ulong to int
Why on every OS length have different size?
40 matches
Mail list logo