On Thursday, 22 April 2021 at 21:15:48 UTC, tcak wrote:
string fileContent = "";
...
[...]
Do you have a minimal reproducible test case? 樂
On Friday, 23 April 2021 at 00:44:58 UTC, tcak wrote:
As far as I see, it is not related to that array or indices at
all.
The question of where is to see if it was CTFE allocated or
runtime allocated. I don't think it should make a difference here
but idk.
If there is no known situation
all.
Oh and *where* is that positions variable defined?
I am doing OpenCL programming. CPU side is single threaded.
As far as I see, it is not related to that array or indices at
all. After running for a short time, if a piece of code does any
string/char or byte array concatenation at al
On Thursday, 22 April 2021 at 21:15:48 UTC, tcak wrote:
"positions" array is defined as auto positions = new float[ 100
]; So, I am 100% sure, it is not out of range. "ri*dim + 1" is
not a big number at all.
Oh and *where* is that positions variable defined?
Are there any other threads in your program?
In other parts of the code, concatenation operations are all
failing with same error. I need guidance to get out of this
situation. My assumption was that as long as there is empty heap
memory, concatenation operation would succeed always. But, it
doesn't seem like so.
ll allocation. I remember I had
this problem before in another project.
I have enough free ram. htop shows 3.96 GiB of 8 GiB is used only
and swap is not in use.
DMD64 D Compiler v2.094.0
Is this error related to me? Is it a programmer error? Is it a
bug? Am I doing something wrong? This is a compiler related
operation (string concatenation), and I assume/expect that it
would work without a problem.
reserving cuts down on the reallocations, but that only takes
some of the time. Appending a 1000-element int array is going
to go from a 16-byte block, to a 32-byte block, etc. up to a
4096 byte block. This involves roughly 8 reallocations per test.
But every append requires an opaque
On 4/1/21 10:53 AM, ludo wrote:
The results are below (you can also git clone the repo + dub test):
| Concatenation method | benchmark in ms|
|-|-|
|with std: | 385 ms|
|with stdReserve: | 327 ms|
|with stdLength: | 29 ms
with concatenation at the expense of the base pointer being 4
system words instead of two (16 instead of 8 bytes on a 32-bit
system).
*/
```
So I wrote a unittest to verify that claim, using for benchmark
10_000_000 concatenations :
```d
trace("*** ArrayBuilder Concatenation benc
On Wednesday, 2 December 2020 at 06:31:49 UTC, H. S. Teoh wrote:
On Tue, Dec 01, 2020 at 10:49:55PM +, ddcovery via
Digitalmars-d-learn wrote:
Yesterday I really shocked when, comparing one algorithm
written in javascript and the equivalent in D, javascript
performed better!!!
[...]
With
On Tue, Dec 01, 2020 at 10:49:55PM +, ddcovery via Digitalmars-d-learn
wrote:
> Yesterday I really shocked when, comparing one algorithm written in
> javascript and the equivalent in D, javascript performed better!!!
[...]
> With 1 million Double numbers (generated randomly):
> Javascript
On Wednesday, 2 December 2020 at 00:08:55 UTC, ddcovery wrote:
On Tuesday, 1 December 2020 at 23:43:31 UTC, Max Haughton wrote:
On Tuesday, 1 December 2020 at 22:49:55 UTC, ddcovery wrote:
Yesterday I really shocked when, comparing one algorithm
written in javascript and the equivalent in D,
On Tuesday, 1 December 2020 at 23:43:31 UTC, Max Haughton wrote:
On Tuesday, 1 December 2020 at 22:49:55 UTC, ddcovery wrote:
Yesterday I really shocked when, comparing one algorithm
written in javascript and the equivalent in D, javascript
performed better!!!
[...]
Use ldc, rdmd can
On Tuesday, 1 December 2020 at 22:49:55 UTC, ddcovery wrote:
Yesterday I really shocked when, comparing one algorithm
written in javascript and the equivalent in D, javascript
performed better!!!
[...]
Use ldc, rdmd can invoke it for you. DMD's optimizer is not even
close to as advanced as
On Tuesday, 1 December 2020 at 22:49:55 UTC, ddcovery wrote:
Yesterday I really shocked when, comparing one algorithm
written in javascript and the equivalent in D, javascript
performed better!!!
[...]
Sorry about title (may be "doubt" :-/ )
Yesterday I really shocked when, comparing one algorithm written
in javascript and the equivalent in D, javascript performed
better!!!
The idea is to translate the "3 lines sort" in haskell to
Javascript and D (with the limitations of each language). This
is not a quick sort test, but a
On 2/12/20 5:47 PM, Paul Backus wrote:
On Wednesday, 12 February 2020 at 20:58:49 UTC, Marcel wrote:
2- How is the builtin associative array implemented? I think I read
somewhere it's implemented like C++'s std::unordered_map but with BSTs
instead of DLists for handling collisions: is this
On Wednesday, 12 February 2020 at 20:58:49 UTC, Marcel wrote:
2- How is the builtin associative array implemented? I think I
read somewhere it's implemented like C++'s std::unordered_map
but with BSTs instead of DLists for handling collisions: is
this correct?
It's an open-addressed hash
On Wed, Feb 12, 2020 at 09:05:22PM +, user1234 via Digitalmars-d-learn
wrote:
> On Wednesday, 12 February 2020 at 20:58:49 UTC, Marcel wrote:
> > Hello!
> > I have two questions:
> >
> > 1- How can I concatenate two type sequences?
>
> alias Concatenated = AliasSeq!(TList1, TList2);
[...]
On Wednesday, 12 February 2020 at 20:58:49 UTC, Marcel wrote:
Hello!
I have two questions:
1- How can I concatenate two type sequences?
alias Concatenated = AliasSeq!(TList1, TList2);
or maybe
alias Concatenated = AliasSeq!(TList1[0..$], TList2[0..$]);
since I don't remember if they nest
Hello!
I have two questions:
1- How can I concatenate two type sequences?
2- How is the builtin associative array implemented? I think I
read somewhere it's implemented like C++'s std::unordered_map but
with BSTs instead of DLists for handling collisions: is this
correct?
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it. Can someone
share some knowledge on this or at least point
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it. Can someone
share some knowledge on this or at least point
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it. Can someone
share some knowledge on this or at least point
On Monday, 30 December 2019 at 14:56:59 UTC, mipri wrote:
On Monday, 30 December 2019 at 10:23:14 UTC, Marcone wrote:
On Monday, 30 December 2019 at 09:41:55 UTC, mipri wrote:
This leaks too much.
writeln("Helo {} {}".format("xx", "name")); // Helo xx name
writeln("Helo {}
On Monday, 30 December 2019 at 14:56:59 UTC, mipri wrote:
On Monday, 30 December 2019 at 10:23:14 UTC, Marcone wrote:
On Monday, 30 December 2019 at 09:41:55 UTC, mipri wrote:
This leaks too much.
writeln("Helo {} {}".format("xx", "name")); // Helo xx name
writeln("Helo {}
On Monday, 30 December 2019 at 10:23:14 UTC, Marcone wrote:
On Monday, 30 December 2019 at 09:41:55 UTC, mipri wrote:
This leaks too much.
writeln("Helo {} {}".format("xx", "name")); // Helo xx name
writeln("Helo {} {}".format("{}", "name")); // Helo name {}
This function replace {}
On Monday, 30 December 2019 at 09:41:55 UTC, mipri wrote:
On Monday, 30 December 2019 at 06:47:37 UTC, Marcone wrote:
Use Python format() style:
import std;
import std: Format = format;
// format()
string format(T...)(T text){
string texto = text[0];
foreach(count, i;
On Monday, 30 December 2019 at 06:47:37 UTC, Marcone wrote:
Use Python format() style:
import std;
import std: Format = format;
// format()
string format(T...)(T text){
string texto = text[0];
foreach(count, i; text[1..$]){
texto = texto.replaceFirst("{}",
On Wednesday, 25 December 2019 at 13:07:44 UTC, mipri wrote:
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it. Can someone
share some knowledge on this or at least point
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it. Can someone
share some knowledge on this or at least point
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it. Can someone
share some knowledge on this or at least point out useful
links/resources?
On Monday, 23 April 2018 at 23:27:17 UTC, Steven Schveighoffer
wrote:
...
If you want to know more about the array runtime, I suggest
this article: https://dlang.org/articles/d-array-article.html
...
Thanks for replying and this article is what I was looking for.
On 4/23/18 7:15 PM, Dnewbie wrote:
Hi,
I'd like to understand how array concatenation works internally, like
the example below:
//DMD64 D Compiler 2.072.2
import std.stdio;
void main(){
string[] arr;
arr.length = 2;
arr[0] = "Hello";
arr[1] = "World
On Monday, 23 April 2018 at 23:15:13 UTC, Dnewbie wrote:
It's related to memcpy?
By the way... It's related to realloc and memcpy?
Hi,
I'd like to understand how array concatenation works internally,
like the example below:
//DMD64 D Compiler 2.072.2
import std.stdio;
void main(){
string[] arr;
arr.length = 2;
arr[0] = "Hello";
arr[1] = "World";
writeln(arr.length);
arr = arr
On Friday, 14 July 2017 at 00:40:38 UTC, FoxyBrown wrote:
Anyone have an efficient implementation that is easy to use?
If you are OK with just a range spanning the two or more strings,
then you could use chain as is.
Anyone have an efficient implementation that is easy to use?
On Friday, 4 November 2016 at 14:55:27 UTC, Guillaume Piolat
wrote:
On Thursday, 3 November 2016 at 18:54:14 UTC, Gary Willoughby
wrote:
What is the simplest way of doing @nogc string concatenation?
I use sprintf + zero-terminated strings (or a RAII struct to
convert slices to ZT strings
On Thursday, 3 November 2016 at 18:54:14 UTC, Gary Willoughby
wrote:
What is the simplest way of doing @nogc string concatenation?
I use sprintf + zero-terminated strings (or a RAII struct to
convert slices to ZT strings).
On 11/3/16 2:54 PM, Gary Willoughby wrote:
What is the simplest way of doing @nogc string concatenation?
Where does it go?
For instance, this should work:
auto newstr = "hello, ".chain("world");
-Steve
On Thursday, November 03, 2016 18:54:14 Gary Willoughby via Digitalmars-d-
learn wrote:
> What is the simplest way of doing @nogc string concatenation?
std.range.chain is the closest that you're going to get with actual strings.
Dynamic arrays require the GC to do concatenation, because they h
What is the simplest way of doing @nogc string concatenation?
On Friday, 20 November 2015 at 20:39:58 UTC, Ilya wrote:
Can DMD frontend optimize
string concatenation
```
enum Double(S) = S ~ S;
assert(condition, "Text " ~ Double!"+" ~ ___FUNCTION__);
```
to
```
assert(condition, "Text ++_function_name_");
```
?
On Friday, 20 November 2015 at 20:39:58 UTC, Ilya wrote:
Can DMD frontend optimize
string concatenation
```
enum Double(S) = S ~ S;
assert(condition, "Text " ~ Double!"+" ~ ___FUNCTION__);
```
to
```
assert(condition, "Text ++_function_name_");
```
?
I
Can DMD frontend optimize
string concatenation
```
enum Double(S) = S ~ S;
assert(condition, "Text " ~ Double!"+" ~ ___FUNCTION__);
```
to
```
assert(condition, "Text ++_function_name_");
```
?
On Fri, 20 Nov 2015 20:39:57 +, Ilya wrote:
> Can DMD frontend optimize
> string concatenation
> ```
> enum Double(S) = S ~ S;
>
> assert(condition, "Text " ~ Double!"+" ~ ___FUNCTION__);
> ```
>
> to
>
> ```
> assert(condition,
On Tuesday, 6 October 2015 at 05:38:36 UTC, Jonathan M Davis
wrote:
Your suggestion only works by assuming that the result will fit
in a char, which doesn't fit at all with how coversions are
currently done in D. It would allow for narrowing conversions
which lost data. And there's no way that
On Tuesday, 6 October 2015 at 09:28:29 UTC, Marc Schütz wrote:
I see, this is a new problem introduced by `char + int = char`.
But at least the following could be disallowed without
introducing problems:
int a = 'a';
char b = 32;
But strictly speaking, we already accept overflow
On Tuesday, October 06, 2015 09:28:27 Marc Schütz via Digitalmars-d-learn wrote:
> I see, this is a new problem introduced by `char + int = char`.
> But at least the following could be disallowed without
> introducing problems:
>
> int a = 'a';
> char b = 32;
Sure, it would be nice, but
On Monday, October 05, 2015 11:48:51 Marc Schütz via Digitalmars-d-learn wrote:
> On Monday, 5 October 2015 at 10:30:02 UTC, Jonathan M Davis wrote:
> > On Monday, October 05, 2015 09:07:34 Marc Schütz via
> > Digitalmars-d-learn wrote:
> >> I don't think math would be a problem. There are some
On Sunday, 4 October 2015 at 21:57:44 UTC, Jonathan M Davis wrote:
When appending, b to a, the elements in b are being copied onto
the end of a, and presumably it works in this case, because a
ubyte is implicitly convertible to char. But all it's doing is
converting the individual elements.
On Sunday, 4 October 2015 at 21:57:44 UTC, Jonathan M Davis wrote:
On Sunday, October 04, 2015 16:13:47 skilion via
Digitalmars-d-learn wrote:
Is this allowed by the language or it is a compiler bug ?
void main() {
char[] a = "abc".dup;
ubyte[] b = [1, 2, 3];
a = b; // cannot
On Monday, October 05, 2015 09:07:34 Marc Schütz via Digitalmars-d-learn wrote:
> On Sunday, 4 October 2015 at 21:57:44 UTC, Jonathan M Davis wrote:
> > On Sunday, October 04, 2015 16:13:47 skilion via
> > Digitalmars-d-learn wrote:
> >> Is this allowed by the language or it is a compiler bug ?
>
On Monday, 5 October 2015 at 10:30:02 UTC, Jonathan M Davis wrote:
On Monday, October 05, 2015 09:07:34 Marc Schütz via
Digitalmars-d-learn wrote:
I don't think math would be a problem. There are some obvious
rules that would likely just work with most existing code:
char + int = char
char -
Is this allowed by the language or it is a compiler bug ?
void main() {
char[] a = "abc".dup;
ubyte[] b = [1, 2, 3];
a = b; // cannot implicitly convert expression (b) of type
ubyte[] to char[]
a ~= b; // works
}
On Sunday, October 04, 2015 16:13:47 skilion via Digitalmars-d-learn wrote:
> Is this allowed by the language or it is a compiler bug ?
>
> void main() {
> char[] a = "abc".dup;
> ubyte[] b = [1, 2, 3];
> a = b; // cannot implicitly convert expression (b) of type
> ubyte[] to char[]
On Monday, 30 March 2015 at 17:18:01 UTC, Suliman wrote:
same problem. I am preparing string to next SQL request:
string sss = format(SELECT * FROM test.imgs WHERE src LIKE
CONCAT('%', REPLACE(CAST(CURDATE()as char), -, ), '%') OR
CONCAT('%', CAST(CURDATE()as char), '%'));
Here's your code
string sss = format(foo-, bar);
It should be obvious now that you forgot to escape those double
quotes.
Thanks! Is there any way to stay string as is. without need of
it's escaping and so on?
It's seems I have seen something like it in docs, but I am not
sure about it...
On Monday, 30 March 2015 at 17:34:20 UTC, Suliman wrote:
string sss = format(foo-, bar);
It should be obvious now that you forgot to escape those
double quotes.
Thanks! Is there any way to stay string as is. without need of
it's escaping and so on?
It's seems I have seen something like it
same problem. I am preparing string to next SQL request:
string sss = format(SELECT * FROM test.imgs WHERE src LIKE
CONCAT('%', REPLACE(CAST(CURDATE()as char), -, ), '%') OR
CONCAT('%', CAST(CURDATE()as char), '%'));
but I am getting next error:
source\app.d(178): Error: invalid array
On Monday, 26 January 2015 at 01:57:04 UTC, bearophile wrote:
Laeeth Isharc:
I think concatenation and append are used as synonyms (the
same meaning is meant). a~=b or a=a~b
a=a~b always allocates a new array, while a~=b sometimes
re-allocates in place.
Bye,
bearophile
Perfect! Thank
On Monday, January 26, 2015 01:17:15 WhatMeWorry via Digitalmars-d-learn wrote:
Ok, I just made up that word. But what is the difference between
appending and concatenating? Page 100 of TPDL says The result
of the concatenation is a new array... and the section on
appending talks about
On Monday, 26 January 2015 at 01:17:17 UTC, WhatMeWorry wrote:
Ok, I just made up that word. But what is the difference
between appending and concatenating? Page 100 of TPDL says
The result of the concatenation is a new array... and the
section on appending talks about possibly needing
On Monday, 26 January 2015 at 01:57:04 UTC, bearophile wrote:
Laeeth Isharc:
I think concatenation and append are used as synonyms (the
same meaning is meant). a~=b or a=a~b
a=a~b always allocates a new array, while a~=b sometimes
re-allocates in place.
Bye,
bearophile
Thanks
Ok, I just made up that word. But what is the difference between
appending and concatenating? Page 100 of TPDL says The result
of the concatenation is a new array... and the section on
appending talks about possibly needing expansion and reallocation
of memory.
But I still don't feel like I
On Monday, 26 January 2015 at 01:17:17 UTC, WhatMeWorry wrote:
Ok, I just made up that word. But what is the difference
between appending and concatenating? Page 100 of TPDL says
The result of the concatenation is a new array... and the
section on appending talks about possibly needing
Laeeth Isharc:
I think concatenation and append are used as synonyms (the same
meaning is meant). a~=b or a=a~b
a=a~b always allocates a new array, while a~=b sometimes
re-allocates in place.
Bye,
bearophile
On Wed, 07 Jan 2015 16:38:23 +, Suliman wrote:
I except that writefln have some behavior as string concatenation, but
it does not.
IS there any way to put needed values in place of %s in string?
std.string.format interpolates string with the same behavior as writefln
but returns
', '%s');, date[i], a_fredericksburg[i],
fredericksburg[i], a_college[i], college[i], a_planetary[i],
planetary[i]);
I except that writefln have some behavior as string
concatenation, but it does not.
IS there any way to put needed values in place of %s in string?
Just FYI use prepared
],
a_college[i], college[i], a_planetary[i], planetary[i]);
I except that writefln have some behavior as string
concatenation, but it does not.
IS there any way to put needed values in place of %s in string?
],
fredericksburg[i], a_college[i], college[i], a_planetary[i],
planetary[i]);
I except that writefln have some behavior as string
concatenation, but it does not.
IS there any way to put needed values in place of %s in string?
Please show the _clean_ input, followed by an output example.
Bye
Please show the _clean_ input, followed by an output example.
Bye,
bearophile
to prevent visual corruption I had past it here:
http://www.everfall.com/paste/id.php?ftzy9lxr6yfy
Just FYI use prepared statements instead of string concatenation
for SQL queries.
You mean some tools
std.string.format interpolates string with the same behavior as
writefln
Thanks!
what if a_college[i] will contain ` char?
almost SQL have prepare statement...
On Thu, 14 Aug 2014 05:57:17 +, Carl Sturtivant wrote:
This is the idea I mean.
http://citeseer.ist.psu.edu/viewdoc/download?
doi=10.1.1.14.9450rep=rep1type=pdf
Here's a C++ implementation supported I think by gcc.
http://www.sgi.com/tech/stl/Rope.html
Is there a D implementation of a
On Saturday, 16 August 2014 at 02:26:29 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 15 Aug 2014 19:04:10 -0700
Timothee Cour via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
sounds like my C library based on this article:
On Sat, 16 Aug 2014 10:25:01 +
MrSmith via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Can you also share your progress?
sure. the project has no public repo yet, but you can take a look at
it's current state here: http://ketmar.no-ip.org/etx.txz
no undo/redo support for
On Sat, 16 Aug 2014 10:25:01 +
MrSmith via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Can you also share your progress?
here is public repo: http://repo.or.cz/w/etx.d.git
remember, this is not even alpha-quality code (but it seems to be
stable enough to build something upon
Search gave result enough rope to hang yourself.
On Fri, 15 Aug 2014 19:04:10 -0700
Timothee Cour via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
sounds like my C library based on this article:
http://e98cuenc.free.fr/wordprocessor/piecetable.html
i'm slowly converting my C code to D (nothing fancy yet, still C-style).
it's
On Saturday, 23 November 2013 at 23:39:12 UTC, Nordlöw wrote:
Is there a higher-order range pattern that concatenate two
InputRanges?
Sounds like you need std.range.chain:
http://dlang.org/phobos/std_range.html#chain
On Friday, 15 November 2013 at 22:33:34 UTC, Brad Anderson wrote:
Appender in std.array is probably what you are looking for.
std.algorithm.joiner is also useful (no allocations at all
even) but the use case is a bit different.
Is Appender considered up to Phobos' current standards? I
On Friday, 15 November 2013 at 23:51:42 UTC, Jacek Furmankiewicz
wrote:
Thanks for the book! I printed it, all 673 pages of it. Immense
work you have there.
I think it's good to listen a little critics from newcomers. I
belive that it helps Ali Cehreli to improve the book.
Also, you can use
On 11/16/2013 08:59 AM, ilya-stromberg wrote:
I think it's good to listen a little critics from newcomers. I belive
that it helps Ali Cehreli to improve the book.
Exactly! :) Two quotes from the Introduction chapter:
If you come across chapters that you find to be particularly difficult,
it
Since D strings are immutable (like in most other languages),
string concatenation is usually pretty inefficient due to the
need to create a new copy of the string every time.
I presume string concatenation using the typical array syntax can
be optimized by the compiler to do all
On Friday, 15 November 2013 at 22:26:20 UTC, Jacek Furmankiewicz
wrote:
Since D strings are immutable (like in most other languages),
string concatenation is usually pretty inefficient due to the
need to create a new copy of the string every time.
I presume string concatenation using
On Fri, 15 Nov 2013 23:26:19 +0100, Jacek Furmankiewicz wrote:
Since D strings are immutable (like in most other languages), string
concatenation is usually pretty inefficient due to the need to create a
new copy of the string every time.
I presume string concatenation using the typical
On Fri, 15 Nov 2013 22:30:35 +, Justin Whear wrote:
std.array has an Appender type that can be used to build up a string (or
any other array type) efficiently.
Oh, and if you have an idea of how large the result might grow, be sure
to use the reserve() method on the appender.
Thank you all.
I am learning D by going through Ali Cehreli's otherwise
excellent Programming in D PDF and he did not show this in his
initial chapter on Strings.
On Friday, 15 November 2013 at 22:35:48 UTC, Jacek Furmankiewicz
wrote:
I am learning D by going through Ali Cehreli's otherwise
excellent Programming in D PDF and he did not show this in
his initial chapter on Strings.
Well, Appender is not string specific.
D feels like being in a different
On 11/15/2013 02:35 PM, Jacek Furmankiewicz wrote:
Programming in D PDF and he did not show this in his initial chapter on
Strings.
Sorry about that. :)
As I was targeting novices to programming, I tried to give as much as
needed but as little as possible, so that the reader would not be
Thanks for the book! I printed it, all 673 pages of it. Immense
work you have there.
Have you any tips for using D when you need fast string
concatenation? I regularly use code like this:
foreach (i, range)
{
foo ~= bar;
}
or:
foo = foo ~ bar ~ baz ~ qux;
I've used std.string.format(...) in some instances which sped
things up which surprised me
On Friday, 21 June 2013 at 10:09:10 UTC, Gary Willoughby wrote:
Are there faster ways of appending strings?
You'll want to use appender, from std.array:
http://dlang.org/phobos/std_array.html#.Appender
On Friday, June 21, 2013 12:09:09 Gary Willoughby wrote:
Have you any tips for using D when you need fast string
concatenation? I regularly use code like this:
foreach (i, range)
{
foo ~= bar;
}
or:
foo = foo ~ bar ~ baz ~ qux;
I've used
On Friday, 21 June 2013 at 10:09:10 UTC, Gary Willoughby wrote:
Have you any tips for using D when you need fast string
concatenation? I regularly use code like this:
foreach (i, range)
{
foo ~= bar;
}
or:
foo = foo ~ bar ~ baz ~ qux;
I've used std.string.format
On Friday, 21 June 2013 at 11:33:29 UTC, monarch_dodra wrote:
On Friday, 21 June 2013 at 10:09:10 UTC, Gary Willoughby wrote:
Have you any tips for using D when you need fast string
concatenation? I regularly use code like this:
foreach (i, range)
{
foo ~= bar;
}
or:
foo
1 - 100 of 122 matches
Mail list logo