Live without debugger?

2014-11-09 Thread Suliman via Digitalmars-d-learn
I know that a lot of people are using for programming tools like Sublime. I am one of them. But if for very simple code it's ok, how to write hard code? Do you often need debugger when you are writing code? For which tasks debugger are more needed for you?

Re: scope exception do not rise

2014-11-06 Thread Suliman via Digitalmars-d-learn
We have to look at the documentation of the function. In this case the possibilities are FileException and UTFException. http://dlang.org/phobos/std_file.html#.readText However, judging by their names, they are both descendants of Exception, so what you are doing will catch either of them.

scope exception do not rise

2014-11-05 Thread Suliman via Digitalmars-d-learn
void openFile(string fname, string current_folder) { auto file = readText(current_folder ~ fname); scope(failure) { writeln(failure); } // writeln(file); } if file name do not exists, I want to rise scope exception. But it's do not rise,

Re: scope exception do not rise

2014-11-05 Thread Suliman via Digitalmars-d-learn
I can't understand what I am missing. Try-catch block also do not handle exception: void main() { string fname = app.d1; //file name with error string current_folder = (getcwd() ~\\); writeln(current_folder); openFile(fname, current_folder); } void

Re: scope exception do not rise

2014-11-05 Thread Suliman via Digitalmars-d-learn
Am I right understand that keyword Exception is handle universal type of exceptions? catch (Exception) { writeln(inner); } But in my example with try block can I change it's to something more informative?

Re: scope exception do not rise

2014-11-05 Thread Suliman via Digitalmars-d-learn
Replace that with something like writeln(caught) and you will see that it is indeed caught. :) Printing the exception mimicks the default behavior and you (and I) think that the exception is not caught. :) that's work, but I can not understand where I can to look at exception level. If I

Re: how to expand tuple?

2014-11-02 Thread Suliman via Digitalmars-d-learn
Thanks! In which cases tuples can be helpful?

how to expand tuple?

2014-11-01 Thread Suliman via Digitalmars-d-learn
Few questions. 1. In examples tuples are created with keyword auto. Can I create them with another keyword. Or auto mean structure of data, that have not standard type like (int or string)? 2. How ti expend tuple? I tried to do: auto imglist = tuple(aaa); imglist.expand[sss];

Re: Dart bindings for D?

2014-10-30 Thread Suliman via Digitalmars-d-learn
Is it's possible to create single language that cover desktop and web? Like D+Dart? I ask becouse I can't understand why it's need 2 language if they are very simmiler and it's can be 1 language instead 2.

Re: Dart bindings for D?

2014-10-30 Thread Suliman via Digitalmars-d-learn
I know that there is way to write all on JS. But I can't understand what the reason that there are no single language that can work on web and as native language.

Re: Dart bindings for D?

2014-10-30 Thread Suliman via Digitalmars-d-learn
It is possible, but you need to design the language within the constraints of javascript: 1. single threaded (or worker threads) 2. 53 bits integers, 26 bits for multiplies. 4. weird fixed size heaps (ArrayView) 5. if garbage collection then it has to be javascript style 6. no tricks:

Re: Dart bindings for D?

2014-10-30 Thread Suliman via Digitalmars-d-learn
No! I mean not translation to js. I mean theoretical ability of creation new programming language that can work every where!

Re: HTML Parsing lib

2014-10-26 Thread Suliman via Digitalmars-d-learn
Unfortunately that library has no dub package. But you can include it in your project. See info here http://code.dlang.org/package-format I can't understand how to set in dub that I need to to include in compilation process other files... Could you help me?

Compatibility with D regexp constructor

2014-10-25 Thread Suliman via Digitalmars-d-learn
Where I can find compatibility with D online regexp constructor?

HTML Parsing lib

2014-10-25 Thread Suliman via Digitalmars-d-learn
I found only https://github.com/Bystroushaak/DHTMLParser But I can't get it work: C:\Users\Dima\Downloads\DHTMLParser-master\DHTMLParser-masterdmd find_links.d OPTLINK (R) for Win32 Release 8.00.15 Copyright (C) Digital Mars 1989-2013 All rights reserved.

Re: HTML Parsing lib

2014-10-25 Thread Suliman via Digitalmars-d-learn
You need to pass a library to compiler as well (all its files or .lib/.a file) if it is compiled as static library You can try dmd find_links.d dhtmlparser.d quote_escaper.d C:\Users\Dima\Downloads\DHTMLParser-master\DHTMLParser-masterdmd find_links.d quote_escaper.d OPTLINK (R) for

Re: HTML Parsing lib

2014-10-25 Thread Suliman via Digitalmars-d-learn
On Saturday, 25 October 2014 at 19:51:48 UTC, Suliman wrote: You need to pass a library to compiler as well (all its files or .lib/.a file) if it is compiled as static library You can try dmd find_links.d dhtmlparser.d quote_escaper.d

Re: HTML Parsing lib

2014-10-25 Thread Suliman via Digitalmars-d-learn
How I can build such App with DUB?

Error: cannot implicitly convert expression

2014-10-23 Thread Suliman via Digitalmars-d-learn
import std.stdio; import std.conv; import std.string; import std.net.curl; void main() { string content = get(d-lang.appspot.com/testUrl2); } Error: cannot implicitly convert expression (get(d-lang.appsp ot.com/testUrl2, AutoProtocol())) of type char[] to string code from:

Re: Error: cannot implicitly convert expression

2014-10-23 Thread Suliman via Digitalmars-d-learn
Solution http://forum.dlang.org/thread/bgkklxwbhrqdhveth...@forum.dlang.org#post-l639dt:24vlj:241:40digitalmars.com Am I right understand that it's bug in doc?

D developing on ARM board

2014-10-19 Thread Suliman via Digitalmars-d-learn
I am planing to buy ARM-Board. I would use it for internet browsing and whant to know would it's possible to develop D apps on it? I had read that LDC have limited support of ARM. wiki said that it can compile hello-world apps. But it it not enough. What about DMD. Is there any progress of

Remove filename from path

2014-09-24 Thread Suliman via Digitalmars-d-learn
What is the best way to remove file name from full path? string path = thisExePath()

Re: Remove filename from path

2014-09-24 Thread Suliman via Digitalmars-d-learn
string path = thisExePath() Seems like dirName in std.path is a good candidate ;) http://dlang.org/phobos/std_path.html#.dirName You'll find many other path manipulation functions there. Thanks! But if I want to strip it, how I can cut it?

Re: Remove filename from path

2014-09-24 Thread Suliman via Digitalmars-d-learn
I can't understand how to use strip? For example I would like to cut just extension. path = path.stripRight(exe); Error: no overload matches for stripRight(C)(C[] str) if

Recursive function call

2014-09-24 Thread Suliman via Digitalmars-d-learn
string getFileName() { //чтобы было проще обрабатываемый файл будем хранить рядом с бинариком string filename = chomp(readln()); string path = getcwd(); writeln((path ~ \\ ~ filename)); if (exists(path ~ \\ ~ filename)) return (path ~ \\ ~

can't understand why code do not working

2014-09-22 Thread Suliman via Digitalmars-d-learn
Already 1 hour I am looking at example from http://ddili.org/ders/d.en/concurrency.html and my modification of it, and can't understand what's difference? Why it's output only: 1 3 and then do not do nothing! import std.stdio; import std.concurrency; import core.thread; void main() {

Re: can't understand why code do not working

2014-09-22 Thread Suliman via Digitalmars-d-learn
void worker() { int value = 0; while (value =10) { value = receiveOnly!int(); writeln(value); int result = value * 3; ownerTid.send(result); } } give me: Running .\app1.exe 2 6 3 9 4 12 5 15 6 18

Re: dub can't read files from cache

2014-09-17 Thread Suliman via Digitalmars-d-learn
Is it's possible to change dub package cache dir?

Re: Iterating over the tupleof of a struct

2014-08-23 Thread Suliman via Digitalmars-d-learn
How can I feel struct with foreach loop? struct ConfigStruct { string [string] key1; string [string] key2; } ConfigStruct confstruct; foreach (i, line; readText(ConfigName).splitLines()) { string [] keyvalue = line.split(=); confstruct.key1[keyvalue[0]] = keyvalue[1]; } it's ok for 1

How I can iterate data in structure

2014-08-22 Thread Suliman via Digitalmars-d-learn
void main() { auto result = readconfig(); foreach (_; result) { // I want to iterate result that I got from structure. } } auto readconfig() { struct ConfigStruct { string key1; string key2;

Re: How I can iterate data in structure

2014-08-22 Thread Suliman via Digitalmars-d-learn
foreach (field; result.tupleof) Why I should here specify type of iterable element, but not first element that I use for iteration? I mean: foreach (_some_type_possible_enum_ field; result) ?

Re: BitArray - preview of what's to come?

2014-08-22 Thread Suliman via Digitalmars-d-learn
bool[4] x = [1, 1, 0, 0]; BitArray ba = BitArray(x); When I try to compile this I am getting error: source\app.d(13): Error: cannot implicitly convert expression (x) of type bool[4] to uint What I am doing wrong?

Re: Contributing to D language

2014-06-23 Thread Suliman via Digitalmars-d-learn
A lot of developers will say thanks if you help with developing DGUI https://bitbucket.org/dgui/dgui/ D very need native and easy to use GUI lib...

Re: DFL is the best UIcontrols for D,compare it to dwt, tkd,dtk,dlangui,anchovy......

2014-05-13 Thread Suliman via Digitalmars-d-learn
DFL is really cool. Not all programmers need complex toolkits. A lot of need easy to learning toolkits for medium projects. It would be cool if somebody will handle developing of DFL. It's better to have one such toolkit, than tons of complex and not finished toolkits.

Re: Global variables read at compile time?

2014-05-06 Thread Suliman via Digitalmars-d-learn
I have got same error. I need to pass in instance of class constant, but got error Error: static variable cannot be read at compile http://www.everfall.com/paste/id.php?1mc9mb9cxyie When I had create instance of class in main, and create confvarible above it all worked, but when I had moved

Re: Global variables read at compile time?

2014-05-06 Thread Suliman via Digitalmars-d-learn
Thanks! But is there any other solution? I am thinking that I am trying to specify config name by wrong way...

Re: Global variables read at compile time?

2014-05-06 Thread Suliman via Digitalmars-d-learn
I am tying to hardcode name of config file name. Then I would read and parse it.

Re: Read Complete File to Array of Lines

2014-05-06 Thread Suliman via Digitalmars-d-learn
I am trying to write simple parser, that split text to key value name = david lastname = wood here is my code: foreach (line; readText(confname).splitLines()) { writeln(line); foreach (str; split(line, =))

strange error with std.net.curl

2014-05-04 Thread Suliman via Digitalmars-d-learn
I am trying to compile next code: import std.net.curl; import std.stdio; void main() { writeln(get(https://google.com/;)); } and got next error http://www.everfall.com/paste/id.php?y37dr6qmu54h

<    1   2   3   4   5