summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2026-09-24 17:58:27 -0400
committerMica White <botahamec@outlook.com>2026-09-24 17:58:27 -0400
commit886bcc6b7ddaabb020de392acf3528b182bd0973 (patch)
tree043808d2d615d97a73f71c8e018a41e0737dc916
parentdae78db343fe00b76956ce2a798fa2cce7d2c58c (diff)
Stuff
-rwxr-xr-xJustfile2
-rwxr-xr-xbuild.py35
-rwxr-xr-xindex.html36
-rw-r--r--src/blog/named-optional-args.kuht27
-rwxr-xr-xsrc/index.kuht1
5 files changed, 20 insertions, 51 deletions
diff --git a/Justfile b/Justfile
index 5b08091..d491dfb 100755
--- a/Justfile
+++ b/Justfile
@@ -1,3 +1,3 @@
sync:
python3 build.py3
- rsync -azvP 'target/' botahamec@botahamec.dev:/var/www/botahamec.dev
+ tar -cz 'target/' | ssh botahamec@botahamec.dev tar -C /var/www/botahamec.dev -xz
diff --git a/build.py3 b/build.py3
index 03c4cb5..8adc039 100755
--- a/build.py3
+++ b/build.py3
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-import brotli
import gzip
import os
import shutil
+import brotli
+
def clean_target():
if os.path.exists('target'):
@@ -37,7 +37,6 @@ def compress_files(path: str):
compress_files(file)
return
- base, ext = os.path.splitext(file)
with open(file, 'rb') as f_in:
data = f_in.read()
with gzip.open(f"{file}.gz", 'wb') as f_out:
diff --git a/index.html b/index.html
deleted file mode 100755
index 0ce371f..0000000
--- a/index.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <title>Botahamec's Website</title>
- <link href="/style.css" rel="stylesheet" />
- <link href="/style-light.css" rel="stylesheet" title="Default Style" />
- <link href="/style-dark.css" rel="alternate stylesheet" title="Dark Mode" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="description" content="All of Bota's projects and endeavors" />
- <meta charset="utf-8" />
- </head>
- <body>
- <header><h1>Botahamec</h1></header>
-
- <p>
- 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.
- </p>
-
- <h2>Projects</h2>
- <ul>
- <li><a href="https://www.github.com/botahamec/happylock">HappyLock</a></li>
- <li><a href="https://www.github.com/botahamec/exun">Exun</a></li>
- <li><a href="https://www.github.com/botahamec/snob">Snob</a></li>
- </ul>
-
- <h2>Blog</h2>
- <ul>
- <li><a href="/blog/how-happylock-works.html">How HappyLock Works</a></li>
- <li><a href="/blog/best-tool-for-the-job.html">The Best Tool for the Job</a></li>
- <li><a href="/blog/an-inheritance-detox.html">An Inheritance Detox</a></li>
- <li><a href="/blog/try-catch-in-rust.html">Introducing try-catch to Rust</a></li>
- <li><a href="/blog/comments-at-end.html">Comments at the End</a></li>
- </ul>
- </body>
-</html>
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.
</p>
@@ -991,8 +991,7 @@ trait Trait {
impl Trait for () {
// This is okay, because the parameter names match
- // unused parameter warnings can be ignored using @
- fn f(pub a: i32, pub b @ _: i32) {}
+ fn f(pub a: i32, pub b: i32) {}
}
impl Trait for i32 {
@@ -1079,7 +1078,7 @@ CallParams = CallParam ( "," CallParam )* ","?
FunctionParamPattern = "pub" pat:IdentifierPattern ":" ( ty:Type | "..." ) ( "=" expr:Expr )
</pre>
-<p>similar rules to the rules for default field values apply. Namely,</p>
+<p>Similar rules to the rules for default field values apply. Namely,</p>
<ul>
<li>
If the function is <code>const</code>, then the expression, <code>expr</code>
@@ -1114,11 +1113,7 @@ foo::&lt;T>();
placed on a <code>FunctionParam</code>, it also applies to the expression,
<code>expr</code>.
</li>
- <li>
- Unused parameter names will not emit a warning if they are bound to a
- different pattern using <code>@</code>. The bound pattern may still emit a
- warning
- </li>
+ <li>Unused parameter names will not emit a warning.</li>
</ul>
<p>
@@ -1253,8 +1248,8 @@ coordinates(y, x);
<p>
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.
</p>
@@ -1518,6 +1513,16 @@ enableFlags(bold: true)
<h3>Future possibilities</h3>
+<h4>Default parameter values for non-public parameters</h4>
+
+<p>
+ 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.
+</p>
+
<h4>Default parameter values for trait methods</h4>
<p>
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 @@
<li><a href="/blog/datetime.html">Comparing Date Types Across Languages</a></li>
<li><a href="/blog/color-spaces.html">Color Spaces</a></li>
<li><a href="/blog/git-plugins.html">Make Yourself Some Git Plugins</a></li>
+ <li><a href="/blog/named-optional-args.html">Named and Optional Arguments are Awesome</a></li>
</ul>
</body>