Re: Some feedback on the website.

2015-12-17 Thread Jacob Carlborg via Digitalmars-d

On 2015-12-16 21:54, Walter Bright wrote:


I'm not so sure. There are lots of tools to develop websites. Let's say
A, B, and C. If we picked "B", we most assuredly would have analogous
threads here saying "I won't use anything but A" and "Everybody else
uses C."


Anything that is explicitly created for web development would be better.


I've heard all sorts of excuses for decades about why people won't chip
in, and I know they are excuses because when the excuse is fixed, they
still won't chip in. This excuse sounds the same as the rest.

The thing is, if you know html, then you know Ddoc. Ddoc is just a
stupidly simple text-substitution macro system a programmer should be
able to learn in a few minutes.


I know HTML, and I know there's no problem with underscores in HTML. Yet 
Ddoc is causing issues with underscores because Latex is used to 
generate the PDF [1].


[1] http://forum.dlang.org/post/n4tpdd$2kun$1...@digitalmars.com

--
/Jacob Carlborg


Re: Some feedback on the website.

2015-12-17 Thread Jacob Carlborg via Digitalmars-d

On 2015-12-16 23:32, H. S. Teoh via Digitalmars-d wrote:


This is a limitation of ddoc that needs to be fixed.  Historically,
template functions used to be written like this:

template amap(Args...)
{
auto amap(Args args) {
implementation();
}
}

Then a shorthand was introduced (the so-called "eponymous template"
syntax), such that the above incantation could be abbreviated to:

auto amap(Args...)(Args args) {
implementation();
}

It would appear that ddoc came after eponymous templates became the
norm, so currently, ddoc only understands ddoc comments attached to the
latter syntax, while it fails to recognize that the former syntax is
actually equivalent.  Several other functions in Phobos suffer from the
resulting formatting disparity, IIRC map(), and maybe reduce(), and one
or two others. It's rare enough that we don't encounter it very often,
but the functions affected happen to be ones that are likely to be
frequently used, so we really ought to fix this limitation in ddoc.


How would Ddoc know that you want to document the function and not the 
template? Just assume so if there's only one symbol in the template? It 
still needs to be possible to individually document the template and the 
function, and least when there's more than one symbol in the template.


--
/Jacob Carlborg


Re: We need better documentation for functions with ranges and templates

2015-12-17 Thread ZombineDev via Digitalmars-d

On Thursday, 17 December 2015 at 07:19:04 UTC, Jon D wrote:

On Monday, 14 December 2015 at 19:04:46 UTC, bachmeier wrote:
Something has to be done with the documentation for Phobos 
functions that involve ranges and templates.


Many useful ideas in this thread. One I don't recall seeing - a 
standard way to denote whether a routine is lazy or eager. I'm 
finding this to be a key piece of information. Many standard 
library routines document this in the description, but presence 
and presentation is not very consistent. It'd be nice to have 
this presented in a standard way for routines operating on 
ranges.


--Jon


Yes this something important that is missing. It is currently up 
to the documentation of a particular function to explain this. I 
think originally std.range was supposed to be lazy and 
std.algorithm - eager, but currently it's not a clear cut. Also 
in different contexts you may need a lazy version of an eager 
algorithm and vice-versa.


Re: Some feedback on the website.

2015-12-17 Thread Jacob Carlborg via Digitalmars-d

On 2015-12-16 21:59, Andrei Alexandrescu wrote:


If some of these are unnecessary, they can be easily fixed. There's no
problem with breaking other people's code etc.

Which would you eliminate?


A sane doc generation system would need at most two 
macros/syntaxes/functions to create links. One macro accepting a symbol 
name (fully qualified or not) used for cross-referencing and one macro 
used for page and external links, accepting a relative or an absolute URL.


It's also possible to manged without any of these at all. The doc tool 
could automatically do cross-referencing and detect URL's.


--
/Jacob Carlborg


Re: New D book available for pre-order: D Web Development

2015-12-17 Thread Kai Nacke via Digitalmars-d-announce

On Monday, 30 November 2015 at 03:36:29 UTC, Nick B wrote:

On Sunday, 29 November 2015 at 18:24:38 UTC, Kai Nacke wrote:

On Wednesday, 25 November 2015 at 04:35:47 UTC, Nick_B wrote:




Hi Nick!

Yes, the book will be available in hardcopy.

Proposed publication date is January 2016.

Regards,
Kai



Kai - Are you saying that the hardcopy will be available Jan 
2016 ?


Nick


Yes, it should. I finished all my rework. The book is now in the 
production phase...


Regards,
Kai


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Mike Parker via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:




What would be a good code font to use for those?



http://sourcefoundry.org/hack/


Re: Some feedback on the website.

2015-12-17 Thread Jacob Carlborg via Digitalmars-d

On 2015-12-17 00:46, Andrei Alexandrescu wrote:


Overall I think a few additions to the macro engine could be very
beneficial. E.g. while working on dconf.org I could use $(IF a, b, c) to
expand b if a is nonempty and c otherwise.


Oh, God, please no. Just use vibe.d and be done with it. We obviously 
need a proper programming language to generate dconf.org.


--
/Jacob Carlborg


Re: exit(1)?

2015-12-17 Thread Shriramana Sharma via Digitalmars-d-learn
Jakob Ovrum wrote:

> The example should be restructured to `return 1;`
> from `main`.

https://github.com/D-Programming-Language/phobos/pull/3875

-- 
Shriramana Sharma, Penguin #395953


Re: Some feedback on the website.

2015-12-17 Thread wobbles via Digitalmars-d
On Thursday, 17 December 2015 at 08:06:28 UTC, Jacob Carlborg 
wrote:

On 2015-12-17 00:46, Andrei Alexandrescu wrote:

Overall I think a few additions to the macro engine could be 
very
beneficial. E.g. while working on dconf.org I could use $(IF 
a, b, c) to

expand b if a is nonempty and c otherwise.


Oh, God, please no. Just use vibe.d and be done with it. We 
obviously need a proper programming language to generate 
dconf.org.


That would be a whole re-write of the website though.

It would be preferable of course. The official D site being run 
through one of it's more popular libraries (it's most popular 
library maybe?) can only be a good thing.


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Guillaume Chatelet via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


Thanks,

Andrei


Maybe one of the monospace fonts here
https://www.google.com/fonts

From the about page
https://www.google.com/fonts#AboutPlace:about

"A web with web fonts is more beautiful, readable, accessible and 
open." ... "Our API service makes it easy to add Google Fonts to 
a website in seconds. The service runs on Google's servers which 
are fast, reliable and tested. Google provides this service free 
of charge." ... "All of the fonts are Open Source."


Re: DlangIDE - initial GDB debugger support

2015-12-17 Thread ZombineDev via Digitalmars-d-announce
On Wednesday, 16 December 2015 at 12:50:25 UTC, Vadim Lopatin 
wrote:
On Tuesday, 8 December 2015 at 15:58:43 UTC, Vadim Lopatin 
wrote:

Hello,

DlangIDE is getting close to usable.
DlangIDE is and IDE for D programming language written in D 
using DlangUI library.


Project page: https://github.com/buggins/dlangide

To try, use `dub fetch dlangide && dub run dlangide` try to 
create and run DlangUI Helloworld project, or open Tetris 
project from workspaces/tetris.


Initial GDB debugging support is implemented.

You can start / stop debugging, set breakpoints, step 
in/out/over, continue.


TODO: stack trace & local variables display


As well, following features implemented:
- bookmarks in source files (toggle, go to next/prev)
- recent workspace list


Exellent progress! Congrats!


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Jacob Carlborg via Digitalmars-d

On 2015-12-17 00:25, Andrei Alexandrescu wrote:


I was hoping for a nicer one and courier new as a fallback.


I use Menlo. I think that's default in TextMate, perhaps Xcode is uing 
that as well. Before that I used Monaco. I'm pretty sure they are both 
available by default on OS X. I'm not sure if it needs to be the same 
font on all platforms.


--
/Jacob Carlborg


Re: exit(1)?

2015-12-17 Thread Jakob Ovrum via Digitalmars-d-learn
On Thursday, 17 December 2015 at 07:33:36 UTC, Jacob Carlborg 
wrote:
I agree with that, but why don't the runtime register a 
function with "atexit" that cleans up everything?


I think it might be possible, but it doesn't sound trivial. In 
particular, all threads and fibers managed by druntime need to 
have their stacks rewinded.




Trying to build dlang.org - what am I doing wrong

2015-12-17 Thread wobbles via Digitalmars-d
So - the conversation about the website/documentation piqued my 
interest a bit and I decided to have a go at making the 
documentation more readable.


However, reading the instructions from:
http://wiki.dlang.org/Starting_as_a_Contributor#Fetch_and_build_dlang.org

It should be a simple matter of:
```bash
mkdir -p ~/code; cd ~/code
git clone https://github.com/D-Programming-Language/dlang.org
cd dlang.org
make -f posix.mak LATEST=2069.2
```

However, I get a std.net.curl error during compilation of dub 
(luckily dlang.org doesn't depend on dub, so it doesn't 
particularly matter and I can carry on with my tinkering).


http://pastebin.com/q41AnJyr

I assume theres a problem with the makefiles here - or is it 
stupid user syndrome?


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Andrea Fontana via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


Thanks,

Andrei


https://www.google.com/fonts

Try with some text like:

0OQ iI1lL 2Z ~ () [] {}

Ubuntu Mono
Source Code Pro
Inconsolata



TreeViews in tkd

2015-12-17 Thread TheGag96 via Digitalmars-d-learn
I've been trying to get into tkd to make some GUI apps, since it 
looked like the simplest/intuitive library out there so far. I've 
been attempting to use their TreeViews to make interactable lists 
of things, but it almost looks like there's some missing 
functionality.


For example, I'm not sure there are any ways to delete individual 
rows from one. You can clear them all entries, but there doesn't 
look to be a method for just getting rid of one row - if there 
is, I can't find it. Calling destroy() on an individual row does 
not remove it either (yet apparently destroy() effects the GUI in 
tkd, not just finalizing the object). It also doesn't look like 
there's a way to get a row by an index or ID, either. You can get 
columns... But the only way you can a row object is through 
getSelectedRows(). Am I missing something here?


I made an issue on GitHub but I'm not sure I'll get anything 
back, it's been 9 months since the last commit.


Has anyone worked with this before and could give me some tips? 
Thanks!


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread rumbu via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


Thanks,

Andrei


On Windows, it doesn't look so awful::

http://imgur.com/8BuNoG6

That's probably because Verdana is installed by default and the 
body style is defined as "Bitstream Vera Sans", sans-serif>


Re: We need better documentation for functions with ranges and templates

2015-12-17 Thread Timon Gehr via Digitalmars-d

On 12/17/2015 01:06 AM, John Colvin wrote:


One doesn't need to know any results or definitions from complexity
theory in order to understand what O(n) means. What it means here is
that for large enough n the actual number is bounded from above by n
multiplied by some unspecified constant.
(In contexts like this, there is generally also an informal assumption
that the unspecified constants are reasonably small.)


Perhaps it's the physicist in me, but I like this way of thinking about it:

Given a running time R(n), the time-complexity


I would just say that R(n) is (in) O(f(n)). ('Complexity' does not even 
imply that the statement that follows talks about asymptotics.)



is given by  O(f(n)) iff


(Note that O(f(n)) is an upper bound.)


df/dn = lim_{n -> inf} dR(n)/dn

Is that also a correct expression?


What this is saying is that for large n, R is approximately a linear 
polynomial and that f is a linear polynomial with the limiting slope. In 
particular, 2·n is not in O(n) with this definition and O(n²) is empty.


Probably the intended meaning was different.


Obviously I'm papering over the
discretisation, but well, I did say physicist... :)




Re: We need better documentation for functions with ranges and templates

2015-12-17 Thread Ola Fosheim Grøstad via Digitalmars-d

On Wednesday, 16 December 2015 at 23:02:53 UTC, H. S. Teoh wrote:
Any programmer that has any pretense of caring about the 
performance of their code ought to know what O(n) means. It's 
not that hard to understand. There are plenty of online 
resources to learn about this, even if you didn't have the 
privilege of having received formal computer science education.


Yes, just use the term "Worst case time complexity is O(n)".

A simple search on google for "time complexity" gives me a nice 
textual and graphical explanation.




How to replace inside regex?

2015-12-17 Thread Suliman via Digitalmars-d-learn

I can't understand how to replace in regex. I have got next task:
find all commas in strings inside quotes and replace them.

foo, bar, "hello, user", baz

I wrote next regexp that find part that include commas inside the 
quotes:

auto partWithComma = matchAll(line, r);

but I can't understand how to replace commas here. I have only 
ideas to do something like:


auto partWithComma = matchAll(line, r).replaceAll(",", " ");







[Issue 15456] sc.ini: Access denied for non-superusers on Windows 10

2015-12-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15456

--- Comment #2 from David Eckardt  ---
This happened with the dmd-2.069.2 installer

http://downloads.dlang.org/releases/2.x/2.069.2/dmd-2.069.2.exe

on Windows 10 Home, using the default installation options, which install it in
the C:\D\ directory.

--


Re: Some feedback on the website.

2015-12-17 Thread Marc Schütz via Digitalmars-d

On Wednesday, 16 December 2015 at 22:32:25 UTC, H. S. Teoh wrote:
On Wed, Dec 16, 2015 at 10:00:50PM +, Meta via 
Digitalmars-d wrote:
There's also weird stuff like this, with an outer template and 
a documented inner template function.


http://dlang.org/phobos/std_parallelism.html#.TaskPool.amap.amap


This is a limitation of ddoc that needs to be fixed.  
Historically, template functions used to be written like this:


template amap(Args...)
{
auto amap(Args args) {
implementation();
}
}

Then a shorthand was introduced (the so-called "eponymous 
template" syntax), such that the above incantation could be 
abbreviated to:


auto amap(Args...)(Args args) {
implementation();
}

It would appear that ddoc came after eponymous templates became 
the norm, so currently, ddoc only understands ddoc comments 
attached to the latter syntax, while it fails to recognize that 
the former syntax is actually equivalent.  Several other 
functions in Phobos suffer from the resulting formatting 
disparity, IIRC map(), and maybe reduce(), and one or two 
others. It's rare enough that we don't encounter it very often, 
but the functions affected happen to be ones that are likely to 
be frequently used, so we really ought to fix this limitation 
in ddoc.


I think in this particular case it can only be done with a nested 
template, because there are two variadic parameters.


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/17/2015 03:07 AM, Mike Parker wrote:

On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei Alexandrescu wrote:



What would be a good code font to use for those?



http://sourcefoundry.org/hack/


Could someone please round up this and other proposals into pull 
requests? Then we can see them displayed in Vladimir's rig. Thanks! -- 
Andrei


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Kagamin via Digitalmars-d

On Wednesday, 16 December 2015 at 21:32:29 UTC, H. S. Teoh wrote:

Any monospaced font should do?


Monospaced fonts have a common problem that they display "mm" as 
a tight knot of vertical lines (relevant for the commonPrefix 
example in the pull).


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Suliman via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


Thanks,

Andrei


Is it's possible to colourize  content like in, out, optional 
parameters etc?




Re: Voting For std.experimental.ndslice

2015-12-17 Thread Robert burner Schadek via Digitalmars-d
On Wednesday, 16 December 2015 at 17:49:03 UTC, Ilya Yaroshenko 
wrote:



* Miscellaneous
** string mixins. I think some of the string mixins can be 
removed for something more readable/debuggable

**


I have not found examples where string mixins can be removed. 
Please refer to particular example. The code for `sliced` and 
`assumeSorted` looks ugly. But I don't know how is can be done 
another way. Remove this functionality is an option.


template sliced(Names...)

you can simple compute the strings and than pass them as template 
parameter or as alias to another function.


If that becomes unpractical at least use q{ } strings



Re: Error 42: Symbol Undefined __lseeki64

2015-12-17 Thread Byron Heads via Digitalmars-d-learn

On Thursday, 17 December 2015 at 04:11:56 UTC, tcak wrote:
I searched the function "__lseek64" under /usr/include/dmd" 
with "grep -R __lseek64", but nothing is found. I work on Linux 
64-bit. So, I guess it is either Windows related, or 32bit dmd 
related. "lseek64" is found in "unistd.d", but this doesn't 
solve any problem.


After some testing it seems that
-m32mscoff and -m64 both build correctly so its related to 32bit 
dmd on windows






Why `i` not working on foreach loop if it have byLine option

2015-12-17 Thread Suliman via Digitalmars-d-learn

Next code produce error:

 foreach(i, line;fileContent.byLine)

Error: cannot infer argument types, expected 1 argument, not 2

Why it's do not work?


Re: D float types operations vs C++ ones

2015-12-17 Thread Nicholas Wilson via Digitalmars-d-learn

On Thursday, 17 December 2015 at 11:58:35 UTC, drug wrote:

On 17.12.2015 14:52, Andrea Fontana wrote:


You should publish some code to check...
Too much code to public - operations are simple, but there are 
many branches and reducing may take much time . In fact I asked 
to understand _in general_ if it worth diving into code to find 
the source of the difference or take it easy and go on...
If D and C++ use the same things to process float types then it 
worth to dive, but if there is some issues, then it doesn't.


Yes the float types are the same. floats doubles are identical 
long double == real ( at least for x86)


The only difference is that float are default initialised to NaN 
in D.

The sources of difference are likely to occur from
- const folding (varying by compiler e.g. gcc uses libgmp for 
high precision floating point for constant folding where as other 
compliers may not)

- type promotions and truncations
I.e.
double a = ... ,b = ... ;
float c = a+b;
float d = cast(float)a + cast(float)b;

c is unlikely to be bit for bit equal to d.

floating point operations are NOT commutative nor are they 
distributive. Order of operations does matter.
i.e. a+(b+c) !=(a+b) +c and a*(b+c) != a*b + a*c (!= means not 
necessarily equal)


you should always compare floats for equality with an epsilon 
(unless 0.0 +-inf )




Re: Why `i` not working on foreach loop if it have byLine option

2015-12-17 Thread cym13 via Digitalmars-d-learn

On Thursday, 17 December 2015 at 14:09:57 UTC, Suliman wrote:

Next code produce error:

 foreach(i, line;fileContent.byLine)

Error: cannot infer argument types, expected 1 argument, not 2

Why it's do not work?


Because byLine doesn't return an array, use std.range.enumerate : 
http://dlang.org/phobos/std_range#.enumerate


Re: Voting For std.experimental.ndslice

2015-12-17 Thread Robert burner Schadek via Digitalmars-d
On Wednesday, 16 December 2015 at 17:49:03 UTC, Ilya Yaroshenko 
wrote:
In the same time I expect few articles from another engineers 
about ndslice like this http://dlang.org/intro-to-datetime.html 
. It is much better to have explanation from different 
engineers.




Please no, put all the doc at one place.

Actually, that article was written by the author of the library. 
People are lazy, if the doc is not in the phobos docs they will 
not search for it. Make it very hard for people to complain.




Re: D float types operations vs C++ ones

2015-12-17 Thread drug via Digitalmars-d-learn

On 17.12.2015 16:09, Nicholas Wilson wrote:


Yes the float types are the same. floats doubles are identical long
double == real ( at least for x86)

The only difference is that float are default initialised to NaN in D.
The sources of difference are likely to occur from
- const folding (varying by compiler e.g. gcc uses libgmp for high
precision floating point for constant folding where as other compliers
may not)
- type promotions and truncations
I.e.
double a = ... ,b = ... ;
float c = a+b;
float d = cast(float)a + cast(float)b;

c is unlikely to be bit for bit equal to d.

floating point operations are NOT commutative nor are they distributive.
Order of operations does matter.
i.e. a+(b+c) !=(a+b) +c and a*(b+c) != a*b + a*c (!= means not
necessarily equal)

you should always compare floats for equality with an epsilon (unless
0.0 +-inf )

Thanks for answer. My C++ version is tracing D version so commutativity 
and distributivity aren't requred because order of operations is the 
same (I guess so at least), so I hoped for bit to bit equality (it 
simplifies comparing serialized data). But I found that error between D 
and C++ versions grows if more data processed so I should investigate it 
anyway.


Re: Some feedback on the website.

2015-12-17 Thread John Colvin via Digitalmars-d
On Thursday, 17 December 2015 at 11:47:23 UTC, Walter Bright 
wrote:

On 12/16/2015 11:12 AM, H. S. Teoh via Digitalmars-d wrote:
Having said that, though, using ddoc for the website leads to 
other
problems (e.g., the ongoing fiasco with XREF, LREF, 
whatever-REF and the
associated relative/absolute URL nightmare that a proper web 
authoring

system would have taken care of by default).


Annoying, and maybe you have to spend a couple minutes picking 
the right one if you've forgotten for the moment => absolute 
nightmare? Come on.


How does a user who happens to spot a mistake in the docs and 
wants to help work this out?


Re: D float types operations vs C++ ones

2015-12-17 Thread anonymous via Digitalmars-d-learn

On 17.12.2015 12:50, drug wrote:

I have two implementation of the same algorithm - D and C++ (that is
port of D version). I assume that running these implementations on the
same data should give the same results from both. But with some data the
results differ (5th decimal digit after point). For my purpose it isn't
important and I can ignore this difference. But I'd like to have the
same results totally (I mean bit to bit) to easy maintanence of the
implementations. Question is - can I rely that D and C++ float types
operations should give the same result because D and C are similar or no
and I should use more portable way and compare floats with some epsilon?


D explicitly allows compilers to use greater precision in calculations 
than the involved types have [1]. For example, an expression involving 
`float`s may be evaluated at double or real precision.


That means, you cannot rely on getting the same results even when 
looking only at D. Compiler A may produce higher precision code than 
compiler B; or machine X offers a larger maximum precision than machine 
Y (and the compiler makes use of it).



[1] http://dlang.org/spec/float.html


Re: Error 42: Symbol Undefined __lseeki64

2015-12-17 Thread Basile B. via Digitalmars-d-learn

On Thursday, 17 December 2015 at 04:11:56 UTC, tcak wrote:
On Wednesday, 16 December 2015 at 18:30:41 UTC, Byron Heads 
wrote:
On Wednesday, 16 December 2015 at 18:21:33 UTC, Byron Heads 
wrote:

On Wednesday, 16 December 2015 at 18:14:35 UTC, Byron Heads
I searched the function "__lseek64" under /usr/include/dmd" 
with "grep -R __lseek64", but nothing is found. I work on Linux 
64-bit. So, I guess it is either Windows related, or 32bit dmd 
related. "lseek64" is found in "unistd.d", but this doesn't 
solve any problem.


Of course it's windows related. 'lseek' is a posix function. 
There's a version/#define somewhere that's missing, maybe in the 
C binding, because under Windows lseek is 'SetFilePointer'.


But I'm not able to find it...
:/


Re: Why `i` not working on foreach loop if it have byLine option

2015-12-17 Thread Daniel Kozak via Digitalmars-d-learn
V Thu, 17 Dec 2015 14:09:57 +
Suliman via Digitalmars-d-learn 
napsáno:

> Next code produce error:
> 
>   foreach(i, line;fileContent.byLine)
> 
> Error: cannot infer argument types, expected 1 argument, not 2
> 
> Why it's do not work?

http://dlang.org/phobos/std_range.html#enumerate



Re: DlangUI

2015-12-17 Thread John Colvin via Digitalmars-d-announce
On Thursday, 17 December 2015 at 16:12:32 UTC, Vadim Lopatin 
wrote:

On Wednesday, 16 December 2015 at 13:32:21 UTC, Suliman wrote:
Is it's possible to use some native frontend with dlangui 
instead of drawing all controls with OpenGL? I really dislike 
how all OpenGL toolkit looks like.


OpenGL is just hardware acceleration for drawing. Resulting 
picture is the same for both OpenGL and software rendering.


DlangUI will never use native controls. It draws all widgets 
itself.

But look and feel can be changed by providing custom theme.
You can create theme (set of .xml and .png files) to get 
DlangUI app looking exactly like native one.


In general I don't care about that sort of thing, but there is 
one exception: the main application menu. Unity and Aqua (OS X) 
both end up feeling odd if you don't use the system one.


Re: D float types operations vs C++ ones

2015-12-17 Thread Ali Çehreli via Digitalmars-d-learn

On 12/17/2015 03:50 AM, drug wrote:

> D and C++ [...] But with some data the results differ

You may have similar results between two C and two C++ compilers, even 
between two different versions of the same compiler.


In addition to possible reasons that has already been mentioned, note 
that function arguments can be evaluated in any order by compilers of C 
and C++ (D uses left-to-right). For example, for the following 
expression, gcc evaluates bar() first but dmd (and other D compilers) 
evaluate foo() first:


h(foo(), bar())

If foo() and bar() have side effects on floating values, those values 
can be observed differently.


Ali



Re: Some feedback on the website.

2015-12-17 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 17 December 2015 at 08:06:28 UTC, Jacob Carlborg 
wrote:
We obviously need a proper programming language to generate 
dconf.org.


I can't agree with this. I think there's too many conditionals 
already. Build the docs on posix and you miss out on Windows 
functions. Ugh.


Re: Some feedback on the website.

2015-12-17 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 17 December 2015 at 07:53:02 UTC, Jacob Carlborg 
wrote:
No sane person would use raw HTML. I hope no one takes that 
suggestion serious.


HTML + a couple simple helper tools is a different story though. 
That's basically what ddoc is anyway, but it has the weird 
behavior of just thinly wrapping html in macros $(DIVID $(B 
$(LINK2 seriously wtf))


In IRC I mentioned XSLT as a bit of a joke, but it solves the 
problem of reusing skeleton layouts too.


There's LOTS of ways to do this, and the language in which the 
doc pages are written is different than the framework which 
brings them all together and does other post processing.


Re: DlangUI

2015-12-17 Thread Vadim Lopatin via Digitalmars-d-announce

On Wednesday, 16 December 2015 at 16:17:00 UTC, karabuta wrote:

On Tuesday, 14 April 2015 at 11:18:38 UTC, Vadim Lopatin wrote:

Maybe tutorial on Menus, tabs, list view, and a little excell 
app


I started to work on Spreadsheet (Excel like app) example
dub run dlangui:spreadsheet
(dlangui/examples/spreadsheet)

Its implementation is in the very beginning. Worksheet split view 
support development is in progress.







[Issue 15229] BigInt(Range of chars) too

2015-12-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15229

--- Comment #2 from Jack Stouffer  ---
https://github.com/D-Programming-Language/phobos/pull/3876

--


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread qznc via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


I don't think listening to random forum opinions (Inconsolata!!1) 
is a good process. What is the intention we want to convey with 
the font choice?


a) Just use whatever is default, we dont care. 
(font-family:monospace;)


b) Use what the viewer is familiar with. That depends on the OS 
and other factors. Consolas for Windows users? A quick google 
tour did not turn up any popularity statistics for "programmer 
fonts".


c) Something beautiful. We are special. We care for every detail. 
We have a brand. Increased loading time for the website is the 
price to pay. It should also look the same on most systems.


d) Any other relatively objective process?


Re: Why should file names intended for executables be valid identifiers?

2015-12-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 17 December 2015 at 04:26:04 UTC, Shriramana Sharma 
wrote:
Sorry but I don't get this fully: can't a hyphen be part of 
such mangled names?


I'm actually not sure but I have never seen it done.

And any reflection of the module name would also be just a 
string which need not be a valid identifier no?


Reflection would be a string, but it is often mixed in and the 
other uses like name disambiguation is still identifier.


Re: Testing if a file is connected to a terminal

2015-12-17 Thread Adam D. Ruppe via Digitalmars-d-learn

On Thursday, 17 December 2015 at 05:01:15 UTC, Jakob Ovrum wrote:

Where's the reference documentation?


In the source...

but yeah, good point. I'm working on writing docs for a lot of my 
stuff. Terminal is still completely messed up


http://arsdnet.net/arsd/terminal.html

cgi is meh but there: http://arsdnet.net/arsd/cgi.html

simpledisplay is the one I've spent the most time on so far: 
http://arsdnet.net/arsd/simpledisplay.html



I'm pretty happy with how terminal.d works, but indeed the docs 
are still awful.


Re: DlangUI

2015-12-17 Thread Vadim Lopatin via Digitalmars-d-announce

On Wednesday, 16 December 2015 at 13:32:21 UTC, Suliman wrote:
Is it's possible to use some native frontend with dlangui 
instead of drawing all controls with OpenGL? I really dislike 
how all OpenGL toolkit looks like.


OpenGL is just hardware acceleration for drawing. Resulting 
picture is the same for both OpenGL and software rendering.


DlangUI will never use native controls. It draws all widgets 
itself.

But look and feel can be changed by providing custom theme.
You can create theme (set of .xml and .png files) to get DlangUI 
app looking exactly like native one.


Is it's possible to make dlangui fully compatibility with QML 
to be able easy migrate visual components from Qt solution to 
dlangui?


No. It's not planned at least for now.



Re: No documentation for core.sys?

2015-12-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 17 December 2015 at 03:40:02 UTC, Shriramana Sharma 
wrote:
Why isn't there a documentation page 
http://dlang.org/phobos/core_sys.html whereas lots of other 
core.* modules are documented?


Because the D build process is f***ed up and the website build 
process is yet another layer of crap on top of it.


I'm sorry to be so harsh, but that's the simple truth of the 
matter. I recently added a new binding module in there and it 
took me, plus the reviewers, like four iterations just to get it 
included in the druntime build correctly (and it is just 
bindings! it doesn't even do anything) and the website build 
duplicates those lists AGAIN.



BTW, I run a D documentation search engine that digs deeper than 
the main page:


http://dpldocs.info/isatty

Stick a function name in there and see what it gives you. For 
isatty, it gives:


core.sys.posix.unistd.isatty
D code»D Builtins»core.sys.posix.unistd


telling you that it is there, though no extra docs are written. 
Then you can try finding it on the real site or just importing it.


It is useful to find the module for functions as tehy move too:

http://dpldocs.info/walkLength

walkLength [4]D code»D Builtins»std.range.primitives

This is a best-effort implementation of $(D length) for any kind 
of range.




Not perfect, but helps to find things. It also has indexed my 
modules:


http://dpldocs.info/simpledisplay.SimpleWindow



The docs aren't really readable there but the indexing helps find 
where to look.


Re: No documentation for core.sys?

2015-12-17 Thread Steven Schveighoffer via Digitalmars-d-learn

On 12/17/15 2:30 AM, Jacob Carlborg wrote:

On 2015-12-17 04:47, Jakob Ovrum wrote:


core.sys contains packages with system-specific D interface files (ports
of header files). As with core.stdc, refer to the documentation for the
equivalent C header.


core.stdc is documented, in the sense that empty doc comments have been
added to all symbols to make them show up in the docs [1]. I think the
same should be done for core.sys as well. Then at least you know it
exists and then can look up the documentation for the C header file for
more information.

[1] I think it was Steven Schveighoffer that did that enormous work.



s/enormous/tedious

As far as sys, the mapping to c headers may not be as straightforward as 
core.stdc. I agree that we should tag those for documenting, but it may 
not be as easy to refer to the c documentation.


-Steve


Re: error diagnosis: range.algorithm(myFunc)

2015-12-17 Thread Luís Marques via Digitalmars-d

On Thursday, 17 December 2015 at 11:41:09 UTC, John Colvin wrote:

Seems feasible to me for the compiler:

If the call doesn't compile, try moving the first argument (or 
second on a ufcs call) to be the first template argument. If 
that would compile, suggest it to the user in the error output.


That's more or less the first implementation that came to my 
mind, too.


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Wyatt via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


I've recently become partial to Fira Mono.
https://typecast.com/preview/google/fira%20mono:400:normal
It has nice open counters, tall braces that don't overextend, and 
relatively weighty punctuation.



http://typecast.com/blog/10-fonts-for-code
There are a few others that may be worth considering here.  I 
don't like the condensed fonts so much because I prefer "O" not 
be as narrow as "0".  For zeros, dot > slash ≫ open. (I used a 
dotted version of Droid Sans Mono for a long time.)


-Wyatt



Re: Silicon Valley D Meetup December 17, 2015

2015-12-17 Thread Ali Çehreli via Digitalmars-d-announce

On 12/12/2015 05:03 PM, Ali Çehreli wrote:

Our guest speaker is Steven Schveighoffer. He will present "Mutability
wildcards in D":

   http://www.meetup.com/D-Lang-Silicon-Valley/events/226112281/

Ali


We still have a few spots available. See you there! :)

Ali



Re: Graillon 1.0, VST effect fully made with D

2015-12-17 Thread Thomas via Digitalmars-d-announce
On Thursday, 26 November 2015 at 15:48:48 UTC, Guillaume Piolat 
wrote:
OT: Readers of this NG probably know me under the name "ponce", 
however over the year I was made aware that it's an english 
swear word so I'll post under my IRL name from now on.


[...]


Hi, Is there a tutorial on how to design VST's using D? I would 
like to get into vst programming using D but I've found little 
useful information.


Thanks


Re: Trying to build dlang.org - what am I doing wrong

2015-12-17 Thread Jimmy Cao via Digitalmars-d

On Thursday, 17 December 2015 at 08:48:21 UTC, wobbles wrote:
So - the conversation about the website/documentation piqued my 
interest a bit and I decided to have a go at making the 
documentation more readable.


However, reading the instructions from:
http://wiki.dlang.org/Starting_as_a_Contributor#Fetch_and_build_dlang.org

It should be a simple matter of:
```bash
mkdir -p ~/code; cd ~/code
git clone https://github.com/D-Programming-Language/dlang.org
cd dlang.org
make -f posix.mak LATEST=2069.2
```

However, I get a std.net.curl error during compilation of dub 
(luckily dlang.org doesn't depend on dub, so it doesn't 
particularly matter and I can carry on with my tinkering).


http://pastebin.com/q41AnJyr

I assume theres a problem with the makefiles here - or is it 
stupid user syndrome?


Do you have libcurl installed?  I think it's required to build 
dub.


Re: TreeViews in tkd

2015-12-17 Thread TheGag96 via Digitalmars-d-learn
On Thursday, 17 December 2015 at 11:33:31 UTC, Gary Willoughby 
wrote:

On Thursday, 17 December 2015 at 09:47:42 UTC, TheGag96 wrote:
I've been trying to get into tkd to make some GUI apps, since 
it looked like the simplest/intuitive library out there so 
far. I've been attempting to use their TreeViews to make 
interactable lists of things, but it almost looks like there's 
some missing functionality.


I made an issue on GitHub but I'm not sure I'll get anything 
back, it's been 9 months since the last commit.


Has anyone worked with this before and could give me some 
tips? Thanks!


Calm down, lol. There have been no commits for 9 months because 
as far as i'm aware it's finished and stable. I got your issue 
this morning and will take a look tonight after work.


Ah thanks, sorry for my impatience. I guess it's good the D 
community is so tight-knit that everyone lurks these forums, haha.


Re: DlangUI

2015-12-17 Thread Vadim Lopatin via Digitalmars-d-announce

On Thursday, 17 December 2015 at 16:21:58 UTC, John Colvin wrote:
DlangUI will never use native controls. It draws all widgets 
itself.

But look and feel can be changed by providing custom theme.
You can create theme (set of .xml and .png files) to get 
DlangUI app looking exactly like native one.


In general I don't care about that sort of thing, but there is 
one exception: the main application menu. Unity and Aqua (OS X) 
both end up feeling odd if you don't use the system one.


Completely agree.
Once Cocoa backend is ready I'm going to implement native OSX 
menus.




Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread tcak via Digitalmars-d

On Thursday, 17 December 2015 at 16:01:01 UTC, Wyatt wrote:
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


I've recently become partial to Fira Mono.
https://typecast.com/preview/google/fira%20mono:400:normal
It has nice open counters, tall braces that don't overextend, 
and relatively weighty punctuation.



http://typecast.com/blog/10-fonts-for-code
There are a few others that may be worth considering here.  I 
don't like the condensed fonts so much because I prefer "O" not 
be as narrow as "0".  For zeros, dot > slash ≫ open. (I used a 
dotted version of Droid Sans Mono for a long time.)


-Wyatt


Fira Mono looked ugly to me. I use Input Mono for a while (Input 
Sans and

Input Serif are available as well).

http://input.fontbureau.com/preview/?size=16=clike=solarized-dark=InputMono=300=400=1.2=0=ss=0=0=0=0=0=default=please

Not very smooth like Consolas etc, but it is very readable.


What is the state of D for game development?

2015-12-17 Thread Ali Çehreli via Digitalmars-d

I am stealing HerrDrFaust's question from the following Reddit thread:


https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/

Please answer here or there.

Thank you,
Ali


Re: Some feedback on the website.

2015-12-17 Thread BLM768 via Digitalmars-d
On Thursday, 17 December 2015 at 07:51:42 UTC, Jacob Carlborg 
wrote:

On 2015-12-17 00:43, BLM768 wrote:

One is to make as much of it as possible in plain old
static HTML. Stuff like the articles rarely changes, after all.


This is an horrible idea. No sane person would use raw HTML. 
The only advantage is that it's HTML so there's documentation 
available.


Yeah. I didn't think that one through.

The idea I had in my head was to build a template in (mostly) raw 
HTML, write each article as an HTML snippet, and use either a 
framework or a build script to paste them together, so it's not 
_completely_ raw, just enough so you actually see the HTML. The 
main thing was to move away from building all the tags with 
macros.


But yeah, I didn't express that clearly enough (or think through 
it properly).


Re: How to replace inside regex?

2015-12-17 Thread Ali Çehreli via Digitalmars-d-learn

On 12/17/2015 04:57 AM, Suliman wrote:

> find all commas in strings inside quotes and replace them.
>
> foo, bar, "hello, user", baz
[...]
> auto partWithComma = matchAll(line, r).replaceAll(",", " ");

For this particular case, do you really want to replace with spaces, or 
do you want to eliminate them?


1) If the latter, I am sure you already know that you can call filter on 
the whole string:


import std.algorithm;

void main() {
auto s = `foo, bar, "hello, user", baz`;
auto result = s.filter!(c => c != '"');
assert(result.equal(`foo, bar, hello, user, baz`));
}

Note that 'result' above is a range that is produced lazily. If you need 
the result to be a proper array, then append a .array at the end (but 
don't forget to import std.array or std.range in that case):


import std.array;
auto result = s.filter!(c => c != '"').array;

Now 'result' in an array.


2) Also consider std.array.replace:

  http://dlang.org/phobos/std_array.html#.replace


3) For your general question about regular expressions, there may be 
other solutions but the following style works for me:


import std.stdio;
import std.string;
import std.regex;
import std.array;

void main() {

auto data = [ "abc=1", "def=2", "xyz=3" ];

/* Matches patterns like a=1
 *
 * Note the parentheses around the two patterns. Those parentheses 
allow

 * us to refer to the matched parts with indexes 1, 2, etc. later.
 */
enum re = regex(`([a-z]*)=([0-9]*)`);

foreach (line; data) {
if (matchFirst(line, re)) {
/* This line matched. */

/* Instead of such a "sink" delegate, you can use 
std.appender to

 * collect the replaced lines. This one makes use of the
 * replacement right away by sending it to standard output.
 */
auto useTheLine = (const(char)[] replaced) {
if (replaced.empty) {
/* QUESTION TO OTHERS: Why is this function called with
 * empty strings twice, apparently before and after 
each

 * actual replacement? Is that intentional? */

} else {
// This is where we actually use the replacement
writeln(replaced);
}
};

replaceAllInto!makeReplacement(useTheLine, line, re);
}
}
}

string makeReplacement(Captures!(string) matched) {
// Note: matched[0] would be the whole matched line
const label = matched[1];
const value = matched[2];

// We produce the new string here:
return format("((%s)) ((%s))", label, value);
}

Ali



Re: What is the state of D for game development?

2015-12-17 Thread BLM768 via Digitalmars-d

On Thursday, 17 December 2015 at 17:38:31 UTC, Ali Çehreli wrote:
I am stealing HerrDrFaust's question from the following Reddit 
thread:



https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/

Please answer here or there.

Thank you,
Ali


Well, we have some bindings to game dev libraries, but the 
ecosystem isn't nearly as rich as what's available with C++. 
Derelict has bindings to almost all the "basic" libraries, 
though. I've been working on a binding to Bullet Physics, but 
it's stalled while I wait on a DMD pull request that I put in to 
allow the kind of introspection my method requires.


Re: Some feedback on the website.

2015-12-17 Thread Walter Bright via Digitalmars-d

On 12/17/2015 5:44 AM, John Colvin wrote:

On Thursday, 17 December 2015 at 11:47:23 UTC, Walter Bright wrote:

On 12/16/2015 11:12 AM, H. S. Teoh via Digitalmars-d wrote:

Having said that, though, using ddoc for the website leads to other
problems (e.g., the ongoing fiasco with XREF, LREF, whatever-REF and the
associated relative/absolute URL nightmare that a proper web authoring
system would have taken care of by default).


Annoying, and maybe you have to spend a couple minutes picking the right one
if you've forgotten for the moment => absolute nightmare? Come on.


How does a user who happens to spot a mistake in the docs and wants to help work
this out?


1. he can file a bugzilla issue

2. he can click on the "Improve this page"

3. to find out what LREF does:

grep LREF *.ddoc

If what a trivial text macro does is beyond his ken, and/or using grep, I wonder 
if he should be improving programming documentation at all. I do expect this to 
be part of the baseline knowledge a programmer should have. I wouldn't expect an 
accountant to know this stuff.


Re: Some feedback on the website.

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/17/15 2:43 PM, Adam D. Ruppe wrote:

On Thursday, 17 December 2015 at 19:27:56 UTC, Walter Bright wrote:

3. to find out what LREF does:

grep LREF *.ddoc


So, you're working on Phobos and see a LREF macro.

me@arsd:~/d/dmd2/src/phobos$ grep -R LREF *.ddoc
me@arsd:~/d/dmd2/src/phobos$

where is it?

I happen to know it is hidden in the dlang.org repo, but would someone
who saw a problem in the Phobos docs know that? They seem to be
generated from the source code except when they aren't.

You can't assume everybody knows all the institutional knowledge you do!


A document discussing this kind of stuff would be golden. Maybe a good 
topic for next week's TWiD? -- Andrei




Re: Some feedback on the website.

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/16/15 6:47 PM, BLM768 wrote:

On Wednesday, 16 December 2015 at 23:43:41 UTC, BLM768 wrote:

[snip]


...and as I read some older posts, I see that mine is completely
redundant. ;)

Seriously, though, I'm willing to help prototype something. I've got
time before the next semester starts.


If you have some time and motivation to improve the documentation, 
there's tremendous opportunity for impact. So much low-hanging fruit, 
all well before we explore switching to a different way of building the 
site. And whatever improvements you make won't compete with future 
changes. There's so much opportunity there it hurts. -- Andrei





Re: Some feedback on the website.

2015-12-17 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 17 December 2015 at 19:51:19 UTC, Walter Bright 
wrote:
That has nothing to do with Ddoc, and is more about the 
organization of the files on github. Switching to another 
framework does nothing for that.


Well, I basically agree with that.

I know it is hard to keep track of whose position is what in a 
thread like this, but my problem isn't with ddoc per se, it is 
more that the current process is very complicated and pretty 
opaque.


I have more hatred toward the makefiles than toward the doc 
format.


BTW, when I was working on Phobos docs, Phobos had its own 
std.ddoc in the Phobos repo.


std.ddoc was destroyed ages ago, the file no longer exists!


Re: D could catch this wave: web assembly

2015-12-17 Thread yawniek via Digitalmars-d

https://hacks.mozilla.org/2015/12/compiling-to-webassembly-its-happening/


Re: Some feedback on the website.

2015-12-17 Thread Walter Bright via Digitalmars-d

On 12/16/2015 10:47 AM, deadalnix wrote:

Honestly for D code itself, ddoc does just fine, but for the website, plain html
or some known template format like . This is what people know.



I've never heard of .


Re: Some feedback on the website.

2015-12-17 Thread Walter Bright via Digitalmars-d

On 12/17/2015 4:27 AM, John Colvin wrote:

The number of macros bothers me, but mostly it's the complete lack of
documentation and guidelines on where/how to use them*.
It's pretty unreasonable to expect someone submitting a passing doc fix to
1) find where the macros are defined
2) decipher them
3) use the "right" one**
It's just too much unpleasant work for people to bother with.

*If there is documentation and guidelines on this and I don't know about it,
consider what it would be like for someone who doesn't spend many hours a week
on the various subdomains of dlang.org: it might as well not exist!

**there must be some reasons for the existence of all of those macros, so
presumably there are good and bad choices for certain situations, even if
nothing is obviously broken using the bad choice. Sure, we might say "submit
something naïve and then people will help you fix it", but that's still a
barrier to entry; 1) how were they supposed to know we felt that way about
submissions? 2) people don't like looking stupid.


Documentation in the std.ddoc files would certainly help. $(COMMENT this is 
comment) is a convention that works well. PRs to add explanatory comments are 
welcome.


Re: Some feedback on the website.

2015-12-17 Thread Anon via Digitalmars-d

On Thursday, 17 December 2015 at 20:04:44 UTC, jmh530 wrote:

My feedback: add the ability to edit posts in the forum


You can't edit email.


Re: Some feedback on the website.

2015-12-17 Thread Walter Bright via Digitalmars-d

On 12/17/2015 11:43 AM, Adam D. Ruppe wrote:

On Thursday, 17 December 2015 at 19:27:56 UTC, Walter Bright wrote:

3. to find out what LREF does:

grep LREF *.ddoc


So, you're working on Phobos and see a LREF macro.

me@arsd:~/d/dmd2/src/phobos$ grep -R LREF *.ddoc
me@arsd:~/d/dmd2/src/phobos$

where is it?

I happen to know it is hidden in the dlang.org repo, but would someone who saw a
problem in the Phobos docs know that? They seem to be generated from the source
code except when they aren't.


That has nothing to do with Ddoc, and is more about the organization of the 
files on github. Switching to another framework does nothing for that.


BTW, when I was working on Phobos docs, Phobos had its own std.ddoc in the 
Phobos repo.



You can't assume everybody knows all the institutional knowledge you do!


1. digitalmars.D.learn
2. Linux: locate std.ddoc



Re: D float types operations vs C++ ones

2015-12-17 Thread Guillaume Piolat via Digitalmars-d-learn

On Thursday, 17 December 2015 at 11:50:02 UTC, drug wrote:
I have two implementation of the same algorithm - D and C++ 
(that is port of D version). I assume that running these 
implementations on the same data should give the same results 
from both. But with some data the results differ (5th decimal 
digit after point). For my purpose it isn't important and I can 
ignore this difference. But I'd like to have the same results 
totally (I mean bit to bit) to easy maintanence of the 
implementations. Question is - can I rely that D and C++ float 
types operations should give the same result because D and C 
are similar or no and I should use more portable way and 
compare floats with some epsilon?


If you aim for float reproducibility, you will get trouble in 
32-bit vs 64-bit mode, depending on whether the FPU is used or 
not. The FPU promotes to 80-bits code that uses float or double, 
and may get you more precision thus changing the results.


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread TheGag96 via Digitalmars-d

On Thursday, 17 December 2015 at 15:43:22 UTC, qznc wrote:
I don't think listening to random forum opinions 
(Inconsolata!!1) is a good process.


...And I was about to say Source Code Pro and Inconsolata are my 
favorite fonts to use. >_> I think they fit the "nice" quality 
Andrei is looking for.


Re: Why should file names intended for executables be valid identifiers?

2015-12-17 Thread Alex Parrill via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 03:31:18 UTC, Shriramana Sharma 
wrote:
I expect it should not be difficult for the compiler to see 
that this D file is not a module being imported by anything 
else or even being compiled to a library which would need to be 
later imported. In which case, why does it insist that the file 
should be given a valid module name?


All files in D are modules. The only thing special about the 
"main" module is that it exports a function called `main`, which 
druntime calls at startup.


It's like asking why you need to have a class in Java that only 
contains `public static void main(...)`, instead of just having 
the main function itself; it's simply how D is designed, and it 
reduces the number of special cases.


Though after compiling, module names are irrelevant; you can name 
the binary whatever you want: `dmd -o whatever-filename.exe 
my_module.d`


Name mangling is irrelevant; you can't have a dash in the module 
name because it would make certain code ambiguous (ex. 
`foo.my-module.bar`: is one module field reference or a 
subtraction between two field references?)


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/17/15 10:43 AM, qznc wrote:

On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei Alexandrescu wrote:

I was looking at
https://github.com/D-Programming-Language/dlang.org/pull/1169 and that
bold sans serif proportional text for the code is just... well let's
say it's time to replace it.

What would be a good code font to use for those?


I don't think listening to random forum opinions (Inconsolata!!1) is a
good process.


Then I guess I should stop reading here :o).


What is the intention we want to convey with the font choice?

a) Just use whatever is default, we dont care. (font-family:monospace;)

b) Use what the viewer is familiar with. That depends on the OS and
other factors. Consolas for Windows users? A quick google tour did not
turn up any popularity statistics for "programmer fonts".

c) Something beautiful. We are special. We care for every detail. We
have a brand. Increased loading time for the website is the price to
pay. It should also look the same on most systems.

d) Any other relatively objective process?


The task is intentionally loosely defined. "Make a different nice font 
choice for the function signatures." There shouldn't be a need to 
micromanage that.



Andrei



D Cannot Be Used for Real Time / Low Latency Systems? - Of course it can!

2015-12-17 Thread Jakob Jenkov via Digitalmars-d

Hi guys,

I read from some of the other forum threads that D is being 
criticized for not being usable for real time / low latency 
systems because it has a GC.


First of all, such system are already being written in Java. 
Google "Martin Thompson" and LMAX and you will see. Or Aeron 
(also Java and Martin Thompson).


Second, when Java has been used to develop such systems, the GC 
has been avoided as much as possible - which is even easier to do 
with D than Java.


So, it's a load of BS that D's GC should somehow make it 
impossible to make real time / low latency software.


[Issue 15456] sc.ini: Access denied for non-superusers on Windows 10

2015-12-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15456

--- Comment #3 from Brad Anderson  ---
(In reply to David Eckardt from comment #2)
> This happened with the dmd-2.069.2 installer
> 
> http://downloads.dlang.org/releases/2.x/2.069.2/dmd-2.069.2.exe
> 
> on Windows 10 Home, using the default installation options, which install it
> in the C:\D\ directory.

Oh, my apologies. I wasn't using the latest version. Just reproduced the
object.d error but my sc.ini was fine and accessible. My druntime folder was
completely missing... Then I uninstalled and reinstalled several versions going
back to 2.069.0 and all had weird, different files missing.

I think it might be the uninstaller is still recursively deleting things even
as the installer is busy installing the new version... Very unexpected bug. I'm
looking into it more.

--


[Issue 15456] sc.ini: Access denied for non-superusers on Windows 10

2015-12-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15456

--- Comment #4 from Brad Anderson  ---
Added Rainer and Martin on the CC. Assuming it's the same bug you hit, it seems
you can reproduce by going through the uninstaller and installer as quickly as
possible. The uninstaller "finishes" almost instantly once it gets to the RMDir
/r part which makes me think it's doing the deletions asynchronously and the
new files being added by the installer are subject to the delete. Very ugly
bug.

One quick fix might be to rename the C:\D folder prior to deleting it. I'm
unfortunately too busy at the moment to try to fix this myself but might be
able to look in a couple weeks.

--


Re: Why should file names intended for executables be valid identifiers?

2015-12-17 Thread Ali Çehreli via Digitalmars-d-learn

On 12/16/2015 08:26 PM, Shriramana Sharma wrote:

> can't a hyphen be part of such mangled names?

Perhaps my response is naive but hyphen means subtraction (or minus). If 
the grammar is context-free then it cannot appear in a name, no?


Ali



Re: Some feedback on the website.

2015-12-17 Thread deadalnix via Digitalmars-d
On Thursday, 17 December 2015 at 22:28:25 UTC, Andrei 
Alexandrescu wrote:

On 12/17/15 4:17 PM, deadalnix wrote:
But, to start, let's take action. Andrei, does dlang.org has 
any kind of

analytic setup ?


We use webalizer. -- Andrei


I would suggest using something more powerful. Log analysis is 
one thing, but modern tools can do more.


If you are not comfortable with sending data to google, I suggest 
using piwik : https://piwik.org/ . Some more setup, but you are 
100% in control of the data.




Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Eric Scrivner via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


Thanks,

Andrei


In the interest of "Show Don't Tell", here's what the homepage 
looks like using the following font string:


font-family: Consolas, "Liberation Mono", Courier, monospace

http://imgur.com/DIymzqO


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Fer22f via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


Thanks,

Andrei


I personally use Fantasque Sans Mono, it's FOSS 
(https://github.com/belluzj/fantasque-sans). It has good support 
for lIi1 and others. But that is just an opinion, I just find it 
beautiful.


[Issue 15456] sc.ini: Access denied for non-superusers on Windows 10

2015-12-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15456

Brad Anderson  changed:

   What|Removed |Added

 CC||c...@dawg.eu,
   ||r.sagita...@gmx.de

--


Re: Some feedback on the website.

2015-12-17 Thread deadalnix via Digitalmars-d
On Thursday, 17 December 2015 at 19:50:40 UTC, Andrei 
Alexandrescu wrote:

On 12/16/15 6:47 PM, BLM768 wrote:

On Wednesday, 16 December 2015 at 23:43:41 UTC, BLM768 wrote:

[snip]


...and as I read some older posts, I see that mine is 
completely

redundant. ;)

Seriously, though, I'm willing to help prototype something. 
I've got

time before the next semester starts.


If you have some time and motivation to improve the 
documentation, there's tremendous opportunity for impact. So 
much low-hanging fruit, all well before we explore switching to 
a different way of building the site. And whatever improvements 
you make won't compete with future changes. There's so much 
opportunity there it hurts. -- Andrei


Yes, I'm kind of disappointed I brought up ddoc in there, because 
everything has been ignored now, while in there, there are many 
thing more important than using ddoc or not.


And I'd say there is also way more impact changes to do than 
cleaning the doc as you mention. Searching the doc is late in the 
tunnel. Clearing the home page has much higher impact options.


But, to start, let's take action. Andrei, does dlang.org has any 
kind of analytic setup ? If not, would you mind setting up 
something as google analytic ? That should give us data on what 
changes are impactful.




Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread karabuta via Digitalmars-d
On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei 
Alexandrescu wrote:
I was looking at 
https://github.com/D-Programming-Language/dlang.org/pull/1169 
and that bold sans serif proportional text for the code is 
just... well let's say it's time to replace it.


What would be a good code font to use for those?


Thanks,

Andrei



Consolas is pretty solid IMO. It is not only good for code but 
readable even from a long distance with it's round nature. In 
fact my CLI, Atom and every IDE I use have font face set to 
Consolas. Pretty neat.


Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/17/15 4:30 PM, Eric Scrivner wrote:

On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei Alexandrescu wrote:

I was looking at
https://github.com/D-Programming-Language/dlang.org/pull/1169 and that
bold sans serif proportional text for the code is just... well let's
say it's time to replace it.

What would be a good code font to use for those?


Thanks,

Andrei


In the interest of "Show Don't Tell", here's what the homepage looks
like using the following font string:

font-family: Consolas, "Liberation Mono", Courier, monospace

http://imgur.com/DIymzqO


Looks good. What would the phobos function signatures look like? -- Andrei


Re: Some feedback on the website.

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/17/15 4:17 PM, deadalnix wrote:

But, to start, let's take action. Andrei, does dlang.org has any kind of
analytic setup ?


We use webalizer. -- Andrei



Re: What is the state of D for game development?

2015-12-17 Thread BLM768 via Digitalmars-d

On Friday, 18 December 2015 at 00:03:06 UTC, extrawurst wrote:

What PR is that ? Link ?

--Stephan


https://github.com/D-Programming-Language/dmd/pull/5290

It adds some __traits that would make it easier for me to 
introspect my binding modules and generate glue code. Right now, 
I'm using several stages of build tools which loop over the 
actual source files to generate the necessary code, which has 
gotten quite ugly. With the right __traits, it's possible to cut 
out some steps. Once I've refactored everything, it might 
actually be a viable method to bind all sorts of C++ libraries.


Re: Some feedback on the website.

2015-12-17 Thread Jacob Carlborg via Digitalmars-d

On 2015-12-17 12:45, Walter Bright wrote:


You're not one of the people I was referring to, since you do help.


So do it for those who do help and not for those how don't ;)


Your issue with Ddoc is that the latex pdf generator you used was
broken? Latex meets your critera as being very widely used. Use another
pdf generator. Nobody has chained you to Latex.


I could care less about generating a PDF. But apparently someone cared 
and added it to the process of building dlang.org. So if you're willing 
to remove that or replace Latex with something else, please go ahead.



Jacob, I've adapted several books for Ddoc on their way to being Kindle
ebooks. Ddoc works fine for the formatting. The WORK is simply not the
formatting, it's the text creation/editting. If you're spending the bulk
of your time fiddling with Ddoc rather than text creation, I suspect
you've gone off the rails somewhere.


Well, see for yourself [1]. None of the comments are related to the 
content. The content is the easy part.


[1] https://github.com/D-Programming-Language/dlang.org/pull/1039

--
/Jacob Carlborg


[Issue 15433] std.experimental.allocator.building_blocks.free_tree only compiles with -unittest

2015-12-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15433

yazan.dab...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from yazan.dab...@gmail.com ---
Fixed in https://github.com/D-Programming-Language/phobos/pull/3869

--


[Issue 15434] [REG2.068] object.d imports from rt (breaking inline builds)

2015-12-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15434

--- Comment #2 from yazan.dab...@gmail.com ---
Pull request:
https://github.com/D-Programming-Language/druntime/pull/1450

--


Re: D float types operations vs C++ ones

2015-12-17 Thread drug via Digitalmars-d-learn

On 18.12.2015 05:58, Nicholas Wilson wrote:

On Thursday, 17 December 2015 at 13:30:11 UTC, drug wrote:

On 17.12.2015 16:09, Nicholas Wilson wrote:

[...]

Thanks for answer. My C++ version is tracing D version so
commutativity and distributivity aren't requred because order of
operations is the same (I guess so at least), so I hoped for bit to
bit equality (it simplifies comparing serialized data). But I found
that error between D and C++ versions grows if more data processed so
I should investigate it anyway.


What I mean about order of operations is that if you go
  a = b*a+c*c + e;
the compiler is free to rewrite that as
float __tmp0 = a*b;
float __tmp1 = c*c;
and then do either of
float __tmp2 = __tmp0+__tmp1;
a = __tmp2 + e;
OR
float __tmp2 = __tmp0+e;
a = __tmp2+__tmp1;


I see, thanks to all!


Re: Some feedback on the website.

2015-12-17 Thread Jacob Carlborg via Digitalmars-d

On 2015-12-18 00:50, Andrei Alexandrescu wrote:


* Many functions don't have "Parameters:", "Returns:", or "Throws:"
sections. Those that respectively take parameters, return non-void, or
throw, should have one each.


I think we need to be better at enforcing this in the pull requests. I 
see a lot of this [2] in PR's.



* All functions should have an example.

* "Examples:" is a historical error. All instances should be "Example:".
Just one diff making that change throughout would be a meaningful
contribution.


The documentation for Ddco mentions "Examples:" [1]. Does it have a 
special meaning or is it just a convention?


[1] http://dlang.org/spec/ddoc.html
[2] 
https://github.com/D-Programming-Language/phobos/pull/3855#discussion_r46769338


--
/Jacob Carlborg


Re: Some feedback on the website.

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/17/15 5:32 PM, deadalnix wrote:

On Thursday, 17 December 2015 at 22:28:25 UTC, Andrei Alexandrescu wrote:

On 12/17/15 4:17 PM, deadalnix wrote:

But, to start, let's take action. Andrei, does dlang.org has any kind of
analytic setup ?


We use webalizer. -- Andrei


I would suggest using something more powerful. Log analysis is one
thing, but modern tools can do more.

If you are not comfortable with sending data to google, I suggest using
piwik : https://piwik.org/ . Some more setup, but you are 100% in
control of the data.


I've used piwik, too. I think we're in good shape with analytics. 
Exploring alternative analytics engines would be a distraction. I just 
looked over the analytics and what we need now is good content and 
beautiful css. -- Andrei




Re: Some feedback on the website.

2015-12-17 Thread BLM768 via Digitalmars-d
On Thursday, 17 December 2015 at 19:50:40 UTC, Andrei 
Alexandrescu wrote:
If you have some time and motivation to improve the 
documentation, there's tremendous opportunity for impact. So 
much low-hanging fruit, all well before we explore switching to 
a different way of building the site. And whatever improvements 
you make won't compete with future changes. There's so much 
opportunity there it hurts. -- Andrei


As long as the main page still works, then yeah, that's first 
priority.


Is there a particular spot that stands out as needing the most 
improvement? I'm no Phobos expert, but I can at least fill any 
glaring holes.


Re: Some feedback on the website.

2015-12-17 Thread jmh530 via Digitalmars-d

On Thursday, 17 December 2015 at 20:08:32 UTC, Anon wrote:

On Thursday, 17 December 2015 at 20:04:44 UTC, jmh530 wrote:

My feedback: add the ability to edit posts in the forum


You can't edit email.


So your point is that the Dlang forum is implemented more like a 
mailing list than a forum? This means that your point is really 
that it would be a lot of work to implement this feature (perhaps 
even migrating to a different type of framework).


Re: What is the state of D for game development?

2015-12-17 Thread extrawurst via Digitalmars-d

On Thursday, 17 December 2015 at 17:46:15 UTC, BLM768 wrote:
On Thursday, 17 December 2015 at 17:38:31 UTC, Ali Çehreli 
wrote:
I am stealing HerrDrFaust's question from the following Reddit 
thread:



https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/

Please answer here or there.

Thank you,
Ali


Well, we have some bindings to game dev libraries, but the 
ecosystem isn't nearly as rich as what's available with C++. 
Derelict has bindings to almost all the "basic" libraries, 
though. I've been working on a binding to Bullet Physics, but 
it's stalled while I wait on a DMD pull request that I put in 
to allow the kind of introspection my method requires.


What PR is that ? Link ?

--Stephan


Re: Some feedback on the website.

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/17/15 3:06 AM, Jacob Carlborg wrote:

Oh, God, please no. Just use vibe.d and be done with it. We obviously
need a proper programming language to generate dconf.org.


We are already using vibe.d for the Phobos page-per-name documentation. 
As far as I can tell the initiative has been a qualified success.


The main problem there is that there are not enough folks to maintain 
the vibe-related artifacts. Basically when Sönke is busy with something 
else, any issue may wait indefinitely. (I haven't followed that lately, 
possibly things have improved as of late.)


In order to make the use of vibe.d entirely successful across dlang.org 
and dconf.org, we need to show robust gains from using it for Phobos. As 
virtually the sole maintainer of dconf.org, I'd feel definitely 
motivated to use vibe.d if there was good evidence of thriving 
collaboration around the use of it on http://dlang.org/library.


Jacob, are you willing to ramp up you contribution to the vibe.d-related 
parts of Phobos? That would go a long way toward convincing everyone of 
the productivity gains of using it instead of ddoc (or others).



Andrei



Re: Some feedback on the website.

2015-12-17 Thread Andrei Alexandrescu via Digitalmars-d

On 12/17/2015 06:33 PM, BLM768 wrote:

On Thursday, 17 December 2015 at 19:50:40 UTC, Andrei Alexandrescu wrote:

If you have some time and motivation to improve the documentation,
there's tremendous opportunity for impact. So much low-hanging fruit,
all well before we explore switching to a different way of building
the site. And whatever improvements you make won't compete with future
changes. There's so much opportunity there it hurts. -- Andrei


As long as the main page still works, then yeah, that's first priority.

Is there a particular spot that stands out as needing the most
improvement? I'm no Phobos expert, but I can at least fill any glaring
holes.


There's a bunch to do.

* Many functions don't have "Parameters:", "Returns:", or "Throws:" 
sections. Those that respectively take parameters, return non-void, or 
throw, should have one each.


* All functions should have an example.

* "Examples:" is a historical error. All instances should be "Example:". 
Just one diff making that change throughout would be a meaningful 
contribution.


* Overloaded functions should be collected together, connected with "/// 
ditto".


* Examples on the site and on the library pages should be editable and 
runnable just like the one on the homepage.


* Eliminating those redundant macros that everybody's talking about.


Andrei



Re: Some feedback on the website.

2015-12-17 Thread JohnCK via Digitalmars-d

On Thursday, 17 December 2015 at 23:30:46 UTC, jmh530 wrote:

On Thursday, 17 December 2015 at 20:08:32 UTC, Anon wrote:

On Thursday, 17 December 2015 at 20:04:44 UTC, jmh530 wrote:

My feedback: add the ability to edit posts in the forum


You can't edit email.


Maybe I can answer your questions:

So your point is that the Dlang forum is implemented more like 
a mailing list than a forum?


Yes.

This means that your point is really that it would be a lot of 
work to implement this feature (perhaps even migrating to a 
different type of framework).


I think shouldn't count on that.

JohnCK.



Re: Some feedback on the website.

2015-12-17 Thread Sebastiaan Koppe via Digitalmars-d

On Thursday, 17 December 2015 at 08:15:49 UTC, wobbles wrote:

That would be a whole re-write of the website though.


We could of course also use ddoc and write a generator to 
whatever template language we like. The rest is peanuts.


Re: Some feedback on the website.

2015-12-17 Thread John Colvin via Digitalmars-d
On Wednesday, 16 December 2015 at 20:05:03 UTC, Vladimir 
Panteleev wrote:

On Tuesday, 15 December 2015 at 21:45:02 UTC, deadalnix wrote:
On Tuesday, 15 December 2015 at 13:42:29 UTC, Andrei 
Alexandrescu wrote:

On 12/15/15 5:54 AM, tcak wrote:
The harder it is made for people to contribute the system 
for fixations,

the lesser changes are seen.


I don't think we've had many contributions via the "Improve 
this page" button.




I don't know how representative it is, but once in a while, i 
forgot all of this is in DDoc, I notice something, what to do 
a quick patch, and end up being reminded this is in DDoc and I 
have no idea how to fix the thing, because suddenly, what 
looked like a quick fix end up being learning a new macro 
language.


DDoc itself is very simple. The problem is the endless number 
of macros we use on dlang.org. E.g. all the different ways to 
link to something: A, AHTTP, AHTTPS, ALOCAL, LINK, LINK2, WEB, 
LREF, XREF, XREF2, CXREF, ECXREF, MYREF, FULL_XREF, STDMODREF, 
COREMODREF, OBJREF... There is also no strong reason to use 
e.g. DIVCID instead of plain HTML.


The number of macros bothers me, but mostly it's the complete 
lack of documentation and guidelines on where/how to use them*.
It's pretty unreasonable to expect someone submitting a passing 
doc fix to

1) find where the macros are defined
2) decipher them
3) use the "right" one**
It's just too much unpleasant work for people to bother with.

*If there is documentation and guidelines on this and I don't 
know about it, consider what it would be like for someone who 
doesn't spend many hours a week on the various subdomains of 
dlang.org: it might as well not exist!


**there must be some reasons for the existence of all of those 
macros, so presumably there are good and bad choices for certain 
situations, even if nothing is obviously broken using the bad 
choice. Sure, we might say "submit something naïve and then 
people will help you fix it", but that's still a barrier to 
entry; 1) how were they supposed to know we felt that way about 
submissions? 2) people don't like looking stupid.


  1   2   >