Skip to content

Remove cell#3

Merged
Alligator merged 18 commits into
mainfrom
remove-cell
May 22, 2026
Merged

Remove cell#3
Alligator merged 18 commits into
mainfrom
remove-cell

Conversation

@Alligator
Copy link
Copy Markdown
Owner

@Alligator Alligator commented May 22, 2026

semantic changes this makes:

$ in ENDFILE is set to whatever it was at the end of BEGINFILE.

arrays are now always copied by reference in function calls. that wasn't intentional, previously Value stored arrays as []*Cell. mutating items in the array would work:

BEGIN {
  function x(arr) { arr[0] = 4 }
  a = [1]
  x(a)
  print a
}

prints [4]

But growing the array would not:

BEGIN {
  function x(arr) { arr[0] = 4 }
  a = []
  x(a)
  print a
}

prints []

trying to read $ in BEGIN or END is now a runtime error (unknown variable $).

@Alligator Alligator marked this pull request as ready for review May 22, 2026 10:40
@Alligator Alligator merged commit e7456fd into main May 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant