JohnEarnest / ok

An open-source interpreter for the K5 programming language.
MIT License
587 stars 72 forks source link

Issue with updating assignment and monadic verbs #31

Closed refi64 closed 4 years ago

refi64 commented 8 years ago
f:{}
(f|:) / sets f to 'f|'; same with f+:, f-:, etc

I would think this would chain the verbs. Well, it kind of does, but it overwrites f in the process. I know a+:b is updated assignment, but this has no rhs.

Unless this is a K5 feature or something?

JohnEarnest commented 4 years ago

Looking back at this ticket, I'm kinda baffled about the intended behavior here.

The expression f|: is desugared by oK's parser into f:f|, which is precisely what it does.

Closing. Feel free to reopen if you still care and you can clarify a use-case.