On Thursday, 27 November 2014 at 00:27:59 UTC, David Held wrote:
On 11/23/2014 3:12 PM, anonymous wrote:
[...]
And even pointer dereferencing is @safe. Invalid ones will fail
with a segfault at run time:
void foo(int* a) @safe {*a = 13;}
Hmm...throwing an exception is a well-defined behavior,
[Maybe this has been asked before.]
I usually use dub to create and build projects. I built one of
the projects with dub and then by hand with dmd[1] passing all
the files etc. Turned out that the executable built with dub was
1.4 MB whereas the one built by hand was only 807 kB. Why is that?
[Maybe this has been asked before.]
I usually use dub to create and build projects. I built one of
the projects with dub and then by hand with dmd[1] passing all
the files etc. Turned out that the executable built with dub was
1.4 MB whereas the one built by hand was only 807 kB. Why is that?
On Wednesday, 26 November 2014 at 04:10:08 UTC, Vlad Levenfeld
wrote:
So I used the dmd visual studio project to build dmd
It can be outdated, because dmd release is built by dmc, not vc.
On Thursday, 27 November 2014 at 09:33:49 UTC, Chris wrote:
I usually use dub to create and build projects. I built one of
the projects with dub and then by hand with dmd[1] passing all
the files etc. Turned out that the executable built with dub
was 1.4 MB whereas the one built by hand was
Full function look like this:
auto parseConfig()
{
auto config = Ini.Parse(getcwd ~ \\ ~ config.ini);
string txtlinks = getcwd ~ \\ ~ config.getKey(input_links);
if(!exists(txtlinks))
{
writeln(Can't find input file with list of links.);
auto parseConfig()
{
auto lines = File(txtlinks, r).byLine;
return lines;
}
Error: cannot return non-void from void function
I can't understand the reasons of the error;
Can I return auto from function?
I try to compile simple example:
import std.net.curl;
void main()
{
download(ftp.digitalmars.com/sieve.ds,
D:\\Project\\2014\\txt_downloader\\img\\1.foo);
}
but I am getting error:
function app.download (string[] links) is not callableusing
argument types (string, string)
On Thursday, 27 November 2014 at 13:07:59 UTC, Suliman wrote:
Full function look like this:
auto parseConfig()
{
auto config = Ini.Parse(getcwd ~ \\ ~ config.ini);
string txtlinks = getcwd ~ \\ ~ config.getKey(input_links);
if(!exists(txtlinks))
{
On Thursday, 27 November 2014 at 12:29:03 UTC, Gary Willoughby
wrote:
On Thursday, 27 November 2014 at 09:33:49 UTC, Chris wrote:
I usually use dub to create and build projects. I built one of
the projects with dub and then by hand with dmd[1] passing all
the files etc. Turned out that the
On Thursday, 27 November 2014 at 13:56:19 UTC, Chris wrote:
On Thursday, 27 November 2014 at 12:29:03 UTC, Gary Willoughby
wrote:
On Thursday, 27 November 2014 at 09:33:49 UTC, Chris wrote:
I usually use dub to create and build projects. I built one
of the projects with dub and then by hand
On Thursday, 27 November 2014 at 13:59:23 UTC, CraigDillabaugh
wrote:
On Thursday, 27 November 2014 at 13:56:19 UTC, Chris wrote:
On Thursday, 27 November 2014 at 12:29:03 UTC, Gary Willoughby
wrote:
On Thursday, 27 November 2014 at 09:33:49 UTC, Chris wrote:
I usually use dub to create and
Look like it was missed installation or so. I installed new copy
of dmd and error gone away.
The downloading still do not work. Work only:
get(dlang.org);
On Thursday, 27 November 2014 at 13:39:41 UTC, Suliman wrote:
I try to compile simple example:
import std.net.curl;
void main()
{
download(ftp.digitalmars.com/sieve.ds,
D:\\Project\\2014\\txt_downloader\\img\\1.foo);
}
but I am getting error:
function app.download (string[] links) is not
On Thursday, 27 November 2014 at 14:35:08 UTC, Daniel Kozák via
Digitalmars-d-learn wrote:
V Thu, 27 Nov 2014 13:39:40 +
Suliman via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
napsáno:
I try to compile simple example:
import std.net.curl;
void main()
{
Hi,
I implement a network protocol and use an Appender!(ubyte[])().
I have following issue. The first three bytes I have to fill,
the following bytes are reserved and must be 0. In this example
the overall header length must be 8.
import std.array: appender;
const HEADER_LENGTH = 8;
On Thu, 27 Nov 2014 13:07:58 +
Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Full function look like this:
auto parseConfig()
{
auto config = Ini.Parse(getcwd ~ \\ ~ config.ini);
string txtlinks = getcwd ~ \\ ~ config.getKey(input_links);
On Thursday, 27 November 2014 at 14:14:50 UTC, Chris wrote:
On Thursday, 27 November 2014 at 13:59:23 UTC, CraigDillabaugh
wrote:
On Thursday, 27 November 2014 at 13:56:19 UTC, Chris wrote:
On Thursday, 27 November 2014 at 12:29:03 UTC, Gary
Willoughby wrote:
On Thursday, 27 November 2014 at
ah, that's it! as spec says, D determines function return value
from
the first 'return' statement it seen. in your case this is
`return;`,
so function return type is determined to be `void`.
if you doing `auto` functions, try to arrange your code so the
first
`return` returning the actual
On Thu, 27 Nov 2014 17:22:35 +
Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
ah, that's it! as spec says, D determines function return value
from
the first 'return' statement it seen. in your case this is
`return;`,
so function return type is
Running .\txtdownloader.exe
std.stream.OpenException@std\stream.d(50): Cannot open or create
file 'D:\Projec
t\2014\txt_downloader\img\1.foo'
0x0041BA59 in void std.stream.File.open(immutable(char)[],
std.stream.FileMode)
0x00404B75 in void
On Thursday, 27 November 2014 at 16:08:13 UTC, Andre wrote:
Hi,
I implement a network protocol and use an Appender!(ubyte[])().
I have following issue. The first three bytes I have to fill,
the following bytes are reserved and must be 0. In this example
the overall header length must be 8.
Is there any way to detect where collision was occurred?
Oh! It's work! I forgot to change path on my home PC!
On Thursday, 27 November 2014 at 17:39:10 UTC, Suliman wrote:
Is there any way to detect where collision was occurred?
It's look like collision was with method name.
Sometimes it's path string may do not have tail slash of the path
Compare:
string path = C:\\folder\\name
string path = C:\\folder\\name\\
in case if I need to append file name to path to get full path I
can get error like:
path ~= foo.txt
C:\\folder\\namefoo.txt
instead of
On Thu, 27 Nov 2014 18:05:37 +
Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Sometimes it's path string may do not have tail slash of the path
Compare:
string path = C:\\folder\\name
string path = C:\\folder\\name\\
in case if I need to append file name to
On 11/27/2014 03:14 PM, Chris wrote:
dub says:
Compiling using dmd...
Linking...
I have the exact same setting, I think. I don't build for release with
either method.
dmd file1.d file2.d file3.d ...
(dub compiles the same files, no release build)
dub builds with --debug by default.
--
see std.path, it contains alot of useful things.
I looked there, but found only buildNormalizedPath, but it's not
for such situation...
On Thu, 27 Nov 2014 20:02:40 +
Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
see std.path, it contains alot of useful things.
I looked there, but found only buildNormalizedPath, but it's not
for such situation...
take a second look then. ;-) you'll find
take a second look then. ;-) you'll find `buildPath()` here too.
Not better:
string foo = D:/code/txtDownloader;
writeln(foo);
foo = foo.buildPath;
foo ~= config.txt;
writeln(foo);
Running .\txtdownloader.exe
D:/code/txtDownloader
On Thu, 27 Nov 2014 20:20:24 +
Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
take a second look then. ;-) you'll find `buildPath()` here too.
Not better:
string foo = D:/code/txtDownloader;
writeln(foo);
foo = foo.buildPath;
foo ~=
Could you quote for me part of docs where it's written? I really
can't understand about what you are taking.
Dne Thu, 27 Nov 2014 21:20:24 +0100 Suliman via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com napsal(a):
take a second look then. ;-) you'll find `buildPath()` here too.
Not better:
string foo = D:/code/txtDownloader;
writeln(foo);
foo = foo.buildPath;
try first few sentences and looked at the example ;)
Dne Thu, 27 Nov 2014 21:42:31 +0100 Suliman via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com napsal(a):
Could you quote for me part of docs where it's written? I really can't
understand about what you are taking.
--
Vytvořeno
On Thu, 27 Nov 2014 20:42:31 +
Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Could you quote for me part of docs where it's written? I really
can't understand about what you are taking.
right here: http://dlang.org/phobos/std_path.html#buildPath
do you see
Dne Thu, 27 Nov 2014 18:39:09 +0100 Suliman via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com napsal(a):
Is there any way to detect where collision was occurred?
Yes, read error description it has been app.download I guess
--
Vytvořeno poštovní aplikací Opery:
thanks! I understood!
On Thursday, 27 November 2014 at 17:22:36 UTC, Suliman wrote:
ah, that's it! as spec says, D determines function return
value from
the first 'return' statement it seen. in your case this is
`return;`,
so function return type is determined to be `void`.
if you doing `auto` functions, try to
On Thu, 27 Nov 2014 21:14:57 +
Daniel Kozak via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
import core.runtime;
import std.c.process;
writeln(Can't find input file with list of links.);
Runtime.terminate();
Dne Thu, 27 Nov 2014 22:21:52 +0100 ketmar via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com napsal(a):
On Thu, 27 Nov 2014 21:14:57 +
Daniel Kozak via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
import core.runtime;
import
On Thu, 27 Nov 2014 22:25:10 +0100
Daniel Kozak via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Dne Thu, 27 Nov 2014 22:21:52 +0100 ketmar via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com napsal(a):
On Thu, 27 Nov 2014 21:14:57 +
Daniel Kozak via
On Thursday, 27 November 2014 at 20:52:26 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 27 Nov 2014 20:42:31 +
Suliman via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
Could you quote for me part of docs where it's written? I
really can't understand about what you
hi,
i'm trying to get a thrift example working within a dub project.
it seems that the thrift.d in the dub repo is not whats actually
needed but
i should link against libthriftd.a that comes from the official
thrift distro.
what i tried is add the following to dub.json:
libs:
Thanks a lot for the help.
Kind regards
André
On Thursday, 27 November 2014 at 17:29:50 UTC, Marc Schütz wrote:
On Thursday, 27 November 2014 at 16:08:13 UTC, Andre wrote:
Hi,
I implement a network protocol and use an Appender!(ubyte[])().
I have following issue. The first three bytes I
In D we a several data types which are passed by reference:
dynamic arrays, associative arrays. And sometimes we need to pass
these reference data to class instance to store it inside. One of
the principles of object-oriented programming is incapsulation.
So all class data should be only
47 matches
Mail list logo