On Saturday, 7 January 2023 at 02:31:14 UTC, Ali Çehreli wrote:
On 1/6/23 17:50, Arredondo wrote:
> Would anyone volunteer to file a bug report?
Me! Me! :)
https://issues.dlang.org/show_bug.cgi?id=23604
Ali
Thanks a lot :D
Arredondo.
On 1/6/23 17:50, Arredondo wrote:
> Would anyone volunteer to file a bug report?
Me! Me! :)
https://issues.dlang.org/show_bug.cgi?id=23604
Ali
On Saturday, 7 January 2023 at 00:52:20 UTC, Ali Çehreli wrote:
Although that difference is a bug, iota does have a special
floating point implementation to prevent the accumulation of
floating point errors.
Thank you for this clarification Ali. I appreciate the fact that
there is a
On 1/6/23 15:23, Arredondo wrote:
> then you get an exception (incorrect startup parameters).
Although that difference is a bug, iota does have a special floating
point implementation to prevent the accumulation of floating point
errors. I mention it as item 4 here:
Consider:
```
import std.range.iota;
auto r = iota(5, 0);
```
`r` is an empty range, as it should be. But if you call:
```
auto r = iota(5.0, 0);
```
then you get an exception (incorrect startup parameters).
This was unexpected, and a pain to debug. What is the rationale
behind iota having
for development purposes. is there are correct way to somehow
(partially or complete) override druntime and phobos? or, maybe,
some code injection/patching mechanisms during compilation of own
code.
On Friday, 4 November 2022 at 08:48:36 UTC, Salih Dincer wrote:
On Thursday, 3 November 2022 at 11:58:20 UTC, Paul Backus wrote:
On Thursday, 3 November 2022 at 06:26:22 UTC, Salih Dincer
Looking at the source, it seems that only the numeric
overloads of `iota` implement `save`. I think this
On Thursday, 3 November 2022 at 11:58:20 UTC, Paul Backus wrote:
On Thursday, 3 November 2022 at 06:26:22 UTC, Salih Dincer
Looking at the source, it seems that only the numeric overloads
of `iota` implement `save`. I think this is probably just an
oversight, though, since I can't see any
On 11/3/22 04:58, Paul Backus wrote:
> https://issues.dlang.org/show_bug.cgi?id=23453
Even though iterating over UTF value ranges don't make sense in general,
they would work for some values including the ASCII range.
Ali
On Thursday, 3 November 2022 at 06:26:22 UTC, Salih Dincer wrote:
Hi All,
Isn't there a save feature for `iota()`?
Looking at the source, it seems that only the numeric overloads
of `iota` implement `save`. I think this is probably just an
oversight, though, since I can't see any reason why
Hi All,
Isn't there a save feature for `iota()`?
```d
import std.stdio;
import std.range;
void main()
{
foreach(num; iota!char('a', 'f').chunks(3)/*
"onetwosixfour".chunks(3)//*/
) {
//auto n = num.save();
num.writeln(": &q
On Saturday, 14 August 2021 at 08:23:20 UTC, user1234 wrote:
On Saturday, 14 August 2021 at 04:09:34 UTC, Tejas wrote:
[...]
Oh right, the ```.``` operator will reference variable in the
_module_ scope, not just the _immediate outer scope_,
you can use the module name to disambiguate as
On Saturday, 14 August 2021 at 04:09:34 UTC, Tejas wrote:
[...]
Oh right, the ```.``` operator will reference variable in the
_module_ scope, not just the _immediate outer scope_,
you can use the module name to disambiguate as well. To extend
Mike answer, the general rule is that if you can
On Saturday, 14 August 2021 at 04:01:31 UTC, Mike Parker wrote:
On Saturday, 14 August 2021 at 03:47:05 UTC, Tejas wrote:
```d
import std;
auto abc(T)(auto ref T a, auto ref T b){
return a+b;
}
auto def(T)(auto ref T a, auto ref T b){
return a*b;
}
alias macro_1 = abc;
void main()
On Saturday, 14 August 2021 at 03:47:05 UTC, Tejas wrote:
```d
import std;
auto abc(T)(auto ref T a, auto ref T b){
return a+b;
}
auto def(T)(auto ref T a, auto ref T b){
return a*b;
}
alias macro_1 = abc;
void main()
{
writeln(macro_1(15, 20));
alias macro_1 = def;// is
```d
import std;
auto abc(T)(auto ref T a, auto ref T b){
return a+b;
}
auto def(T)(auto ref T a, auto ref T b){
return a*b;
}
alias macro_1 = abc;
void main()
{
writeln(macro_1(15, 20));
alias macro_1 = def;// is this NOT considered variable
shadowing?
On Tuesday, 3 August 2021 at 10:28:53 UTC, Rekel wrote:
On Tuesday, 3 August 2021 at 00:53:43 UTC, user1234 wrote:
You got the answer in another reply but here is a bit of more
fun:
```d
void main() {
return cast(void) 1;
}
```
What does casting to void do? Does it just ignore whatever
On Tuesday, 3 August 2021 at 00:53:43 UTC, user1234 wrote:
You got the answer in another reply but here is a bit of more
fun:
```d
void main() {
return cast(void) 1;
}
```
What does casting to void do? Does it just ignore whatever
follows it?
On Tuesday, 3 August 2021 at 07:23:34 UTC,
On Monday, 2 August 2021 at 14:46:36 UTC, jfondren wrote:
On Monday, 2 August 2021 at 14:31:45 UTC, Rekel wrote:
[...]
I don't know where you can find this in the docs, but what
doesn't seem trivial about it? The type of the expression
`print()` is void. That's the type that `doSomething`
On Monday, 2 August 2021 at 14:31:45 UTC, Rekel wrote:
I recently found one can return function calls to void
functions, though I don't remember any documentation mentioning
this even though it doesn't seem trivial.
[...]
If this is intended, where could I find this in the docs? I
haven't
On Mon, Aug 02, 2021 at 04:42:14PM +, Rekel via Digitalmars-d-learn wrote:
[...]
> Also slightly off topic, but when would one use an alias instead of a
> function/delegate? I haven't used aliases before.
When you want a compile-time binding that could potentially elide the
indirect function
On 8/2/21 9:42 AM, Rekel wrote:
> when would one use an alias instead of a
> function/delegate? I haven't used aliases before.
alias will match both functions and delegates... and... any symbol at
all. So, if you don't have a reason to constain the user, callable
template parameters are most
On Monday, 2 August 2021 at 14:51:07 UTC, H. S. Teoh wrote:
This is intentional, in order to make it easier to write
generic code without always having to special-case functions
that don't return anything.
Ooh that indeed seems useful. Thanks for the hint.
Also slightly off topic, but when
On Monday, 2 August 2021 at 14:46:36 UTC, jfondren wrote:
C, C++, Rust, and Zig are all fine with this. Nim doesn't like
it.
I had no clue, never seen it used in any case. I've always
assumed one couldn't return void as it's not a value. I guess
intuitions aren't always universal . Good to
On Mon, Aug 02, 2021 at 02:31:45PM +, Rekel via Digitalmars-d-learn wrote:
> I recently found one can return function calls to void functions,
> though I don't remember any documentation mentioning this even though
> it doesn't seem trivial.
This is intentional, in order to make it easier to
On Monday, 2 August 2021 at 14:31:45 UTC, Rekel wrote:
I recently found one can return function calls to void
functions, though I don't remember any documentation mentioning
this even though it doesn't seem trivial.
```d
void print(){
writeln("0");
}
void doSomething(int a){
I recently found one can return function calls to void functions,
though I don't remember any documentation mentioning this even
though it doesn't seem trivial.
```d
void print(){
writeln("0");
}
void doSomething(int a){
if (a==0)
return print();
On Saturday, 14 December 2019 at 10:32:10 UTC, berni44 wrote:
On Saturday, 14 December 2019 at 09:33:13 UTC, Tobias Pankrath
wrote:
See: https://dlang.org/spec/lex.html#integerliteral
What I am aiming at: Is the spec wrong or am I
misunderstanding it and did this change recently?
You are
On Saturday, 14 December 2019 at 09:33:13 UTC, Tobias Pankrath
wrote:
See: https://dlang.org/spec/lex.html#integerliteral
What I am aiming at: Is the spec wrong or am I misunderstanding
it and did this change recently?
You are right. The implementation does not do what the specs tell
here.
On Saturday, 14 December 2019 at 07:44:37 UTC, berni44 wrote:
On Saturday, 14 December 2019 at 07:09:30 UTC, Tobias Pankrath
wrote:
void main()
{
auto x = 9223372036854775808; // long.max + 1
}
You need to tell, that this is an unsigned long literal, else
the compiler treats it as an
On Saturday, 14 December 2019 at 07:09:30 UTC, Tobias Pankrath
wrote:
void main()
{
auto x = 9223372036854775808; // long.max + 1
}
You need to tell, that this is an unsigned long literal, else the
compiler treats it as an int:
void main()
{
auto x = 9223372036854775808UL; //
void main()
{
auto x = 9223372036854775808; // long.max + 1
}
onlineapp.d(3): Error: signed integer overflow
According to spec x should be of type ulong and this should
compile? It indeed compiles if I add the uL postfix.
Is this a bug or indented behaviour?
On Wednesday, 30 October 2019 at 20:22:25 UTC, Q. Schroll wrote:
struct Example
{
private void helper(int i, this X)() { }
void funcTempl(T, this X)(T value)
{
this.helper!0();
// ^ Why do I need this?
}
}
void main()
{
auto ex = Example();
struct Example
{
private void helper(int i, this X)() { }
void funcTempl(T, this X)(T value)
{
this.helper!0();
// ^ Why do I need this?
}
}
void main()
{
auto ex = Example();
ex.funcTempl(1);
}
The question is in the comment in the code. Is that
On Friday, August 16, 2019 2:16:31 AM MDT Piotr Mitana via Digitalmars-d-
learn wrote:
> On Thursday, 15 August 2019 at 19:51:30 UTC, Jonathan M Davis
>
> wrote:
> > Not being able to implicitly convert to const is a bit odd, but
> > arguably, nothing should ever be called on a shared AA anyway.
>
On Thursday, 15 August 2019 at 19:51:30 UTC, Jonathan M Davis
wrote:
Not being able to implicitly convert to const is a bit odd, but
arguably, nothing should ever be called on a shared AA anyway.
If an operation isn't thread-safe, then it shouldn't work with
shared. To use a shared object
On Thursday, 15 August 2019 at 19:51:30 UTC, Jonathan M Davis
wrote:
n Thursday, August 15, 2019 11:33:06 AM MDT Piotr Mitana via
Digitalmars-d- learn wrote:
Code:
import std;
shared(string[string]) dict;
void main()
{
dict.keys;
}
Error:
n Thursday, August 15, 2019 11:33:06 AM MDT Piotr Mitana via Digitalmars-d-
learn wrote:
> Code:
>
> import std;
>
> shared(string[string]) dict;
>
> void main()
> {
> dict.keys;
> }
>
> Error:
>
> /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(3417):
> Error: cannot implicitly
Code:
import std;
shared(string[string]) dict;
void main()
{
dict.keys;
}
Error:
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(3417):
Error: cannot implicitly convert expression aa of type
shared(string[string]) to const(shared(string)[string])
onlineapp.d(7): Error:
On Fri, 2019-05-03 at 14:07 -0700, H. S. Teoh via Digitalmars-d-learn wrote:
>
[…]
> The problem is that while there is no shortage of complaints about XML
> support in D, there is a great dearth of people actually willing to *do*
> something about it.
In my case it is because I have no need to
On Friday, 3 May 2019 at 21:07:29 UTC, H. S. Teoh wrote:
On Fri, May 03, 2019 at 09:56:56PM +0100, Russel Winder via
Digitalmars-d-learn wrote:
On Thu, 2019-05-02 at 09:28 -0700, H. S. Teoh via
Digitalmars-d-learn wrote:
> On Thu, May 02, 2019 at 05:23:29PM +0100, Russel Winder via
>
On Fri, May 03, 2019 at 09:56:56PM +0100, Russel Winder via Digitalmars-d-learn
wrote:
> On Thu, 2019-05-02 at 09:28 -0700, H. S. Teoh via Digitalmars-d-learn
> wrote:
> > On Thu, May 02, 2019 at 05:23:29PM +0100, Russel Winder via
> > Digitalmars-d-learn wrote:
> > [...]
> > > There are
On Thu, 2019-05-02 at 09:28 -0700, H. S. Teoh via Digitalmars-d-learn
wrote:
> On Thu, May 02, 2019 at 05:23:29PM +0100, Russel Winder via
> Digitalmars-d-learn wrote:
> [...]
> > There are situations where you create a binding in preference to
> > writing something from scratch. cf. gtk,
On 03/05/2019 4:23 AM, Russel Winder wrote:
On Fri, 2019-05-03 at 03:50 +1200, rikki cattermole via Digitalmars-d-
learn wrote:
On 03/05/2019 3:36 AM, Russel Winder wrote:
[…]
libxml2 is definitely usable from Python, it must be usable from D.
Of
course, I am assuming libxml2 has the
On Thursday, 2 May 2019 at 15:50:53 UTC, rikki cattermole wrote:
On 03/05/2019 3:36 AM, Russel Winder wrote:
On Thu, 2019-05-02 at 02:11 +1200, rikki cattermole via
Digitalmars-d-
learn wrote:
[…]
It does not. Those features come under the big bad guys
feature list.
Gonna have to go to C
On Thu, May 02, 2019 at 05:23:29PM +0100, Russel Winder via Digitalmars-d-learn
wrote:
[...]
> There are situations where you create a binding in preference to
> writing something from scratch. cf. gtk, gstreamer, etc. so why not
> libxml2?
[...]
No particular reason, except nobody has taken up
On Fri, 2019-05-03 at 03:50 +1200, rikki cattermole via Digitalmars-d-
learn wrote:
> On 03/05/2019 3:36 AM, Russel Winder wrote:
> >
[…]
> > libxml2 is definitely usable from Python, it must be usable from D.
> > Of
> > course, I am assuming libxml2 has the facilities required.
>
> libxml2 is
On 03/05/2019 3:36 AM, Russel Winder wrote:
On Thu, 2019-05-02 at 02:11 +1200, rikki cattermole via Digitalmars-d-
learn wrote:
[…]
It does not. Those features come under the big bad guys feature list.
Gonna have to go to C for it.
Surely that means you can use Python, Rust, C++, or D
On Thu, 2019-05-02 at 02:11 +1200, rikki cattermole via Digitalmars-d-
learn wrote:
[…]
>
> It does not. Those features come under the big bad guys feature list.
>
> Gonna have to go to C for it.
Surely that means you can use Python, Rust, C++, or D rather than
having to descen
ude;>
Have you looked at this?
https://github.com/jmdavis/dxml
Yes, but I don't think dxml support these features.
It does not. Those features come under the big bad guys feature list.
Gonna have to go to C for it.
On Wednesday, 1 May 2019 at 13:57:04 UTC, bachmeier wrote:
On Wednesday, 1 May 2019 at 13:54:08 UTC, Domain wrote:
I need a xml library which support document entity or xinclude.
The xml may like this:
]>
http://www.w3.org/2001/XInclude;>
Have you looked at this?
On Wednesday, 1 May 2019 at 13:54:08 UTC, Domain wrote:
I need a xml library which support document entity or xinclude.
The xml may like this:
]>
http://www.w3.org/2001/XInclude;>
Have you looked at this?
https://github.com/jmdavis/dxml
I need a xml library which support document entity or xinclude.
The xml may like this:
]>
http://www.w3.org/2001/XInclude;>
On Tuesday, 28 August 2018 at 20:58:23 UTC, Alex wrote:
Isn't the problem, that inside a template a declaration is
expected, and not a foreach?
Boh, you're right. I guess I misunderstood mixin templates. Found
a way with a normap function though :p
void mapSelf(alias self, alias aa)()
On Tuesday, 28 August 2018 at 20:39:16 UTC, aliak wrote:
Hi,
I'm trying to do something similar to what Kotlin allows with
assigning to member variables from a map. The syntax is very
readable and looks like:
class User(val map: Map) {
val name: String by map
val age: Int by map
Hi,
I'm trying to do something similar to what Kotlin allows with
assigning to member variables from a map. The syntax is very
readable and looks like:
class User(val map: Map) {
val name: String by map
val age: Int by map
}
So I'm trying to do something similar in D:
mixin
On Thursday, May 10, 2018 11:52:38 Piotr Mitana via Digitalmars-d-learn
wrote:
> Given this code:
>
> abstract class A
> {
> package @property void x(int x);
> package @property int x();
> }
>
> class B : A
> {
> package @property override void x(int x) {}
> package @property
Given this code:
abstract class A
{
package @property void x(int x);
package @property int x();
}
class B : A
{
package @property override void x(int x) {}
package @property override int x() { return 0; }
}
void main() {}
I get the following message:
onlineapp.d(9): Error:
On 03/17/2018 11:36 AM, Jonathan wrote:
`(a+b)&0xff` What is this syntax?! Could you give a link to this in the
D documentation?
Here is my description of bitwise AND:
http://ddili.org/ders/d.en/bit_operations.html#ix_bit_operations.&,%20bitwise%20and
The section titled "Masking" on the
On Saturday, 17 March 2018 at 18:56:55 UTC, Dominikus Dittes
Scherkl wrote:
On Saturday, 17 March 2018 at 18:36:35 UTC, Jonathan wrote:
On Tuesday, 19 January 2016 at 23:36:14 UTC, Adam D. Ruppe
wrote:
On Tuesday, 19 January 2016 at 22:12:06 UTC, Soviet Friend
wrote:
I don't care if my
On Saturday, 17 March 2018 at 18:36:35 UTC, Jonathan wrote:
On Tuesday, 19 January 2016 at 23:36:14 UTC, Adam D. Ruppe
wrote:
On Tuesday, 19 January 2016 at 22:12:06 UTC, Soviet Friend
wrote:
I don't care if my computer needs to do math on a 4 byte
basis, I'm not writing assembly.
x86
On Tuesday, 19 January 2016 at 23:36:14 UTC, Adam D. Ruppe wrote:
On Tuesday, 19 January 2016 at 22:12:06 UTC, Soviet Friend
wrote:
I don't care if my computer needs to do math on a 4 byte
basis, I'm not writing assembly.
x86 actually doesn't need to do math that way, if you were
writing
it make sense to make
a table with feature names and corresponding name of the same
feature in other languages ?
Try this:
https://wiki.dlang.org/Programming_in_D_for_C%2B%2B_Programmers
... and potentially this: https://wiki.dlang.org/Coming_From
Those resources are community maintained
On Saturday, 23 December 2017 at 15:45:33 UTC, Mike Franklin
wrote:
On Saturday, 23 December 2017 at 15:04:30 UTC, kerdemdemir
wrote:
Is there any better way for me to search C/C++ equivalent
features? As a humble suggestion would it make sense to make a
table with feature names
On Saturday, 23 December 2017 at 15:04:30 UTC, kerdemdemir wrote:
Is there any better way for me to search C/C++ equivalent
features? As a humble suggestion would it make sense to make a
table with feature names and corresponding name of the same
feature in other languages ?
Try
ld it make sense to make a
table with feature names and corresponding name of the same
feature in other languages ?
Erdem
On Wednesday, 19 July 2017 at 16:00:56 UTC, Piotr Mitana wrote:
Hello, I have this code:
immutable class Base
{
this() {}
}
immutable class Derived : Base {}
void main()
{
new immutable Derived();
}
I'd like class Derived to automatically inherit the default
constructor from
On Wednesday, 19 July 2017 at 16:00:56 UTC, Piotr Mitana wrote:
Hello, I have this code:
immutable class Base
{
this() {}
}
immutable class Derived : Base {}
void main()
{
new immutable Derived();
}
I'd like class Derived to automatically inherit the default
constructor from
On Wednesday, 19 July 2017 at 16:00:56 UTC, Piotr Mitana wrote:
Hello, I have this code:
immutable class Base
{
this() {}
}
immutable class Derived : Base {}
void main()
{
new immutable Derived();
}
I'd like class Derived to automatically inherit the default
constructor from
Hello, I have this code:
immutable class Base
{
this() {}
}
immutable class Derived : Base {}
void main()
{
new immutable Derived();
}
I'd like class Derived to automatically inherit the default
constructor from Base. However, this is not the case:
main.d(6): Error: class
On Saturday, 13 May 2017 at 10:51:09 UTC, k-five wrote:
Okay, and NOW I understood what you are trying to say.
First of all I thought you got mad at me. And I became sad.
My sincere apologies! Always assume the best in people :-) I am
glad you asked for clarification.
[...] Still I am a
On Saturday, 13 May 2017 at 10:15:34 UTC, Bastiaan Veelo wrote:
On Saturday, 13 May 2017 at 08:23:55 UTC, k-five wrote:
[...]
OK understood.
[...]
I am sorry for expressing myself poorly. What I meant to say is
that it looked like you can write an interesting article about
your
On Saturday, 13 May 2017 at 08:23:55 UTC, k-five wrote:
On Friday, 12 May 2017 at 20:53:56 UTC, Bastiaan Veelo wrote:
Is it safe to say that these 40 lines of D do the same as your
324 lines of C++ [1]?
No. I cannot say that.
Since this is not a full port of renrem in C++ to D. It was
just
On Friday, 12 May 2017 at 20:53:56 UTC, Bastiaan Veelo wrote:
Is it safe to say that these 40 lines of D do the same as your
324 lines of C++ [1]?
No. I cannot say that.
Since this is not a full port of renrem in C++ to D. It was just
an example in D, nothing else.
This, and your comments
On Friday, 12 May 2017 at 21:26:01 UTC, Bastiaan Veelo wrote:
On Friday, 12 May 2017 at 15:24:52 UTC, k-five wrote:
A full version that I just added to my gitgub:
https://github.com/k-five/dren
You may like getopt[1] for command line argument parsing.
https://dlang.org/phobos/std_getopt.html
On Friday, 12 May 2017 at 15:24:52 UTC, k-five wrote:
A full version that I just added to my gitgub:
https://github.com/k-five/dren
You may like getopt[1] for command line argument parsing.
https://dlang.org/phobos/std_getopt.html
On Friday, 12 May 2017 at 15:24:52 UTC, k-five wrote:
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote:
I was waiting for a stable version of C++17 ( standard library
) to add some features of fileSystem in C++17 to my program
that wants to iterate through all files in a directory
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote:
I was waiting for a stable version of C++17 ( standard library
) to add some features of fileSystem in C++17 to my program
that wants to iterate through all files in a directory
recursively.
I was thinking how could I do for implementing
On Friday, 12 May 2017 at 12:56:50 UTC, drug wrote:
12.05.2017 14:58, k-five пишет:
On Friday, 12 May 2017 at 11:41:57 UTC, cym13 wrote:
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote:
---
also .each!writeln should be possible
12.05.2017 14:58, k-five пишет:
On Friday, 12 May 2017 at 11:41:57 UTC, cym13 wrote:
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote:
---
Shorter:
void main( string[] args ){
dirEntries( ".", SpanMode.depth, false )
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote:
I was waiting for a stable version of C++17 ( standard library
) to add some features of fileSystem in C++17 to my program
that wants to iterate through all files in a directory
recursively.
I was thinking how could I do for implementing
On Friday, 12 May 2017 at 11:58:23 UTC, k-five wrote:
On Friday, 12 May 2017 at 11:41:57 UTC, cym13 wrote:
[...]
---
[...]
-
Thanks and the correct syntax for each! is, passing a
On Friday, 12 May 2017 at 11:41:57 UTC, cym13 wrote:
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote:
---
Shorter:
void main( string[] args ){
dirEntries( ".", SpanMode.depth, false )
.filter!( file =>
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote:
I was waiting for a stable version of C++17 ( standard library
) to add some features of fileSystem in C++17 to my program
that wants to iterate through all files in a directory
recursively.
I was thinking how could I do for implementing
I was waiting for a stable version of C++17 ( standard library )
to add some features of fileSystem in C++17 to my program that
wants to iterate through all files in a directory recursively.
I was thinking how could I do for implementing that and add it to
my program.
Now after starting to
On Tuesday, March 08, 2016 14:56:06 Antonio Corbi via Digitalmars-d-learn
wrote:
> On Tuesday, 8 March 2016 at 14:13:17 UTC, Adam D. Ruppe wrote:
> > On Tuesday, 8 March 2016 at 13:40:06 UTC, Antonio Corbi wrote:
> >> Is it a feature or a bug?
> >
> > It is allo
On Tuesday, 8 March 2016 at 14:13:17 UTC, Adam D. Ruppe wrote:
On Tuesday, 8 March 2016 at 13:40:06 UTC, Antonio Corbi wrote:
Is it a feature or a bug?
It is allowed because the "auto" keyword doesn't actually
required for auto functions (or variables), what you need i
On Tuesday, 8 March 2016 at 13:40:06 UTC, Antonio Corbi wrote:
Is it a feature or a bug?
It is allowed because the "auto" keyword doesn't actually
required for auto functions (or variables), what you need is any
one of the storage classes.
Those include static, auto, const, immut
turn 1; }
static sbar () { return "hi!"; }
static ibar () { return 0; }
}
void main () {
auto b = new B;
writeln (B.sbar);
writeln (B.ibar);
}
-8><--------
Is it a feature or a bug?
I've seen it being used in
https://github.com/geck
On Thursday, 21 January 2016 at 14:39:43 UTC, Adam D. Ruppe wrote:
On Thursday, 21 January 2016 at 14:35:09 UTC, Sebastiaan Koppe
wrote:
static if (!is(SomethingUndefined!moreUndefined[0] :
UndefinedThing))
Yes, the is expression returns false for undefined things
because they aren't types.
module undefined;
unittest
{
static if (!is(SomethingUndefined!moreUndefined[0] :
UndefinedThing))
{
pragma(msg,"This will compile just fine!");
}
}
On Thursday, 21 January 2016 at 14:35:09 UTC, Sebastiaan Koppe
wrote:
static if (!is(SomethingUndefined!moreUndefined[0] :
UndefinedThing))
Yes, the is expression returns false for undefined things because
they aren't types. The standard library uses this in a lot of
places to test for
I just attempted to add one ubyte to another and store the result
in a ubyte but apparently ubytes get converted to ints when being
added... and converting what becomes an int becomes impossible to
store in a ubyte without an explicit cast...
ubyte a, b;
ubyte c = a + b; // Error: cannot
Soviet Friend píše v Út 19. 01. 2016 v 22:12 +:
> I just attempted to add one ubyte to another and store the result
> in a ubyte but apparently ubytes get converted to ints when being
> added... and converting what becomes an int becomes impossible to
> store in a ubyte without an explicit
On Tue, 19 Jan 2016 23:32:57 +0100, Daniel Kozak wrote:
> Soviet Friend píše v Út 19. 01. 2016 v 22:12 +:
>> I just attempted to add one ubyte to another and store the result in a
>> ubyte but apparently ubytes get converted to ints when being added...
>> and converting what becomes an int
On 01/19/2016 02:12 PM, Soviet Friend wrote:
> ubytes get converted to ints when being added...
It's a common feature involving all integral type in languages like C,
C++, and D:
https://dlang.org/spec/type.html#integer-promotions
> On the topic of complaining about casting...
On Tuesday, 19 January 2016 at 22:12:06 UTC, Soviet Friend wrote:
I don't care if my computer needs to do math on a 4 byte basis,
I'm not writing assembly.
x86 actually doesn't need to do math that way, if you were
writing assembly, it would just work. This is just an annoying
rule brought
On Tuesday, 10 November 2015 at 13:09:09 UTC, Fyodor Ustinov
wrote:
Hi!
Is it possible when using the "-release" indicate that this one
in/out/invariant/assert should not to be disabled?
WBR,
Fyodor.
Since assert(false) is special (cf.
I wouldn't recommend release mode to paranoids. I personally use
`debug invariant` and `debug assert` for purely debugging code.
On Tuesday, 10 November 2015 at 20:37:00 UTC, Fyodor Ustinov
wrote:
assert(false) AKA assert(0) - is a part of this language that I
think it is absolute evil.
WBR,
Fyodor.
I would say it's a minor evil, that create problems by needing an
explanation.
At this point it has been
1 - 100 of 202 matches
Mail list logo