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

new syntax: pin x = e1 in e2 #175

Merged
merged 1 commit into from
Jun 8, 2024
Merged

new syntax: pin x = e1 in e2 #175

merged 1 commit into from
Jun 8, 2024

Conversation

vekatze
Copy link
Owner

@vekatze vekatze commented Jun 8, 2024

Syntax:

pin x = e1 in
e2

Semantics:

pin x = e1 in
e2

↓

let x = e1 in
let result on x = e2 in
let _ = x in
result

Example:

// before
define foo(): unit {
  let xs = make-list(123) in
  let result on xs = some-func(xs) in
  let _ = xs in
  result
}

↓

// after
define foo(): unit {
  pin xs = make-list(123) in
  some-func(xs)
}

@vekatze vekatze self-assigned this Jun 8, 2024
@vekatze vekatze marked this pull request as ready for review June 8, 2024 03:57
@vekatze vekatze merged commit 0dc6c39 into main Jun 8, 2024
1 check passed
@vekatze vekatze deleted the pin branch June 8, 2024 03:58
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.

None yet

1 participant