I'm looking for more readable standard function to add a
**character** literal to a **string**.
The `~` operator is clearly not great while reading a source code.
I'm not here to discuss that. I'm looking for a function inside
standard library.
The function should be straightforward, up to
Matches function declarations and captures function names from
`.d` Source Code file
**regexcapture.d**
```
import std.stdio : writeln;
import std.regex : matchAll, regex;
import std.file : read;
void main(){
string input = cast(string)read("sourcecode.d");
foreach(match;
On Monday, 11 December 2023 at 05:18:45 UTC, thinkunix wrote:
BoQsc via Digitalmars-d-learn wrote:
This is something I've searched on the forum and couldn't find
exact answer.
TLDR: `r"^."` is matching the very first two character in the
`input` string.
Don't you need two dots to
This is something I've searched on the forum and couldn't find
exact answer.
TLDR: `r"^."` is matching the very first two character in the
`input` string.
**matchtest.d**
```
import std.stdio : writeln;
import std.regex : matchAll;
import std.file : read;
void main(){
string input
`switch` statement to match a text line
While outputing to the standard stream, it is also possible to
use `switch` statement to **match a text line to a text line in a
file.** I personally think it improve readability and
maintainability in some applications.
```
import std;
void
On Wednesday, 6 December 2023 at 14:56:50 UTC, BoQsc wrote:
As of recent observation the `line` in the previous
implementation seem to recognise **\r** as default terminator.
Making `writeln("|" ~ line ~ "|");` not possible.
By correcting terminator and disabling it on `byLine` function
it
As of recent observation the `line` in the previous
implementation seem to recognise **\r** as default terminator.
Making `writeln("|" ~ line ~ "|");` not possible.
By correcting terminator and disabling it on `byLine` function it
is possible to achieve following output to standard stream:
This is pretty basic question.
If you open [D Library
Reference](https://dlang.org/phobos/index.html) you are bound to
see the **Internal API** section in the table of content.
What is the **Internal API** (internal.core, dmd, rt) for and
when, how and where to use it?
I tried to look into https://dlang.org/phobos/std_conv.html
Most of the functions inside `std.conv` seem to be dependant on
[Garbage Collection](https://dlang.org/spec/garbage.html).
And I couldn't find a straightforward way to produce a `string`
value out of `uint` value.
How to convert
On Thursday, 23 November 2023 at 20:00:31 UTC, H. S. Teoh wrote:
On Thu, Nov 23, 2023 at 07:22:22PM +, BoQsc via
Digitalmars-d-learn wrote:
Is it possible to declare empty pointer variable inside
function calls and pass its address to the function?
These are sometimes required while using
Is it possible to declare empty pointer variable inside function
calls and pass its address to the function?
These are sometimes required while using Win32 - Windows
Operating System API.
* Empty pointer variables are used by functions to return
information after the function is done.
My
Latest iteration on this thread.
Limitations:
* pipes through two programs.
* very verbose, hard to use.
```
import std;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) { enum Find = "grep"; }
void pipeTo(Pipe p, string nextprogram){
Let's say we have a chain of functions.
```
a().b().c();
```
I would like to have a behaviour in `a()` that would check if
there is `b()` or `c()` chained to it.
If `a();`is not chained: do a `writeln("You forgot to chain this
function!");`
A function that executes a program
For me
To make this thread more complete, here is the final version.
```
import std.stdio;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) { enum Find = "grep"; }
int main (string [] args)
{
auto p1 = pipe;
auto p2 = pipe;
auto pid1 = spawnShell("echo
Using `spawnShell` it all seem to work.
However the question of why `spawnProcess(["find", "string to
find"]` is not working and produces error is still unresolved.
Works with `spawnShell`:
```
import std.stdio;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) {
On Windows:
While trying to use `spawnshell` I discovered that I can not use
any alphabetical letters inside the `spawnProcess([Find,
"Hello"])` it all works when they are numerical `[Find, "6515"]`.
As of recent testing `[Find, "df123"]` also is acceptable,
but not when letter is on the
I would like to export some functionality as external shared
dynamically linked D library.
Is it possible to do that in D Language and what are limitations?
A simple `writeln` example would be great.
What I expect is an executable that uses functions, variables,
classes, modules from
To test the behaviour of static library.
**program.d**
```
module program;
import std.stdio;
import library;
void main(string[] args)
{
writeln("func(3) = ", library.func(3));
}
```
**Command Line:**
```
dmd "./program.d" "./builds/library.di" "./builds/library.lib"
-ofProgram.exe
In summary this is what it all combined could look like.
**dub.sdl**
```
name "dheaders"
description "generates .di header file for a static library."
authors "public domain"
copyright "Public Domain. No rights reserved."
license "public domain"
configuration "staticLibrary" {
dflags
Update:
To allow only `.di` (D Header) output:
Instead of configuration, it would be more correct to make a new
`build type`.
```
buildType "headerFileOnly" {
extraDependencyFiles "$PACKAGE_DIR/builds/library.di"
dflags "-Hf=$PACKAGE_DIR/builds/library.di"
dflags
Configuration to generate only `.di` (D Header file)
```
name "dheaders"
description "generates .di header file for a static library."
authors "public domain"
copyright "Public Domain. No rights reserved."
license "public domain"
configuration "staticLibrary" {
dflags
**Conclusive observation:**
This can be resolved by informing `dub` of `extraDependencyFiles`
to rebuild itself.
`library.di` non-existance simply does not trigger rebuild of the
package and instead only `library.lib` is being copied from the
`cache` folder into `build` folder. Leaving
On Sunday, 5 November 2023 at 10:54:35 UTC, Imperatorn wrote:
On Sunday, 5 November 2023 at 10:53:33 UTC, BoQsc wrote:
I would like to know how to solve this problem with `dub`.
**dub.sdl**
```
name "dheaders"
description "generates .di header file for a static library."
authors "public
I would like to know how to solve this problem with `dub`.
**dub.sdl**
```
name "dheaders"
description "generates .di header file for a static library."
authors "public domain"
copyright "Public Domain. No rights reserved."
license "public domain"
configuration "staticLibrary" {
dflags
On Friday, 3 November 2023 at 21:57:57 UTC, Andrey Zherikov wrote:
On Friday, 3 November 2023 at 19:21:42 UTC, BoQsc wrote:
However I would want to try to enforce this behaviour from the
`dub.json` or `dub.sdl` file.
IMHO this is not something that should be enforced from package
build
While using `dub`, you might notice that after running `dub` or
`dub run` command you will end up with notice:
```
Starting Performing "debug" build using
C:\D\dmd2\windows\bin64\dmd.exe for x86_64.
```
Example output:
```
C:\Users\Windows10\Documents\Dlang winsock\datatypes>dub
Well the whole thread is about importing `package.d` while being
inside package to provide runnable working example which contains
debug information of the package.
Sidenote:
This is essentially useful when distributing over many
machines/platforms via `dub` package manager.
You would want
On Thursday, 2 November 2023 at 11:32:40 UTC, Imperatorn wrote:
On Thursday, 2 November 2023 at 11:12:58 UTC, BoQsc wrote:
On Thursday, 2 November 2023 at 10:53:12 UTC, Arafel wrote:
On 02.11.23 11:45, BoQsc wrote:
Edit incorrect link to example:
[Extensive run.dlang.io
On Thursday, 2 November 2023 at 10:53:12 UTC, Arafel wrote:
On 02.11.23 11:45, BoQsc wrote:
Edit incorrect link to example:
[Extensive run.dlang.io
example](https://run.dlang.io/is/f3jURn)
Correct link:
https://run.dlang.io/is/Zbrn75
```
--- waffles/program.d
import waffles;
```
See
Edit incorrect link to example:
[Extensive run.dlang.io
example](https://run.dlang.io/is/f3jURn)
Correct link:
https://run.dlang.io/is/Zbrn75
![](https://i.imgur.com/829CzOS.png)
Source File **package.d** is a [package module][1] which contains
import statements to import other modules.
How would one import a **package.d** module when [**keyword
"package"**][2] is preventing that?
[1]:
I'm unable to import a `.d` source file from a subfolder.
Now this happens only with `rdmd`.
The `dmd -i -run` works perfectly.
I'm currently on Windows 10 operating system.
**./testimport.d**:
```
import std;
import waffle.next;
void main(){
writeln("test", testing);
}
```
On Monday, 2 October 2023 at 18:39:41 UTC, Imperatorn wrote:
On Monday, 2 October 2023 at 18:34:13 UTC, BoQsc wrote:
Here is my issue: I've found a formula on Wikipedia.
It's called **Hashing by division**.
![](https://i.imgur.com/UJPAWIW.png)
As you can see it uses **mod** keyword to achieve
The package dependency `emsi_containers` that can be found in
https://code.dlang.org/packages/emsi_containers might be a
viable way to resolve the problem.
```
/+dub.sdl:
dependency "emsi_containers" version="~>0.7"
+/
import std;
void main(string[] args) @nogc
{
import containers;
After being very happy about associative arrays of D Language, I
encountered that they are not `@nogc`friendly. Unsure if I should
wait for D language to support it, or do I need to rethink
everything.
Error
```
onlineapp.d(20): Error: assigning an associative array element in
`@nogc`
Out of scope access to a variable using stored pointer address,
demonstration.
```
import std;
void outofcontext()
{
writeln("Hello D ", associative);
foreach (pointeraddress, information; associative)
{
writeln(*cast(string*)pointeraddress);
}
}
static string[void* ]
Bonus: Store hexadecimal literals in associative array of
pointer addresses.
```
import std;
void main()
{
string[void *] associative;
// Store Hexadecimal as pointer address in associative array
associative[cast(void *)0x7FFCD332CD60] = "someinformation";
// Store
For some reason I thought this was something I wanted to achieve
and share.
```
import std;
void main()
{
string variable;
void * pointeraddress =
string[void *] associative;
associative[pointeraddress] = "someinformation";
writeln("Hello D ", pointeraddress);
Note that this doesn't work in gdc.
The templated version is actually more akin to what C does.
Yeah it does not seem to work in gdc when tested using
https://d.godbolt.org/
The errors produced:
```
:11:12: error: none of the overloads of template
'core.stdc.stdarg.va_arg' are callable
https://dlang.org/phobos/core_vararg.html
The common way to use **va_arg** is `va_arg!(int)(_argptr);`
What would be the alternative way or syntax that behave exactly
the same way, even if more verbose?
`va_arg!(int)(_argptr);` is taken from an example in:
https://docarchives.dlang.io/v2.073.0/spec/struct.html#struct-literal
I would like to set function's default struct for a function in a
way that it would be visible for the reader to see what options
are set. Something like `Options option = {silenceErrors: false}`
Here is an example of
Some people might not know that it is possible to subscribe and
get notifications about replies to your forum posts via email.
1. Open main forum page and click **"new replies"** link
![img1](https://i.imgur.com/HwhDCKO.png)
---
2. Scroll down to the bottom of the page
I've seen everyone using **datatype**`.sizeof` property.
https://dlang.org/spec/property.html#sizeof
It's great, but I wonder if it differ in any way from the
standard C function `sizeof()`.
https://www.geeksforgeeks.org/sizeof-operator-c/
https://en.cppreference.com/w/cpp/language/sizeof
Update: GetUserName by print to stdout
Main function has been updated with `string[] args` and a new
feature:
```
if (args.length > 1 && args[1] == "print") {
write(username);
}
```
Usage:
`WindowsGetUserName.exe print`
Demonstration
I'm sharing some code here.
**It's not completely tested and might contain serious mistakes,
repetitions, bad style and readabilty.
But it seems to work.**
Critique, improvements and feedback might help.
Demonstration
This code retrieves username of the current windows user using
Today I've tried to use Windows API once again and encountered
very time consuming case.
It's been a long time since the last time I used Windows API.
This time I've had an idea that it would be interesting to get
thread associated username using Windows API. So after some time
while trying
I would like to display some identifier that is set after
compilation and remains unchanged.
This is to recognise and check if two binaries belong to the same
compilation or it is a different compilation.
I would place it into **version** command of my program.
This is what I have now.
There are three compilers present in the Dlang website: DMD GDC
and LDC
This is a working Hello World example without dependency on
Microsoft C Runtime Library, I couldn't find anything by
searching around the forums or search engines, so I'm posting it
here. Please provide improvements if you feel like something is
missing or incorrect.
**How to Compile:**
`dmd
On Sunday, 4 September 2022 at 22:05:24 UTC, ShadoLight wrote:
On Sunday, 4 September 2022 at 15:16:47 UTC, BoQsc wrote:
**Folder structure**
.\msvcr120.dll
.\folder1\HelloWorld.exe
.\folder2\HelloWorld.exe
You don't need to do this. msvcr120.dll is already shipped with
the DMD compiler
![HelloWorld](https://i.imgur.com/5BjVIU9.png)
**Folder structure**
.\msvcr120.dll
.\folder1\HelloWorld.exe
.\folder2\HelloWorld.exe
Basic binaries produced by DMD.exe compiler require
Microsoft Compiler Runtime DLL
As you might know that a basic D Language example
`HelloWorld.exe`
Is it possible to import module that is not in the module's
current directory's folder or subfolders?
For example:
I want to import `somemodule2.d` and `somemodule3.d` into a
**`somemodule.d`**
**.\somefolder\somemodule.d**
.\somemodule2.d
.\someotherfolder\somemodule3.d
Haven't used debuggers or debugged a lot just yet, but I've had
this question in my mind and I'd like to inspect some debugging
information manually. Are there some kind of documentation or
specification and are there a lot of information that is hidden
in a an average "debuggable" binary?
On Monday, 18 April 2022 at 05:27:32 UTC, Danny Arends wrote:
Hey All,
For some reason I cannot reset my password to get into dub
(https://code.dlang.org/), after trying I never receive the
email to reset my password.
I was unsure at first if I had signed up at all, but trying to
make a
Let's say I have this example program.
I want to get the arguments of all the `some_function();` in the
whole program.
**Even if the scope of the function call is never executed.**
(Ex. due to IF statement being negative.)
I tried to use `__traits` but it seems to not gather any
information
On Thursday, 7 April 2022 at 12:51:26 UTC, Stanislav Blinov wrote:
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote:
wchar_t* clang_string = cast(wchar_t *)"AA";
You're witnessing undefined behavior. "AA" is a string
literal and is stored in the data
On Thursday, 7 April 2022 at 11:03:39 UTC, Tejas wrote:
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote:
Here I try to concatenate three character strings using
`wcsncat()`.
[...]
Maybe try using `wstring` instead of string? Also use the `w`
postfix
```d
wstring dlang_string =
Here I try to concatenate three character strings using
`wcsncat()`.
`clang_string` AA
`dlang_string` BBB
`winpointer_to_string` CC
```
import std.stdio;
@system void main(){
import std.utf: toUTF16z, toUTF16;
import
I have a feeling that some parts of my code contains unterminated
strings and they do overflow into other string that is to be
combined. I'd like to take a look at strings, analyse them
manually and see if any of them end up terminated or not.
Please provide any relevant examples of how you
On Tuesday, 5 April 2022 at 11:53:19 UTC, Dennis wrote:
On Tuesday, 5 April 2022 at 11:26:27 UTC, BoQsc wrote:
I'd like to know if there is similar function: that can check
if a **key** inside a [Associative Array][2] can be found.
You can use the `in` operator for that:
I've found [std.algorithm: canFind][1] to be useful on a
**regular arrays**.
I'd like to know if there is similar function: that can check if
a **key** inside a [Associative Array][2] can be found.
[1]:https://dlang.org/phobos/std_algorithm_searching.html#.canFind
On Tuesday, 8 March 2022 at 22:28:27 UTC, bauss wrote:
On Tuesday, 8 March 2022 at 20:12:40 UTC, BoQsc wrote:
I think D Language needs and lacks conditional compilation
condition and attribute of "exclude". The exclude keyword or
code block in the exclude, would be made sure to not be
I think D Language needs and lacks conditional compilation
condition and attribute of "exclude". The exclude keyword or code
block in the exclude, would be made sure to not be imported by
any means. Now it seems all to be only workarounds.
Premise: In D language, only one main(){} function can exist in a
program.
Having two `main()` functions throws an error.
Let's say I want to use some functionality of another program,
but it has a `main(){}`
function. How can I import and use functions without importing
the `main(){}`
Update: 2022-03-04
ChangeLog:
* Fixed Typos
* Added Switch Statement for Command Line Interface Arguments
* Added Switch Statement for Policy, intl, Environment
* Added Switch Statement for Error handling: Exit status,
Error level
* Increased window "timeout" from 1 to 1000
On Thursday, 3 March 2022 at 12:14:13 UTC, BoQsc wrote:
I need to check if a string contains integers,
and if it contains integers, remove all the regular string
characters.
I've looked around and it seems using regex is the only closest
solution.
```
import std.stdio;
void main(string[]
On Thursday, 3 March 2022 at 13:25:32 UTC, Stanislav Blinov wrote:
On Thursday, 3 March 2022 at 12:14:13 UTC, BoQsc wrote:
I need to check if a string contains integers,
and if it contains integers, remove all the regular string
characters.
I've looked around and it seems using regex is the
I need to check if a string contains integers,
and if it contains integers, remove all the regular string
characters.
I've looked around and it seems using regex is the only closest
solution.
```
import std.stdio;
void main(string[] args){
if (args.length > 1){
I tried to use `std.conv.parse(args[2])`,
```
import std.stdio;
import std.conv;
void main(string[] args){
if (args.length > 1) {
writeln(broadcastSettingChange(args[1]));
if (args.length == 2) {
// TODO: second argument needs parse to
`bool nextArgumentDoesNotReachEndOfArray = i + 1 < args.length;`
How can I declare it out of scope and reuse it in any scope that
has `i` and `args.length` declared?
On Tuesday, 8 February 2022 at 18:21:46 UTC, duser wrote:
On Tuesday, 8 February 2022 at 16:10:19 UTC, BoQsc wrote:
Unsure where to start, so I decided to ask here how to get use
of this win32 header.
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/
the specific module containing
Unsure where to start, so I decided to ask here how to get use of
this win32 header.
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/
On Wednesday, 8 December 2021 at 14:16:16 UTC, bauss wrote:
On Wednesday, 8 December 2021 at 11:23:45 UTC, BoQsc wrote:
Let's say I want to skip characters and build a new string.
The string example to loop/iterate:
```
import std.stdio;
void main()
{
string a="abc;def;ab";
}
```
The
On Wednesday, 8 December 2021 at 12:49:39 UTC, Adam D Ruppe wrote:
On Wednesday, 8 December 2021 at 11:23:45 UTC, BoQsc wrote:
The string example to loop/iterate:
foreach(ch; a) {
}
does the individual chars of the string you can also
foreach(dchar ch; a) {
}
to decode the utf 8
Thanks
On Wednesday, 8 December 2021 at 11:35:39 UTC, Biotronic wrote:
On Wednesday, 8 December 2021 at 11:23:45 UTC, BoQsc wrote:
Let's say I want to skip characters and build a new string.
The string example to loop/iterate:
```
import std.stdio;
void main()
{
string a="abc;def;ab";
}
```
Let's say I want to skip characters and build a new string.
The string example to loop/iterate:
```
import std.stdio;
void main()
{
string a="abc;def;ab";
}
```
The character I want to skip: `;`
Expected result:
```
abcdefab
```
On Saturday, 27 November 2021 at 19:59:24 UTC, Imperatorn wrote:
On Wednesday, 24 November 2021 at 12:07:44 UTC, BoQsc wrote:
On Thursday, 11 July 2019 at 08:53:35 UTC, BoQsc wrote:
[...]
```
import std.stdio;
import std.windows.registry;
[...]
You could add some examples to the
On Wednesday, 24 November 2021 at 20:29:36 UTC, Imperatorn wrote:
On Wednesday, 24 November 2021 at 17:38:42 UTC, BoQsc wrote:
On Wednesday, 24 November 2021 at 17:29:09 UTC, Adam D Ruppe
wrote:
On Wednesday, 24 November 2021 at 17:23:07 UTC, BoQsc wrote:
The many times I tried this pragma, it
Since the **linkerDirective pragma** is not supported for OMF
object file.
Linker directives are only supported for MS-COFF output.
https://dlang.org/spec/pragma.html#linkerDirective
I doubt that this thread is completely resolved.
On Wednesday, 24 November 2021 at 17:38:42 UTC, BoQsc wrote:
[...]
**The obvious problem now is:** How can you compile without
specifying the flags. With plain dmd.
It probably has to do something with the default target of dmd
(`-m32`) generating **OMF object file**.
On Wednesday, 24 November 2021 at 17:29:09 UTC, Adam D Ruppe
wrote:
On Wednesday, 24 November 2021 at 17:23:07 UTC, BoQsc wrote:
The many times I tried this pragma, it did not even get
recognised as pragma at all.
You need to use `dmd -m32mscoff` or `dmd -m64`. Plain `dmd`
won't work.
If
On Wednesday, 24 November 2021 at 17:14:42 UTC, Adam D Ruppe
wrote:
On Wednesday, 24 November 2021 at 17:06:21 UTC, BoQsc wrote:
**The question:** Is there a way to include the `.def` file
instructions inside `.d` file, so that there won't be a need
for additional `.def` file when compiling.
I'm not sure if I have sucessfully achieved something like this
before or is it even possible right now, but there is a sample
file that comes with DMD compiler: `D\dmd2\samples\d\winsamp.d`
**The problem:** `winsamp.d` have to be compiled with `.def` file.
```
/+ Compile with:
+ dmd winsamp
On Thursday, 11 July 2019 at 08:53:35 UTC, BoQsc wrote:
https://dlang.org/phobos/std_windows_registry.html
https://github.com/dlang/phobos/blob/master/std/windows/registry.d
Can someone provide some examples on how to:
set, change, receive something from the Windows registry using
Phobos
Note: It is not possible to make subpackage inside subpackage.
To make a subpackage with dub; follow these general guidelines.
**General guidelines**
1. Create a new folder.
2. Open the folder.
3. Initialise a new package. (`dub init`)
4. Open `dub.json` file
* Append this:
```
On Friday, 19 November 2021 at 18:01:57 UTC, Adam D Ruppe wrote:
On Friday, 19 November 2021 at 17:36:55 UTC, BoQsc wrote:
Let's say I want to write a simple program that asks for an
input of a single character.
After pressing a single key on a keyboard, the character is
printed out and the
Let's say I want to write a simple program that asks for an input
of a single character.
After pressing a single key on a keyboard, the character is
printed out and the program should stop.
I think nested foreach loops are more readable.
```
import std;
void main()
{
alias alphabet = letters;
char[26] letters = ['a','b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r',
On Tuesday, 6 July 2021 at 15:48:35 UTC, rassoc wrote:
You can also do:
```d
import std;
void main()
{
// https://dlang.org/phobos/std_ascii.html#.lowercase
"Book.".filter!(c => lowercase.canFind(c))
.each!(c => writeln(c, " found"));
// Output:
// o found
//
On Monday, 5 July 2021 at 19:48:13 UTC, jfondren wrote:
On Monday, 5 July 2021 at 19:34:14 UTC, BoQsc wrote:
But I really don't like how it looks less readable and makes
less sense on first look.
`if (([letter].findAmong(alphabet)).length)`
I'd like to use some method on the `letter` instead
On Monday, 5 July 2021 at 19:25:23 UTC, jfondren wrote:
On Monday, 5 July 2021 at 19:19:19 UTC, BoQsc wrote:
If I use `[letter].findAmong(alphabet)` in my code, it
considers a dot (.) punctuation character as a letter.
You can see it here:
https://run.dlang.io/is/YWmaXU
It returns a
On Monday, 5 July 2021 at 18:59:09 UTC, jfondren wrote:
On Monday, 5 July 2021 at 18:53:27 UTC, jfondren wrote:
If you replace the findAmong call with
`[letter].findAmong(alphabet)`, this works.
Consider:
```d
import std;
void main() {
import std.ascii : alphabet = letters;
I get an error when I try to find that letter is among alphabet.
onlineapp.d(13): Error: template
`std.algorithm.searching.findAmong` cannot deduce function from
argument types `!()(immutable(char), immutable(string))`,
candidates are:
Let's say I can't store information into files.
Is it possible to download a file into an array.
This is what I have now. It saves a download into a file named:
file.txt
import std;
import std.net.curl;
void main()
{
writeln("Hello D");
On Sunday, 4 July 2021 at 08:50:54 UTC, Mike Parker wrote:
You can use named imports, but then you have to use the name as
a namespace:
```
import system = std;
void main()
{
system.writeln("Hello D");
}
```
These were the examples that might feel more readable and
natural than
I just started with a fresh look at the D language and would like
to be able to rewrite this code:
import std;
void main()
{
writeln("Hello D");
}
Into more readable standard library name:
import system;
void main()
{
writeln("Hello D");
}
Or into this
import library.standard;
On Wednesday, 3 June 2020 at 20:05:52 UTC, ttk wrote:
On Wednesday, 3 June 2020 at 19:53:03 UTC, BoQsc wrote:
Removing the last element of the string got it resolved.
Might not be the best way and adding additional check for
carriage return before removing the element would be better,
so this
Removing the last element of the string got it resolved.
Might not be the best way and adding additional check for
carriage return before removing the element would be better, so
this is only initial proof.
Improved example with the above comments resolved.
testingGround.d
import
On Wednesday, 3 June 2020 at 18:49:38 UTC, ttk wrote:
On Wednesday, 3 June 2020 at 18:23:51 UTC, BoQsc wrote:
Here you can see ". hahahahahahaha" and "nononono" and even
lineNumber is being merged into the same position. Why is this
happening and can this be simply resolved?
Your string in
C:\Users\vaida\Desktop\Associative Array Sorting> rdmd
testingGround.d
0. The quick brown fox jumps over the lazy dog
nonononoahahahaha Sphinx of black quartz, judge my vow.
2. # How vexingly quick daft zebras jump!
3. # The five boxing wizards jump quickly
4. # Maecenas consectetur risus a
1 - 100 of 189 matches
Mail list logo