
"As the excellent migration guide tells you, there’s one big difference between tut and mdoc: Working with tut is like typing into the REPL. Working in a REPL means you can redefine thing as you go, but also you sometimes have to nest expressions in objects for the REPL. On the other hand, mdoc is like writing a program and compiling it. In other words, redefining a variable name is not permitted, but you don’t have to worry about REPL-specific behaviour."
"For good or bad, using tut I often redefine values. For example, I’ll build up to a solution to give a foundation for how something works, but then redefine the solution to show a more compressed way most people use a feature. Or we’ll set an exercise, and then implement it (redefining placeholders with working code) in the solutions section. Reusing the same variable names for both is fine in tut, but not in mdoc."
mdoc processes Scala code inside named code fences, type-checking and executing the code and inserting the output into markdown. Tut provided similar functionality but is now deprecated, prompting migration to mdoc. Tut behaves like a REPL, allowing redefinitions and sometimes requiring expression nesting in objects. mdoc behaves like compiling a program: it nests code inside a class or object and disallows redefinition of names. Useful migration techniques include using reset to avoid semantic differences, understanding how mdoc nests code, and using hidden validation. Porting may require renaming or restructuring examples to avoid name conflicts.
Read at underscore.io
Unable to calculate read time
Collection
[
|
...
]