Occasionally, I encounter one argument wanting to reference another. For instance,
def monitor(time: Double, f: Double => Double, resolution: Double = time / 10) = {...}
Note that resolution refers to time. Are there languages where this is possible? Is it possible in Scala?
I don't know any langage where this construction is possible, but a simple workaround is not difficult to find.
In scala, something like this is possible :
In scala, you can also make something like this :