rename expand to inline

This commit is contained in:
2026-08-02 20:31:05 +02:00
parent c92723bc14
commit 9e79d6692b
13 changed files with 123 additions and 82 deletions
@@ -18,7 +18,7 @@ Value :: union(enum) {
enum_score func(kind Kind) i32 {
result :: match kind {
.first: 1
expand |value|: {
inline |value|: {
yield match value {
.second: 2
.third: 3
@@ -31,7 +31,7 @@ enum_score func(kind Kind) i32 {
equal_value func(a, b Value) bool {
if (tag!(a) != tag!(b)) return false
result :: match a {
expand |value, tag|: {
inline |value, tag|: {
yield match tag {
.number: value == field!(b, tagname!(tag))
.pair: {
@@ -49,7 +49,7 @@ equal_value func(a, b Value) bool {
increment func(value @mut Value) void {
match value^ {
expand |@payload, tag|: match tag {
inline |@payload, tag|: match tag {
.number: payload^ += 1
.pair: payload.left += 1
.empty: _ = payload
+3 -3
View File
@@ -11,7 +11,7 @@ format func() []u8 {
sum func($T type, value T) i32 {
total i32 = 0
match typeinfo!(T) {
.record |record|: expand for record.fields |field| {
.record |record|: inline for record.fields |field| {
total += i32(field!(value, field.name))
}
else: compile_error!("sum requires a record")
@@ -22,7 +22,7 @@ sum func($T type, value T) i32 {
static_control func($T type, value T) i32 {
total i32 = 0
match typeinfo!(T) {
.record |record|: expand for record.fields |field| {
.record |record|: inline for record.fields |field| {
{
if field.index == 1 {
continue
@@ -50,7 +50,7 @@ row_value func(row Row) i32 {
static_aggregates func() i32 {
total i32 = 0
expand for {Row {value = 2}, Row {value = 40}} |row| {
inline for {Row {value = 2}, Row {value = 40}} |row| {
total += row_value(row)
}
return total