www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Docs: Links to source code

reply Chris <wendlec tcd.ie> writes:
For one reason or another I sometimes find myself checking out 
the implementation of functions in Phobos. For this I have to go 
to the module file on Github, e.g. this one [1], and look for the 
function (that often has more than one implementation). Wouldn't 
it be nice to have a direct link from the documentation of the 
function to the source code? Is that feasible at all?

[1] 
https://github.com/dlang/phobos/blob/master/std/algorithm/searching.d
Jul 27 2016
next sibling parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 27.07.2016 um 11:43 schrieb Chris:
 For one reason or another I sometimes find myself checking out the
 implementation of functions in Phobos. For this I have to go to the
 module file on Github, e.g. this one [1], and look for the function
 (that often has more than one implementation). Wouldn't it be nice to
 have a direct link from the documentation of the function to the source
 code? Is that feasible at all?

 [1] https://github.com/dlang/phobos/blob/master/std/algorithm/searching.d
The new docs have that: http://dlang.org/library/std/algorithm/searching/all.html (click the "View source code" link at the top of the page)
Jul 27 2016
parent Chris <wendlec tcd.ie> writes:
On Wednesday, 27 July 2016 at 09:56:44 UTC, Sönke Ludwig wrote:
 Am 27.07.2016 um 11:43 schrieb Chris:
 For one reason or another I sometimes find myself checking out 
 the
 implementation of functions in Phobos. For this I have to go 
 to the
 module file on Github, e.g. this one [1], and look for the 
 function
 (that often has more than one implementation). Wouldn't it be 
 nice to
 have a direct link from the documentation of the function to 
 the source
 code? Is that feasible at all?

 [1] 
 https://github.com/dlang/phobos/blob/master/std/algorithm/searching.d
The new docs have that: http://dlang.org/library/std/algorithm/searching/all.html (click the "View source code" link at the top of the page)
Great! Maybe "View source code" could be either more visible (stronger color/gray) or near the function name. The reason I say this is that a lot of people will not find it and ask here where the link to the source code is.
Jul 27 2016
prev sibling next sibling parent reply lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 09:43:45 UTC, Chris wrote:
 For one reason or another I sometimes find myself checking out 
 the implementation of functions in Phobos. For this I have to 
 go to the module file on Github
for this kind of stuff I use the IDE code navigation facilities. import std.stuff; stu|ff CTRL+SHIFT+UP or Ctrl+Click The web is a source of distraction. You open the browser and you have already 250 new RSS items that are here to pull you from your current actibity.
Jul 27 2016
parent reply Chris <wendlec tcd.ie> writes:
On Wednesday, 27 July 2016 at 10:29:12 UTC, lkfsdg wrote:
 for this kind of stuff I use the IDE code navigation facilities.

 import std.stuff;

 stu|ff

 CTRL+SHIFT+UP or Ctrl+Click

 The web is a source of distraction. You open the browser and 
 you have already 250 new RSS items that are here to pull you 
 from your current actibity.
The point is that it should be easily accessible on the web, regardless of personal preferences or workflows ;)
Jul 27 2016
parent reply lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 10:34:10 UTC, Chris wrote:
 On Wednesday, 27 July 2016 at 10:29:12 UTC, lkfsdg wrote:
 for this kind of stuff I use the IDE code navigation 
 facilities.

 import std.stuff;

 stu|ff

 CTRL+SHIFT+UP or Ctrl+Click

 The web is a source of distraction. You open the browser and 
 you have already 250 new RSS items that are here to pull you 
 from your current actibity.
The point is that it should be easily accessible on the web, regardless of personal preferences or workflows ;)
Understood, but I found your argumentation fallacious. Actually I have nothing against your idea.
Jul 27 2016
parent reply Chris <wendlec tcd.ie> writes:
On Wednesday, 27 July 2016 at 10:47:57 UTC, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 10:34:10 UTC, Chris wrote:
 On Wednesday, 27 July 2016 at 10:29:12 UTC, lkfsdg wrote:
 for this kind of stuff I use the IDE code navigation 
 facilities.

 import std.stuff;

 stu|ff

 CTRL+SHIFT+UP or Ctrl+Click

 The web is a source of distraction. You open the browser and 
 you have already 250 new RSS items that are here to pull you 
 from your current actibity.
The point is that it should be easily accessible on the web, regardless of personal preferences or workflows ;)
Understood, but I found your argumentation fallacious. Actually I have nothing against your idea.
Out of interest, why was it fallacious? I always use the online docs.
Jul 27 2016
parent reply lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 10:54:37 UTC, Chris wrote:
 On Wednesday, 27 July 2016 at 10:47:57 UTC, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 10:34:10 UTC, Chris wrote:
 On Wednesday, 27 July 2016 at 10:29:12 UTC, lkfsdg wrote:
 for this kind of stuff I use the IDE code navigation 
 facilities.

 import std.stuff;

 stu|ff

 CTRL+SHIFT+UP or Ctrl+Click

 The web is a source of distraction. You open the browser and 
 you have already 250 new RSS items that are here to pull you 
 from your current actibity.
The point is that it should be easily accessible on the web, regardless of personal preferences or workflows ;)
Understood, but I found your argumentation fallacious. Actually I have nothing against your idea.
Out of interest, why was it fallacious? I always use the online docs.
You argueed that it would be nice to have this feature because you often have to browse on GH. That's fallacious because I've shown that it can be done locally. your original argument doesn't stand. You see the logic ;)
Jul 27 2016
parent reply Chris <wendlec tcd.ie> writes:
On Wednesday, 27 July 2016 at 11:01:14 UTC, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 10:54:37 UTC, Chris wrote:
 Out of interest, why was it fallacious? I always use the 
 online docs.
You argueed that it would be nice to have this feature because you often have to browse on GH. That's fallacious because I've shown that it can be done locally. your original argument doesn't stand. You see the logic ;)
Sorry, your argument was fallacious, because it was based on the assumption that everybody uses an IDE, the same as you do at that. Also, with your argumentation ("it can be done locally"), we could get rid of online dictionaries, encyclopedias etc., because I (might) have one on my desk - or I might have downloaded it to my local machine. No, your logic doesn't hold. And when you skim through the docs online, as I do sometimes to see if a functionality I need is in Phobos, it's pretty handy to be able to jump from there to GH.
Jul 27 2016
parent reply lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 11:09:59 UTC, Chris wrote:
 On Wednesday, 27 July 2016 at 11:01:14 UTC, lkfsdg wrote:
 [...]
Sorry, your argument was fallacious, because it was based on the assumption that everybody uses an IDE, the same as you do at that. Also, with your argumentation ("it can be done locally"), we could get rid of online dictionaries, encyclopedias etc., because I (might) have one on my desk - or I might have downloaded it to my local machine. No, your logic doesn't hold. And when you skim through the docs online, as I do sometimes to see if a functionality I need is in Phobos, it's pretty handy to be able to jump from there to GH.
IDE or text editor with special features for D, everytbody uses one, although to write code you actually only need paper and pen. A computer is only usefull to compile.
Jul 27 2016
parent reply ketmar <ketmar ketmar.no-ip.org> writes:
On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody uses 
 one
me not.
Jul 27 2016
parent reply lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody 
 uses one
me not.
perfect, so your the exception that confirm the rule.
Jul 27 2016
next sibling parent drug <drug2004 bk.ru> writes:
27.07.2016 15:21, lkfsdg пишет:
 On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody uses one
me not.
perfect, so your the exception that confirm the rule.
no, he isn't, I'm not use an IDE or a specialized editor too. And I know other people who doesn't use an IDE.
Jul 27 2016
prev sibling next sibling parent reply Lodovico Giaretta <lodovico giaretart.net> writes:
On Wednesday, 27 July 2016 at 12:21:27 UTC, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody 
 uses one
me not.
perfect, so your the exception that confirm the rule.
Me neither.
Jul 27 2016
parent reply lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 12:32:28 UTC, Lodovico Giaretta 
wrote:
 On Wednesday, 27 July 2016 at 12:21:27 UTC, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody 
 uses one
me not.
perfect, so your the exception that confirm the rule.
Me neither.
Mmmh i see, but you will have to use one when the time to remove the prefixes such as "fast", "precise" will come.
Jul 27 2016
parent reply Chris <wendlec tcd.ie> writes:
On Wednesday, 27 July 2016 at 13:10:11 UTC, lkfsdg wrote:

 Mmmh i see, but you will have to use one when the time to 
 remove the prefixes such as "fast", "precise" will come.
For small test programs it's hardly worth to use an IDE, even if you use one for big projects. But this is a pointless discussion. The point was to improve the docs in the sense that you have immediate _online_ access to a function's source code. This has already been implemented, and of story. There's no need to argue whether "to IDE or not to IDE".
Jul 27 2016
next sibling parent Chris <wendlec tcd.ie> writes:
On Wednesday, 27 July 2016 at 13:24:33 UTC, Chris wrote:
 On Wednesday, 27 July 2016 at 13:10:11 UTC, lkfsdg wrote:

 Mmmh i see, but you will have to use one when the time to 
 remove the prefixes such as "fast", "precise" will come.
For small test programs it's hardly worth to use an IDE, even if you use one for big projects. But this is a pointless discussion. The point was to improve the docs in the sense that you have immediate _online_ access to a function's source code. This has already been implemented, and of story. There's no need to argue whether "to IDE or not to IDE".
s/and/end
Jul 27 2016
prev sibling parent lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 13:24:33 UTC, Chris wrote:
 On Wednesday, 27 July 2016 at 13:10:11 UTC, lkfsdg wrote:

 Mmmh i see, but you will have to use one when the time to 
 remove the prefixes such as "fast", "precise" will come.
For small test programs it's hardly worth to use an IDE, even if you use one for big projects. But this is a pointless discussion. The point was to improve the docs in the sense that you have immediate _online_ access to a function's source code. This has already been implemented, and of story. There's no need to argue whether "to IDE or not to IDE".
Yes I've forgotten to put the [OT] prefix to detach it from the main thread.
Jul 27 2016
prev sibling parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 27.07.2016 14:21, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody uses one
me not.
perfect, so your the exception that confirm the rule.
Exceptions don't confirm the rule. They disprove the rule.
Jul 27 2016
parent reply lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 14:22:18 UTC, Timon Gehr wrote:
 On 27.07.2016 14:21, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody 
 uses one
me not.
perfect, so your the exception that confirm the rule.
Exceptions don't confirm the rule. They disprove the rule.
That's an idiomatic expression in my native language. It's possible that it doesn't exist in English. https://fr.wikipedia.org/wiki/L%27exception_qui_confirme_la_r%C3%A8gle http://www.linguee.fr/francais-anglais/traduction/c'est+l'exception+qui+confirme+la+r%C3%A8gle.html
Jul 27 2016
next sibling parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 27.07.2016 16:27, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 14:22:18 UTC, Timon Gehr wrote:
 On 27.07.2016 14:21, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody uses one
me not.
perfect, so your the exception that confirm the rule.
Exceptions don't confirm the rule. They disprove the rule.
That's an idiomatic expression in my native language. It's possible that it doesn't exist in English. https://fr.wikipedia.org/wiki/L%27exception_qui_confirme_la_r%C3%A8gle http://www.linguee.fr/francais-anglais/traduction/c'est+l'exception+qui+confirme+la+r%C3%A8gle.html
https://en.wikipedia.org/wiki/Exception_that_proves_the_rule
Jul 27 2016
parent reply lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 14:30:45 UTC, Timon Gehr wrote:
 On 27.07.2016 16:27, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 14:22:18 UTC, Timon Gehr wrote:
 On 27.07.2016 14:21, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody 
 uses one
me not.
perfect, so your the exception that confirm the rule.
Exceptions don't confirm the rule. They disprove the rule.
That's an idiomatic expression in my native language. It's possible that it doesn't exist in English. https://fr.wikipedia.org/wiki/L%27exception_qui_confirme_la_r%C3%A8gle http://www.linguee.fr/francais-anglais/traduction/c'est+l'exception+qui+confirme+la+r%C3%A8gle.html
https://en.wikipedia.org/wiki/Exception_that_proves_the_rule
I should use "prove" instead of "confirm". So now you get what i meant.
Jul 27 2016
parent reply Chris <wendlec tcd.ie> writes:
On Wednesday, 27 July 2016 at 14:53:59 UTC, lkfsdg wrote:

 https://en.wikipedia.org/wiki/Exception_that_proves_the_rule
I should use "prove" instead of "confirm". So now you get what i meant.
I for my part knew what you meant, but it was wrong. There are loads of people in the D community that don't use IDEs.
Jul 27 2016
parent lkfsdg <lkfsdg sdfeazq.od> writes:
On Wednesday, 27 July 2016 at 15:19:15 UTC, Chris wrote:
 On Wednesday, 27 July 2016 at 14:53:59 UTC, lkfsdg wrote:

 https://en.wikipedia.org/wiki/Exception_that_proves_the_rule
I should use "prove" instead of "confirm". So now you get what i meant.
I for my part knew what you meant, but it was wrong. There are loads of people in the D community that don't use IDEs.
Later I said 'IDE or text editor with special features for D...' (e.g people using DCD on TextAdept or their cutting-edge console mode text editor...). This makes me think to a phobos Bug, seen monthes ago: One templatized function, two overloads. Apparently the second overload was added without unittest. It's been there for monthes. One day somones managed to instantiate it in its code and got an error about "unknown module: std.whatever". The guy who added the second overload didn't use an IDE. with completion he wouldn't have typed an invalid module name. True story ;)
Jul 27 2016
prev sibling parent Chris <wendlec tcd.ie> writes:
On Wednesday, 27 July 2016 at 14:27:06 UTC, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 14:22:18 UTC, Timon Gehr wrote:
 On 27.07.2016 14:21, lkfsdg wrote:
 On Wednesday, 27 July 2016 at 12:19:34 UTC, ketmar wrote:
 On Wednesday, 27 July 2016 at 12:14:39 UTC, lkfsdg wrote:
 IDE or text editor with special features for D, everytbody 
 uses one
me not.
perfect, so your the exception that confirm the rule.
Exceptions don't confirm the rule. They disprove the rule.
That's an idiomatic expression in my native language. It's possible that it doesn't exist in English. https://fr.wikipedia.org/wiki/L%27exception_qui_confirme_la_r%C3%A8gle http://www.linguee.fr/francais-anglais/traduction/c'est+l'exception+qui+confirme+la+r%C3%A8gle.html
https://en.wikipedia.org/wiki/Exception_that_proves_the_rule
Jul 27 2016
prev sibling parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Wednesday, 27 July 2016 at 09:43:45 UTC, Chris wrote:
 Wouldn't it be nice to have a direct link from the 
 documentation of the function to the source code? Is that 
 feasible at all?
http://dpldocs.info/std.algorithm.searching.any go to the bottom for annotated source http://dpldocs.info/experimental-docs/source/std.algorithm.searching.d.html#L157 My thing is still slightly buggy but I have somewhat bigger plans for it, making my own source viewer instead of using Github's slow, generic, slow thing that is really slow. (Seriously, it is unusably slow on my laptop on anything more than like 100 lines, locking up the web browser and killing battery.) I also copy the source for the specific version the docs apply to so they can stay in sync without bleeding edge HEAD on one side and some tagged release on the other.
Jul 27 2016
parent Walter Bright <newshound2 digitalmars.com> writes:
On 7/27/2016 6:31 AM, Adam D. Ruppe wrote:
 My thing is still slightly buggy but I have somewhat bigger plans for it,
making
 my own source viewer instead of using Github's slow, generic, slow thing that
is
 really slow. (Seriously, it is unusably slow on my laptop on anything more than
 like 100 lines, locking up the web browser and killing battery.)
This problem appears to be specific to Windows Explorer. Github works much better with Chrome. I do not understand why Microsoft does not fix this, surely they have plenty of developers who use Github. I held off switching to Chrome for a long time because of the telemetry. But since Microsoft decided to add pervasive telemetry, there's no longer any reason to use Explorer.
Jul 27 2016