这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@dvulakh
Copy link

@dvulakh dvulakh commented Mar 19, 2025

This PR fixes several problems with the compact format when a (possibly labelled) argument is a fun or function.

After this PR:

  1. exclave_ follows fun _ -> without a line break in the compact format, e.g.
 let _ =
-  MMMMMMMMMMMM.xxxxxxxxxxxxxxxxxxxx xxx ~f:(fun xxxxxx ->
-    exclave_
+  MMMMMMMMMMMM.xxxxxxxxxxxxxxxxxxxx xxx ~f:(fun xxxxxx -> exclave_
     match xxxxxx with
     | _ -> xxxxxxxxxxxxxxx
     | _ -> xxxxxxxxxxxxxxx)
 ;;
  1. stack_ and local_ around the function do not prevent using the compact format, e.g.
 let _ =
-  MMMMMMMMMMMM.xxxx
-    xxxxxxxxxx
-    ~f:(local_ fun x -> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
+  MMMMMMMMMMMM.xxxx xxxxxxxxxx ~f:(local_ fun x ->
+    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
 ;;
  1. Packages earlier in the argument list do not prevent using the compact format, e.g.
 let _ =
-  MMMM.xxx
-    (module MMM)
-    xxxx
-    ~f:(fun xxx -> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
+  MMMM.xxx (module MMM) xxxx ~f:(fun xxx ->
+    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
 ;;

This PR includes many new in-repo tests, but the most interesting test is the internal diff.

@dvulakh dvulakh requested a review from mdelvecchio-jsc March 31, 2025 17:41
Copy link

@mdelvecchio-jsc mdelvecchio-jsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal diff looks good, some small comments on PR.

dvulakh added 28 commits April 30, 2025 22:19
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
[exclave_] isn't actually valid in this position: we should only care
about [local_] and [stack_]

Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
this fixes the compact [fun] form

Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
@dvulakh dvulakh force-pushed the dvulakh.fix-local-labelled-arg branch from 6679e58 to 786639e Compare May 1, 2025 02:20
dvulakh added 4 commits April 30, 2025 22:26
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
and also add some context on what it's the "pro" of

Signed-off-by: David Vulakh <dvulakh@janestreet.com>
@dvulakh dvulakh requested a review from mdelvecchio-jsc May 1, 2025 14:13
@dvulakh
Copy link
Author

dvulakh commented May 1, 2025

Thanks for the comments, I've addressed and checked that the internal diff is unchanged.

Copy link

@mdelvecchio-jsc mdelvecchio-jsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@dvulakh dvulakh merged commit ac303c9 into jane May 2, 2025
3 checks passed
@dvulakh dvulakh deleted the dvulakh.fix-local-labelled-arg branch June 4, 2025 19:54
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.

3 participants