mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
Estimated hours taken: 3 Branches: main Allow field access syntax at the top-level of func and mode declarations and in function clause heads. NEWS: Report the new feature. doc/reference_manual.texi: Document the new feature. compiler/prog_io.m: Implement the new feature. tests/hard_coded/Mmakefile: tests/hard_coded/field_syntax.exp: tests/hard_coded/field_syntax.m: Added a test case.
5 lines
158 B
Plaintext
5 lines
158 B
Plaintext
A = array([1, 2, 3])
|
|
A ^ elem(0) = 1
|
|
A ^ elem_from_end(0) = 3
|
|
(A ^ elem_from_end(2) := 4) = array([4, 2, 3])
|