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

[github patch] extend record punning to allow destructuring: desugar pattern {{x;y} as p} into {p = {x;y} as p} #6312

Closed
vicuna opened this issue Jan 31, 2014 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jan 31, 2014

Original bug ID: 6312
Reporter: @gasche
Status: closed (set by @mshinwell on 2016-12-07T15:43:04Z)
Resolution: duplicate
Priority: normal
Severity: feature
Version: 4.02.0+dev
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Monitored by: @yallop

Bug description

Reported by Jeremy Yallop:
#3
A diff is available at:
https://github.com/ocaml/ocaml/pull/3.diff

This patch extends the record punning syntax (b01621e) to allow simultaneous label punning and destructuring. Variables bound using as at the top level of a field pattern are treated as labels. For example, it allows you to write

fun { { x ; y } as p; q } -> e

which is equivalent to

fun { p = { x ; y } as p; q } -> e

@vicuna
Copy link
Author

vicuna commented Dec 7, 2016

Comment author: @mshinwell

Superceded by Github PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant