I saw that [Noulith](https://github.com/betaveros/noulith) has
    
    
    x max= y
    
    
    Run

as a (conceptual) shortcut for
    
    
    x = max(x, y)
    
    
    Run

which is often handy for AoC in particular.

And just realized you can write that in Nim, for example:
    
    
    proc `>>=`[T](currentMax: var T, newValue: T) =
      if currentMax < newValue:
        currentMax = newValue
    
    
    Run

As you know, if you want it to be an infix operator that does assignment [there 
are some constraints](https://nim-lang.org/docs/tut1.html#procedures-operators) 
about the symbols you can use in the name, but it works!

Reply via email to