Skip to content

feat: multi-field object Update syntax#606

Closed
KrisSimon wants to merge 3 commits intomainfrom
migrate-stub-pr
Closed

feat: multi-field object Update syntax#606
KrisSimon wants to merge 3 commits intomainfrom
migrate-stub-pr

Conversation

@KrisSimon
Copy link
Copy Markdown
Member

Migrated from GitLab MR !210 (merged)
feature/update-objectmain
Originally created: 2026-03-24
Merged: 2026-03-28
Author: Kris Simon

Summary

The `Update` action already supported merging dictionaries at the runtime level. This MR surfaces that capability through the existing `with { }` object-literal syntax — no runtime changes needed.

New syntax:
```aro
Update the with {
modified: <stat-entry: modified>,
fileId: <stat-entry: id>,
filePath: <stat-entry: path>,
fileSize: <stat-entry: size>
} when .
```

This replaces four single-field `Update` statements with one. The `when` guard applies atomically to all fields. Field-access expressions (`<obj: field>`) are valid on the right-hand side.

Changes

  • `Proposals/ARO-0004-actions.md`: Added "Update Action — Multi-Field Syntax" section with before/after example; updated action summary description
  • `Book/TheLanguageGuide/AppendixA-ActionReference.md`: Added the previously missing `### Update` reference section covering both single-field and multi-field syntax, behaviour notes, and examples
  • `Examples/ObjectUpdate/`: New example demonstrating both forms and the `when` guard, with `expected.txt` and `test.hint`

Test plan

  • `aro run Examples/ObjectUpdate` matches `expected.txt`
  • `aro check Examples/ObjectUpdate` reports no issues
  • Single-field update still works unchanged
  • Multi-field update with `when ` applies all fields
  • Multi-field update with `when ` leaves object unchanged
  • Field-access expressions on the right-hand side resolve correctly

@KrisSimon KrisSimon closed this Apr 10, 2026
@KrisSimon KrisSimon deleted the migrate-stub-pr branch April 10, 2026 15:02
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