Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the syntax for a section of the binding access operator?

I want to create a function that takes an object and returns a bound method, like this:

f = (~ m)
f(x)() # same as x.m()

However, this parses ~ as the unary bitwise NOT operator, rather than the binding access operator. IOW it compiles to ~change. I want it to compile to function(it) { return bind$(it, 'change'); } instead.

Can I use a section for this (and what is the syntax) or do I have to write a lambda?


1 Answers

You have to be explicit about the fact it's a DOT operator. This is currently not possible, but I added it in for 1.3.

like image 57
Ven Avatar answered Dec 08 '25 11:12

Ven



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!