Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immutable containers #338

Open
frostburn opened this issue Jun 3, 2024 · 0 comments
Open

Immutable containers #338

frostburn opened this issue Jun 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@frostburn
Copy link
Member

Requires immutable Fraction in xen-dev-utils and immutable Interval class etc.

New keyword immutable.

(* Immutable array expression *)
let myTuple = immutable [1, 2, 3]
(* Sugar for cost foo = immutable bar *)
immutable myConstTuple = [4, 5]
(* Only immutables can be nested inside other immutables *)
immutable myNestedTuple = [0, myTuple, myConstTuple, [6, 7]]

(* Variables with immutable values can be reassigned *)
myTuple = (8,) (* Pythonic tuple syntax *)

Records:

immutable myConstImmutableRecord = {foo: 1, bar: 2}
let myReassignableImmutableRecord = immutable {baz: 3, qux: {quux: 4, corge: 5}}
@frostburn frostburn added the enhancement New feature or request label Jun 3, 2024
frostburn added a commit that referenced this issue Jun 4, 2024
Document unicode monzo and val brackets.

ref #338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant