printf - Why is F# printfn not implemented in terms of Console.WriteLine? -


i noticed unexpected behavior when using f# printfn. seems break format string chunks , call console.write multiple times each call printfn. expect format entire string , call console.writeline once.

i noticed because intercepting standard console output using console.setout call own textwriter tries prefix every line of output time stamp , additional custom text.

what gives?

here's guess, it's worth:

  1. compiler magic
  2. at runtime, implementer knew write go buffered stream, performance won't drastically different using stringbuilder object , tostring() override. maybe performance better, since avoided object allocation.

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -