Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Version 0.2.2

Choose a tag to compare

@penguinite penguinite released this 25 Mar 09:08
· 81 commits to main since this release
4936b31

It's not urgent for you to update to this release, although you should be aware that there is a chance of stuff breaking when you do. So with that knowledge in mind, either use v0.2.1 (because it's perfectly acceptable) or use v0.2.2 to fix the whole percentage sign mess.

Here is a list of changes for those who want a summary:

  1. Percentage signs procs are removed. (Most important change)
  2. The c() proc (and to an extent, setBulkKeys as well) have been re-written to be simpler to use (and simpler in terms of code)

Full Changelog: v0.2.1...v0.2.2

Be aware that upgrading to this release means you might have to update some code. Especially code that writes sequence values.
For example, here is a code block that used to work in 0.2.1:

table.setBulkKeys(
  c("hello","world","!"), # Strings
  c("favorite","people", %("John"), %("Katie"), %(true)), # Sequences
)

The above code creates a table that contains two things, a string and a sequence of two strings and one boolean.
One thing that has always bothered me is the use of percentage signs, and I recently came to hate it even more.
This morning, I wanted to experiment with HappyX and it turns out that you can't import both happyx and iniplus because of the percent sign. (It's used by std/json, which happyx uses)

So now, with that bit of backstory, here's the improved code:

table.setBulkKeys(
  c("hello","world","!"), # Strings
  c("favorite","people", "John", "Katie", true), # Sequences
)

Yay! No more percentage signs! :D
When I first wrote the code for setBulkKeys (or more specifically, c()) I wasn't aware there was a thing called varargs that let you magically convert values which don't match.

So now, I've re-written this slightly and there's no need for the percentage signs (or newValue()) around every single value.
In addition, I've also improved the codebase slightly by removing procedures in favor of generics. The c() procs have been re-written as one or two generics that now take every value accepted by iniplus

Also, I would have loved to be able to do the same to newValue(), to make it use varargs that automatically converts everything into its proper value but it turns out that it's impossible because of a bug in the compiler that makes it segfault.

Try compiling the following: (It's a dumbed down version of this very bug)

proc a(a: int) = return
proc a(a: varargs[int, a]) = a(1)

It crashes, because of (something, something) recursion and (something, something) uncertainty about parameters or whatever.
It doesn't matter, the point is that you still need newValue() to wrap around every single value in a sequence, even though you don't need that when it comes to setBulkKeys and c()