Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 27, 2019 CTFE in Rust nighties | ||||
---|---|---|---|---|
| ||||
https://blog.rust-lang.org/inside-rust/2019/11/25/const-if-match.html |
November 27, 2019 Re: CTFE in Rust nighties | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arun Chandrasekaran | On Wednesday, 27 November 2019 at 06:29:14 UTC, Arun Chandrasekaran wrote:
> https://blog.rust-lang.org/inside-rust/2019/11/25/const-if-match.html
Shouldn't they introduce a keyword like "static if" in D. Right now it will compiles regardless if it can be evaluated during compile time or not, the user will not know. As explicit Rust is, they should add an explicit compile time version of the if and match statements as well.
|
November 27, 2019 Re: CTFE in Rust nighties | ||||
---|---|---|---|---|
| ||||
Posted in reply to IGotD- | On Wednesday, 27 November 2019 at 07:34:39 UTC, IGotD- wrote:
> On Wednesday, 27 November 2019 at 06:29:14 UTC, Arun Chandrasekaran wrote:
>> https://blog.rust-lang.org/inside-rust/2019/11/25/const-if-match.html
>
> Shouldn't they introduce a keyword like "static if" in D. Right now it will compiles regardless if it can be evaluated during compile time or not, the user will not know. As explicit Rust is, they should add an explicit compile time version of the if and match statements as well.
They do, const and static contexts.
|
November 27, 2019 Re: CTFE in Rust nighties | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | On Wednesday, 27 November 2019 at 07:46:40 UTC, Paulo Pinto wrote:
>
> They do, const and static contexts.
Ok, they solve it that way. If a function is declared const, can you feed it with run time parameters as well? If so, what is the point of declaring the function const?
|
November 27, 2019 Re: CTFE in Rust nighties | ||||
---|---|---|---|---|
| ||||
Posted in reply to IGotD- | On Wednesday, 27 November 2019 at 08:46:08 UTC, IGotD- wrote:
> On Wednesday, 27 November 2019 at 07:46:40 UTC, Paulo Pinto wrote:
>>
>> They do, const and static contexts.
>
> Ok, they solve it that way. If a function is declared const, can you feed it with run time parameters as well? If so, what is the point of declaring the function const?
I assume same as C++ constexpr, so that APIs are stable even if the implementation changes.
|
Copyright © 1999-2021 by the D Language Foundation