So I was working, and I accidentally dropped one commit too many.
Oh dear.
So I thought, would there be a possibility of getting this one back? And I was quite surprised that there was.
A quick google search later, I found the information I put in the References below.
git reflog
The reflog or "Reference logs" contain a record when the tips of branches or other references were updated in the local repository. From my imperfect knowledge, it sounds like a database transaction log.
With it you can pinpoint the exact point in the records where your change/branche/commit was still there and reset the head "hard" to this SHA value.
git reset --hard d6b66766a9a
Bear in mind that the reflog is only available locally in your git repo, and it will get cleaned of old reflog entries in due time.
References
Rewind Blog - How to Restore a Deleted Branch or Commit with Git Reflog
So my colleague mentioned operator overloading, and how much fun it is.
So I wrote a little test.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It works pretty good, but for infix functions it has a very high "syntactic sugar" and less about "real" operator overloading.
Also, the reference page in [1] indicates that for Infix functions, the precedence has fixed rules that do not (always) conform to precedence that we would assume.
My colleague told me that a number of infix functions were created for QueryDSL, so we could write a semblance of SQL in Kotlin, but the precedence tends to screw things up.
We removed these infix functions from our source code again.
So, use sparingly and only when it makes sense. For example if it makes your code a magnitude easier to read/reason about and preferable with as small a scope as possible.