Allow binary operators to be used as lambdas #876

Merged
ghallak merged 7 commits from ghallak/228 into master 2022-06-03 18:12:24 +09:00
ghallak commented 2022-06-01 19:34:50 +09:00 (Migrated from gitlab.com)

Fixes: #228

Fixes: #228
zxq9 commented 2022-06-02 18:09:51 +09:00 (Migrated from gitlab.com)

Created by: radrow

sum? :p

*Created by: radrow* sum? :p
zxq9 commented 2022-06-02 18:13:12 +09:00 (Migrated from gitlab.com)

Created by: radrow

It's sorta awkward that we maintain yet another lists of operators (one in lexer, one in expression parser and this one here)... Maybe there is a nicer way of doing so, so they won't desync?

Also, you don't want to allow .. operator here, it doesn't make any sense to make it a lambda

*Created by: radrow* It's sorta awkward that we maintain yet another lists of operators (one in lexer, one in expression parser and this one here)... Maybe there is a nicer way of doing so, so they won't desync? Also, you don't want to allow `..` operator here, it doesn't make any sense to make it a lambda
zxq9 commented 2022-06-02 18:15:26 +09:00 (Migrated from gitlab.com)

Created by: radrow

It this related or just an occasional fix?

*Created by: radrow* It this related or just an occasional fix?
ghallak commented 2022-06-02 18:27:17 +09:00 (Migrated from gitlab.com)

Will change this to any.

Will change this to `any`.
ghallak commented 2022-06-02 18:30:44 +09:00 (Migrated from gitlab.com)

This was an existing bug that nobody has noticed. It didn't allow lambdas to be called directly on arguments (e.g. you can't do ((x) => x))(1)).

I've noticed this when I was trying to do (+)(1, 2) and fixed it.

This was an existing bug that nobody has noticed. It didn't allow lambdas to be called directly on arguments (e.g. you can't do `((x) => x))(1)`). I've noticed this when I was trying to do `(+)(1, 2)` and fixed it.
ghallak commented 2022-06-02 18:41:03 +09:00 (Migrated from gitlab.com)

Changed it to any here 642f5a4da3

Changed it to `any` here 642f5a4da32090f2e1dd277b9d9b84482b3b8942
ghallak commented 2022-06-02 18:41:24 +09:00 (Migrated from gitlab.com)

Disabled .. here 8851629fc7

Disabled `..` here 8851629fc7f0b1d8599c6f30166b0437857d570b
zxq9 commented 2022-06-02 23:14:54 +09:00 (Migrated from gitlab.com)

Created by: radrow

Review: Approved

*Created by: radrow* **Review:** Approved
zxq9 commented 2022-06-03 18:01:35 +09:00 (Migrated from gitlab.com)

Created by: hanssv

Review: Approved

*Created by: hanssv* **Review:** Approved
zxq9 commented 2022-06-03 18:12:24 +09:00 (Migrated from gitlab.com)

Merged by: ghallak at 2022-06-03 09:12:24 UTC

*Merged by: ghallak at 2022-06-03 09:12:24 UTC*
Sign in to join this conversation.
No description provided.