Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It seems there's a conflict between the logical flow of prefixes going right to left and postfixes going left to right. I wonder if there's any value (for other future languages) in having syntax to swap post and prefix for convenience

instead of (await doSomething()).somethingElse()

doSomething()@await.somethingElse()



That seems to be what this proposal is already working toward, eg with the discussion of also supporting .match.

keyword EXPR MAYBEBODY <=> EXPR.keyword MAYBEBODY


From the post:

> “Dot keyword:” In the previous post, a sketch was made of an idea in which certain keywords could be postfixed or infixed using the dot operator. This idea is only a sketch, and is not implied or guaranteed by the decision we’ve made here.


Ah, pity; I originally read it as "We aren't sure which - if any - keywords we want to do this to.".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: