Elektrine lite

← Feed

@jplatte@social.tchncs.de

Post #525951

2026-02-14 22:22 UTC

I wrote a thing (Pre-RFC for the Rust programming language): https://internals.rust-lang.org/t/pre-rfc-function-parameter-defaults/24011/1 #rustlang

Replies (3)

  • @jplatte@social.tchncs.de is this secretly function overloading?

    Open ##2218775

  • @roguelazer@hachyderm.io 2026-02-15 04:36

    @jplatte@social.tchncs.de Do you think the default should actually be evaluated in a const context at build time (and then... cloned on every invocation)? Should it be a thunk that gets called at function call time? Something else? Does the answer change for const fn versus fn? What is in scope when it's evaluated?

    Open ##2218779

  • @calisti@chaos.social 2026-02-16 10:18

    @jplatte@social.tchncs.de Default argument values soon make wishes for call-site named parameters heard – as a means to provide only some out of a number of arguments, without needing to specify default values explicitly just because they appear earlier in the argument list than the one argument diverging from defaults. Would that be in scope? I find the two to be a tight couple.

    Open ##2218783