Closed zapashcanon closed 1 year ago
Do you have an example of how they're used? I'm not following how let+
works from the source.
Sure ! You can have a look at the fuzzer being written by my intern for our Wasm interpreter.
Ah, I see - I couldn't understand how let+
would support multiple arguments to map
, but it looks like you're always using it with just a single argument. Maybe it's simpler to specialise it to that case, and avoid having to write the square brackets each time?
You could also add a and+
using pair
, I think.
Indeed, I tried and it allows to use let-punning, making the code a little bit shorter. I'll update the PR. :)
I also added and+
.
Looks good! Could you add code examples to the doc comments of let+
and and*
? (It's not necessarily obvious how to use these for people unfamiliar with the desugaring of let-operators)
I added small examples. I'm not completely sure if they'll be useful enough for someone not familiar with this kind of de-sugaring. If you have a better idea I'll update the PR.
Thanks!
Hi @stedolan,
I simply defined
let*
asdynamic_bind
andlet+
asmap
. They're in aSyntax
module to avoid potential conflicts.I use them a lot as it sometimes makes the code much more easy to follow and I guess I'm not the only one.