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 modyfi
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 hav
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": ["/pat
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
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://dlan
On Thu, 27 Nov 2014 22:25:10 +0100
Daniel Kozak via Digitalmars-d-learn
wrote:
> Dne Thu, 27 Nov 2014 22:21:52 +0100 ketmar via Digitalmars-d-learn
> napsal(a):
>
> > On Thu, 27 Nov 2014 21:14:57 +
> > Daniel Kozak via Digitalmars-d-learn
> > wrote:
> >
> >>import core.runtim
Dne Thu, 27 Nov 2014 22:21:52 +0100 ketmar via Digitalmars-d-learn
napsal(a):
On Thu, 27 Nov 2014 21:14:57 +
Daniel Kozak via Digitalmars-d-learn
wrote:
import core.runtime;
import std.c.process;
writeln("Can't find input file with list o
On Thu, 27 Nov 2014 21:14:57 +
Daniel Kozak via Digitalmars-d-learn
wrote:
> import core.runtime;
> import std.c.process;
> writeln("Can't find input file with list of links.");
> Runtime.terminate();
> exit(1);
please-plea
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 a
thanks! I understood!
Dne Thu, 27 Nov 2014 18:39:09 +0100 Suliman via Digitalmars-d-learn
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: http://www.opera.com/mail/
On Thu, 27 Nov 2014 20:42:31 +
Suliman via Digitalmars-d-learn
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 examples section there? you don't even
try first few sentences and looked at the example ;)
Dne Thu, 27 Nov 2014 21:42:31 +0100 Suliman via Digitalmars-d-learn
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 poštovní aplikací Opery: http://w
Dne Thu, 27 Nov 2014 21:20:24 +0100 Suliman via Digitalmars-d-learn
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;
foo ~= "config.txt";
Could you quote for me part of docs where it's written? I really
can't understand about what you are taking.
On Thu, 27 Nov 2014 20:20:24 +
Suliman via Digitalmars-d-learn
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 ~= "config.txt";
> w
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
D:/code/txtDownloa
On Thu, 27 Nov 2014 20:02:40 +
Suliman via Digitalmars-d-learn
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 `buildPath()` here too.
signature.a
see std.path, it contains alot of useful things.
I looked there, but found only buildNormalizedPath, but it's not
for such situation...
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.
--
Mik
On Thu, 27 Nov 2014 18:05:37 +
Suliman via Digitalmars-d-learn
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 path to get full path I
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
"C:\\folder\\
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.
Oh! It's work! I forgot to change path on my home PC!
Is there any way to detect where collision was occurred?
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.
impo
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
std.net.curl.download!(std.net.curl.
On Thu, 27 Nov 2014 17:22:35 +
Suliman via Digitalmars-d-learn
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`.
> >
> >
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 v
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 0
On Thu, 27 Nov 2014 13:07:58 +
Suliman via Digitalmars-d-learn
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)
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;
aut
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
napsáno:
I try to compile simple example:
import std.net.curl;
void main()
{
download("ftp.digitalmars.com/sieve.ds",
"D:\\Project\\
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 n
V Thu, 27 Nov 2014 13:39:40 +
Suliman via Digitalmars-d-learn
napsáno:
> 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:
>
> fun
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: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 bui
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 wit
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 exec
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))
{
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)
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?
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.");
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 onl
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.
[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 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,
48 matches
Mail list logo