Re: How import DUB packcages directly and compile with DMD without use dub.exe?
On Friday, 17 July 2020 at 01:27:09 UTC, Marcone wrote: On Thursday, 16 July 2020 at 11:52:39 UTC, Andre Pany wrote: On Thursday, 16 July 2020 at 11:06:01 UTC, Marcone wrote: I just want import in file and run with dmd. Execute dub build with verbose output. You will find the info how dub is calling dmd. Kind regards Andre dub is calling dmd with -IC:\Users\Usuario\AppData\Local\dub\packages\scriptlike-0.10.3\scriptlike\src but I want dmd auto import any in dub packages, for example: -IC:\Users\Usuario\AppData\Local\dub\packages\. You can alter your `sc.ini` config to add `-I` path. But "auto-importing" package won't work, because packages are stored in a hierarchy that is `dub`-specific and DMD doesn't know about it. The piece of functionality you want sounds exactly like what dub is supposed to do, so why do you want to avoid it ?
Re: How import DUB packcages directly and compile with DMD without use dub.exe?
On Thursday, 16 July 2020 at 11:52:39 UTC, Andre Pany wrote: On Thursday, 16 July 2020 at 11:06:01 UTC, Marcone wrote: I just want import in file and run with dmd. Execute dub build with verbose output. You will find the info how dub is calling dmd. Kind regards Andre dub is calling dmd with -IC:\Users\Usuario\AppData\Local\dub\packages\scriptlike-0.10.3\scriptlike\src but I want dmd auto import any in dub packages, for example: -IC:\Users\Usuario\AppData\Local\dub\packages\.
Re: opApply and attributes
On Tuesday, 14 July 2020 at 00:17:14 UTC, solidstate1991 wrote: Something like that, but with @safe, pure, etc. attributes. I've tried to "bruteforce" it by generating functions with combinations of attributes, and it kinda works, but is a very janky solution. I'll brainstorm some DIP to fix this issue.
Re: getopt: How does arraySep work?
On Thursday, 16 July 2020 at 17:40:25 UTC, Steven Schveighoffer wrote: On 7/16/20 1:13 PM, Andre Pany wrote: On Thursday, 16 July 2020 at 05:03:36 UTC, Jon Degenhardt wrote: On Wednesday, 15 July 2020 at 07:12:35 UTC, Andre Pany wrote: [...] An enhancement is likely to hit some corner-cases involving list termination requiring choices that are not fully generic. Any time a legal list value looks like a legal option. Perhaps the most important case is single digit numeric options like '-1', '-2'. These are legal short form options, and there are programs that use them. They are also somewhat common numeric values to include in command lines inputs. [...] My naive implementation would be that any dash would stop the list of multiple values. If you want to have a value containing a space or a dash, you enclose it with double quotes in the terminal. Enclose with double quotes in the terminal does nothing: myapp --modelicalibs "file-a.mo" "file-b.mo" will give you EXACTLY the same string[] args as: myapp --modelicalibs file-a.mo file-b.mo I think Jon's point is that it's difficult to distinguish where an array list ends if you get the parameters as separate items. Like: myapp --numbers 1 2 3 -5 -6 Is that numbers=> [1, 2, 3, -5, -6] or is it numbers=> [1, 2, 3], 5 => true, 6 => true This is probably why the code doesn't support that. -Steve Yes, this what I was getting. Thanks for the clarification. Also, it's not always immediately obvious what part of the argument splitting is being done by the shell, and what is being done by the program/getopt. Taking inspiration from the recent one-liners, here's way to see how the program gets the args from the shell for different command lines: $ echo 'import std.stdio; void main(string[] args) { args[1 .. $].writeln; }' | dmd -run - --numbers 1,2,3,-5,-6 ["--numbers", "1,2,3,-5,-6"] $ echo 'import std.stdio; void main(string[] args) { args[1 .. $].writeln; }' | dmd -run - --numbers 1 2 3 -5 -6 ["--numbers", "1", "2", "3", "-5", "-6"] $ echo 'import std.stdio; void main(string[] args) { args[1 .. $].writeln; }' | dmd -run - --numbers "1" "2" "3" "-5" "-6" ["--numbers", "1", "2", "3", "-5", "-6"] $ echo 'import std.stdio; void main(string[] args) { args[1 .. $].writeln; }' | dmd -run - --numbers '1 2 3 -5 -6' ["--numbers", "1 2 3 -5 -6"] The first case is what getopt supports now - All the values in a single string with a separator that getopt splits on. The 2nd and 3rd are identical from the program's perspective (Steve's point), but they've already been split, so getopt would need a different approach. And requires dealing with ambiguity. The fourth form eliminates the ambiguity, but puts the burden on the user to use quotes.
Re: getopt: How does arraySep work?
On 7/16/20 1:13 PM, Andre Pany wrote: On Thursday, 16 July 2020 at 05:03:36 UTC, Jon Degenhardt wrote: On Wednesday, 15 July 2020 at 07:12:35 UTC, Andre Pany wrote: [...] An enhancement is likely to hit some corner-cases involving list termination requiring choices that are not fully generic. Any time a legal list value looks like a legal option. Perhaps the most important case is single digit numeric options like '-1', '-2'. These are legal short form options, and there are programs that use them. They are also somewhat common numeric values to include in command lines inputs. [...] My naive implementation would be that any dash would stop the list of multiple values. If you want to have a value containing a space or a dash, you enclose it with double quotes in the terminal. Enclose with double quotes in the terminal does nothing: myapp --modelicalibs "file-a.mo" "file-b.mo" will give you EXACTLY the same string[] args as: myapp --modelicalibs file-a.mo file-b.mo I think Jon's point is that it's difficult to distinguish where an array list ends if you get the parameters as separate items. Like: myapp --numbers 1 2 3 -5 -6 Is that numbers=> [1, 2, 3, -5, -6] or is it numbers=> [1, 2, 3], 5 => true, 6 => true This is probably why the code doesn't support that. -Steve
Re: getopt: How does arraySep work?
On Thursday, 16 July 2020 at 05:03:36 UTC, Jon Degenhardt wrote: On Wednesday, 15 July 2020 at 07:12:35 UTC, Andre Pany wrote: [...] An enhancement is likely to hit some corner-cases involving list termination requiring choices that are not fully generic. Any time a legal list value looks like a legal option. Perhaps the most important case is single digit numeric options like '-1', '-2'. These are legal short form options, and there are programs that use them. They are also somewhat common numeric values to include in command lines inputs. [...] My naive implementation would be that any dash would stop the list of multiple values. If you want to have a value containing a space or a dash, you enclose it with double quotes in the terminal. myapp --modelicalibs "fila-a.mo" "file-b.mo" --log-level info But you are right there a corner cases to be considered. Kind regards Andre
Re: D Wiki: run.dlang.io integration?
On Thursday, 16 July 2020 at 14:17:10 UTC, WebFreak001 wrote: On Thursday, 16 July 2020 at 13:54:56 UTC, aberba wrote: On Thursday, 16 July 2020 at 13:41:31 UTC, aberba wrote: On Thursday, 16 July 2020 at 09:47:02 UTC, WebFreak001 wrote: [...] Since its based on WikiMedia, searched an came up with this [1] to embed in iframe 1. https://www.mediawiki.org/wiki/Extension:Iframe Also the D Tour uses codemirror [1] which has an extension for wikimedia [2] 1. https://codemirror.net/index.html 2. https://www.mediawiki.org/wiki/Extension:CodeMirror Yeah an extension combining CodeMirror and adding another tab or splitting the container for the output, executed by run.dlang.io would be a cool addition to the wiki and would not be blocked as easily as iframes. From my quick lookup, its seems after embedded in your WikiMedia instances, it exposes a JavaScript API to monitor change and then execute the code. If run.dlang.io has a rest API of some kind, have to look up how it's done in tour, then its a matter of showing the code in a bottom div. Not familiar with the WikiMedia extension system but having it as a reusable component will be the ideal approach. I rather we go for a modernized wiki platform.
Re: D Wiki: run.dlang.io integration?
On Thursday, 16 July 2020 at 13:54:56 UTC, aberba wrote: On Thursday, 16 July 2020 at 13:41:31 UTC, aberba wrote: On Thursday, 16 July 2020 at 09:47:02 UTC, WebFreak001 wrote: [...] Since its based on WikiMedia, searched an came up with this [1] to embed in iframe 1. https://www.mediawiki.org/wiki/Extension:Iframe Also the D Tour uses codemirror [1] which has an extension for wikimedia [2] 1. https://codemirror.net/index.html 2. https://www.mediawiki.org/wiki/Extension:CodeMirror Yeah an extension combining CodeMirror and adding another tab or splitting the container for the output, executed by run.dlang.io would be a cool addition to the wiki and would not be blocked as easily as iframes.
Re: D Wiki: run.dlang.io integration?
On Thursday, 16 July 2020 at 13:41:31 UTC, aberba wrote: On Thursday, 16 July 2020 at 09:47:02 UTC, WebFreak001 wrote: [...] Since its based on WikiMedia, searched an came up with this [1] to embed in iframe 1. https://www.mediawiki.org/wiki/Extension:Iframe Also the D Tour uses codemirror [1] which has an extension for wikimedia [2] 1. https://codemirror.net/index.html 2. https://www.mediawiki.org/wiki/Extension:CodeMirror
Re: D Wiki: run.dlang.io integration?
On Thursday, 16 July 2020 at 09:47:02 UTC, WebFreak001 wrote: Is there a way to integrate some kind of "run this source code" button into the D wiki using run.dlang.io? If there isn't, it would be nice to add this kind of thing as plugin with the possibility of also including the editor so you never need to leave the wiki. (like on the D Tour) Since its based on WikiMedia, searched an came up with this [1] to embed in iframe 1. https://www.mediawiki.org/wiki/Extension:Iframe
Re: Using_string_mixins_for_logging error
On Wednesday, 15 July 2020 at 07:36:49 UTC, Vitalii wrote: Many thanks! I have now deprecated the old wiki page and linked to a new one with more examples: https://wiki.dlang.org/Logging_mechanisms
Re: How import DUB packcages directly and compile with DMD without use dub.exe?
On Thursday, 16 July 2020 at 11:06:01 UTC, Marcone wrote: I just want import in file and run with dmd. Execute dub build with verbose output. You will find the info how dub is calling dmd. Kind regards Andre
How import DUB packcages directly and compile with DMD without use dub.exe?
I just want import in file and run with dmd.
D Wiki: run.dlang.io integration?
Is there a way to integrate some kind of "run this source code" button into the D wiki using run.dlang.io? If there isn't, it would be nice to add this kind of thing as plugin with the possibility of also including the editor so you never need to leave the wiki. (like on the D Tour)