On Wednesday, 17 November 2021 at 18:00:59 UTC, Steven
Schveighoffer wrote:
On 11/17/21 7:55 AM, Vitalii wrote:
[...]
Template parameters are of 3 types:
1. A type parameter. This has a single symbol name, and
represents a type *provided by the caller*.
[...]
Steve, thank you very much
On Thursday, 18 November 2021 at 01:28:47 UTC, jfondren wrote:
On Thursday, 18 November 2021 at 01:21:00 UTC, pascal111 wrote:
I fixed the code like this and it worked without breaking
words, but this time it shows single lines as if the normal
context is a poem. Can we fix this or the
On Thursday, 18 November 2021 at 01:21:00 UTC, pascal111 wrote:
I fixed the code like this and it worked without breaking
words, but this time it shows single lines as if the normal
context is a poem. Can we fix this or the terminal will force
us and make wrapping for lines?
On Thursday, 18 November 2021 at 00:42:49 UTC, Ali Çehreli wrote:
On 11/17/21 3:46 PM, pascal111 wrote:
> I made small program that shows the content of textual files,
and it
> succeeded to show non-English (Ascii code) language, but in
many lines
> some words are not complete and their rests
On Wednesday, 17 November 2021 at 03:21:34 UTC, Ali Çehreli wrote:
On 11/16/21 6:10 PM, pascal111 I think 'med' is by Walter
Bright; he uses that editor daily.
Ali
Med is too simple,just for learn.
Actually, it's best to program with `VIM`,kinds of plugin.
I've been saying that D we should
On Thu, Nov 18, 2021 at 12:39:12AM +, jfondren via Digitalmars-d-learn
wrote:
[...]
> If what you're wanting to do is to *reshape* text so that it prints
> with proper word-breaks across lines according to the current size of
> the terminal, then you've got to do this work yourself.
[...]
On 11/17/21 3:46 PM, pascal111 wrote:
> I made small program that shows the content of textual files, and it
> succeeded to show non-English (Ascii code) language, but in many lines
> some words are not complete and their rests are in next lines, how can
> fix it?
D assumes UTF-8 encoding by
On Wednesday, 17 November 2021 at 23:46:15 UTC, pascal111 wrote:
I made small program that shows the content of textual files,
and it succeeded to show non-English (Ascii code) language, but
in many lines some words are not complete and their rests are
in next lines, how can fix it?
there's
I made small program that shows the content of textual files, and
it succeeded to show non-English (Ascii code) language, but in
many lines some words are not complete and their rests are in
next lines, how can fix it?
"https://i.postimg.cc/rpP7dQYH/Screenshot-from-2021-11-18-01-40-43.png;
On Wednesday, 17 November 2021 at 20:49:22 UTC, Dr Machine Code
wrote:
On Wednesday, 17 November 2021 at 03:21:34 UTC, Ali Çehreli
wrote:
On 11/16/21 6:10 PM, pascal111 wrote:
Is there a so simple text editor written in D as an example
for learners. I hope the editor whose code is written in D
On Wednesday, 17 November 2021 at 21:37:01 UTC, Ali Çehreli wrote:
On 11/17/21 12:49 PM, Dr Machine Code wrote:
>> I think 'med' is by Walter Bright; he uses that editor daily.
>>
>> Ali
>
> It's a emacs' variant written in D?
Yes. The dub page explains that the original author is Dave G.
On 11/17/21 12:49 PM, Dr Machine Code wrote:
>> I think 'med' is by Walter Bright; he uses that editor daily.
>>
>> Ali
>
> It's a emacs' variant written in D?
Yes. The dub page explains that the original author is Dave G. Conroy.
med is written by Walter and is his favorite editor. (I should
On Wednesday, 17 November 2021 at 03:21:34 UTC, Ali Çehreli wrote:
On 11/16/21 6:10 PM, pascal111 wrote:
Is there a so simple text editor written in D as an example
for learners. I hope the editor whose code is written in D is
available with someone.
I am not familiar with any of them but
On Wednesday, 17 November 2021 at 02:10:07 UTC, pascal111 wrote:
Is there a so simple text editor written in D as an example for
learners. I hope the editor whose code is written in D is
available with someone.
Probably not what you really want but this old post has a cute
sample program
On 11/17/21 7:55 AM, Vitalii wrote:
Thank you for response, Tejas!
What I intended to do was make a class with only two states ("Inspect" -
do some analysis, "Execute" - do some stuff). That's why I tried to use
template specialization.
Template parameters are of 3 types:
1. A type
On Wed, Nov 17, 2021 at 11:12:22AM +, rempas via Digitalmars-d-learn wrote:
> On Tuesday, 16 November 2021 at 21:30:08 UTC, H. S. Teoh wrote:
> >
> > Short answer: a template called with the same CT arguments will only
> > be instantiated once, and reused thereafter.
> >
> > Long answer: the
On Wednesday, 17 November 2021 at 14:51:58 UTC, Abby wrote:
Hello I would like to create validation mixin or mixin template
which would return on error.
Something like this:
```
mixin template Validate(a, b)
{
if(a > b)
{
writeln("invalid input");
return false;
}
}
On Wednesday, 17 November 2021 at 15:12:50 UTC, Tejas wrote:
On Wednesday, 17 November 2021 at 14:51:58 UTC, Abby wrote:
Hello I would like to create validation mixin or mixin
template which would return on error.
Something like this:
```
mixin template Validate(a, b)
{
if(a > b)
{
On Wednesday, 17 November 2021 at 14:51:58 UTC, Abby wrote:
Hello I would like to create validation mixin or mixin template
which would return on error.
Something like this:
```
mixin template Validate(a, b)
{
if(a > b)
{
writeln("invalid input");
return false;
}
}
Hello I would like to create validation mixin or mixin template
which would return on error.
Something like this:
```
mixin template Validate(a, b)
{
if(a > b)
{
writeln("invalid input");
return false;
}
}
bool test(a,b)
{
mixin Validate!(a,b);
on
Thanks guys, it is very clear now.
On Wednesday, 17 November 2021 at 12:55:15 UTC, Vitalii wrote:
Thank you for response, Tejas!
What I intended to do was make a class with only two states
("Inspect" - do some analysis, "Execute" - do some stuff).
That's why I tried to use template specialization.
The following code compiles
You can use the string type to hold non-ascii characters. Just a
substring of another string.
Thank you for response, Tejas!
What I intended to do was make a class with only two states
("Inspect" - do some analysis, "Execute" - do some stuff). That's
why I tried to use template specialization.
The following code compiles successfully, but return *"fun with
unknown"* instead of *"fun
On Wednesday, 17 November 2021 at 12:19:05 UTC, Tejas wrote:
On Wednesday, 17 November 2021 at 10:10:43 UTC, Vitalii wrote:
Hello! I am getting the following error:
```
inst.d(8): Error: template instance `Worker!(Mode.Inspect)`
does not match template declaration `Worker(mode : Mode)
```
On Wednesday, 17 November 2021 at 10:10:43 UTC, Vitalii wrote:
Hello! I am getting the following error:
```
inst.d(8): Error: template instance `Worker!(Mode.Inspect)`
does not match template declaration `Worker(mode : Mode)
```
when compile next code:
```
enum Mode { Inspect, Execute }
On Tuesday, 16 November 2021 at 21:30:08 UTC, H. S. Teoh wrote:
Short answer: a template called with the same CT arguments will
only be instantiated once, and reused thereafter.
Long answer: the above applies per compilation. If you compile
your sources separately, there may be multiple
On Wednesday, 17 November 2021 at 02:50:43 UTC, Mike Parker wrote:
You might find this useful:
https://dlang.org/blog/2020/07/31/the-abcs-of-templates-in-d/
I do! Thanks a lot!
Hello! I am getting the following error:
```
inst.d(8): Error: template instance `Worker!(Mode.Inspect)` does
not match template declaration `Worker(mode : Mode)
```
when compile next code:
```
enum Mode { Inspect, Execute }
class Worker(mode : Mode) {
this() {}
}
void main() {
29 matches
Mail list logo