let x%private = 1
is not supported right now in .res files. is it intentional, or will it be added in the future ?
or is it a different annotation ?
BuckleScript 8.1 New syntax: let%private
giraud
#1
chenglou
#2
It is supported right now, just with the normal extension syntax. %private
in particular is something worth first-classing one day.
chenglou
#4
Have you tried %%private(let x = 1)
Not the best syntax. We don’t have sugar for this yet.
giraud
#5
Thanks.
Maybe it would be good to add it to the diff syntax page ? The new syntax isn’t obvious at all.
spyder
#6
This is the natural result of translating the OCaml syntax, which is [%%private let a = 3]
. I doubt it’ll stick around for long so I don’t think it needs to go on the diff page.
chenglou
#9
He was talking about the non-sugared version. let%foo bar = az
is the ocaml syntax sugar for [%%foo let bar = baz]
. Likewise if%foo
, switch%foo
.
spyder
#10
Sorry, yes, I worded that poorly. I was using refmt
to translate and forgot OCaml has sugar for it.