From 886bcc6b7ddaabb020de392acf3528b182bd0973 Mon Sep 17 00:00:00 2001
From: Mica White
- Hi. This is a website I threw together quickly so that I could write my blog post. It's not
- much right now. But you should read my blog posts anyway.
- Botahamec
Projects
-
-
- Blog
-
-
-
diff --git a/src/blog/named-optional-args.kuht b/src/blog/named-optional-args.kuht
index 7d36972..874ea57 100644
--- a/src/blog/named-optional-args.kuht
+++ b/src/blog/named-optional-args.kuht
@@ -654,7 +654,7 @@ split("hello world", .at = ' ', .limit = 2, .case_sensitive = true);
will satisfy as many people as possible. I'll monitor the comments anywhere
this gets posted to see if there are any major criticisms. I can't guarantee
that I'll actually make an RFC, but permission is granted to create an RFC if
- I don't. I think it's been a while since named argument were last seriously
+ I don't. I think it's been a while since named arguments were last seriously
proposed, so I think now is a good time for a new proposal.
similar rules to the rules for default field values apply. Namely,
+Similar rules to the rules for default field values apply. Namely,
const, then the expression, expr
@@ -1114,11 +1113,7 @@ foo::<T>();
placed on a FunctionParam, it also applies to the expression,
expr.
@. The bound pattern may still emit a
- warning
- @@ -1253,8 +1248,8 @@ coordinates(y, x);
Although many languages, such as Kotlin and C#, allow any argument to be - named, this is not practical for Rust. Changing an argument is currently not - a breaking change, but would become one as soon as named arguments are + named, this is not practical for Rust. Changing an argument name is currently + not a breaking change, but would become one as soon as named arguments are introduced. The solution is to allow authors to decide if their argument names are an implementation detail or not.
@@ -1518,6 +1513,16 @@ enableFlags(bold: true)+ In this proposal, only public parameters can have default values. Optional + named parameters are much more flexible than optional positional parameters, + but many languages do still support optional positional arguments. It's not + hard to imagine extending this proposal to positional arguments, although the + use-case would be more limited. +
+diff --git a/src/index.kuht b/src/index.kuht index 89e15d3..e5ae437 100755 --- a/src/index.kuht +++ b/src/index.kuht @@ -30,5 +30,6 @@