Sends for the fellow dear visitors:
Welcome to DongPad!
打印函数主要有三个:printf、printfn和sprintf。
printf将参数打印到控制台窗口中。printfn将参数打印输出并且换行。
打印函数可以使用下面这些格式指示符:
%O格式指示符会将对象进行装箱操作,并调用Object.ToString函数。%A的运作方式相同,但是在调用Object.ToString之前会检查[]属性指定的任何特殊打印选项。 PS: 紧接着的是来自官方的解释,从侧面说明了 printfn "%O" false (结果为False)与 printfn "%A" false(结果为false)的区别 %O 设置通过将对象装箱并使用其 ToString 方法来打印的任何值的格式。 %A 设置使用默认布局设置打印的任何值的格式。
%O格式指示符会将对象进行装箱操作,并调用Object.ToString函数。%A的运作方式相同,但是在调用Object.ToString之前会检查[]属性指定的任何特殊打印选项。
PS: 紧接着的是来自官方的解释,从侧面说明了 printfn "%O" false (结果为False)与 printfn "%A" false(结果为false)的区别
%O 设置通过将对象装箱并使用其 ToString 方法来打印的任何值的格式。
%A 设置使用默认布局设置打印的任何值的格式。
sprintf用于输出的目标为一个字符串的情况。
节选自:CC682,更多格式请参考官方Core.Printf的%[flags][width][.precision][type]详解
Tags: DongPad F# 占位符
1.Foundations of F#
If youre already familiar with FP, youll find F# the language youve always dreamed of. And all .NET programmers will find F# an exciting real-world alternative to C# and Visual Basic. This book is likely to have many imitators, but few true competitors. Written by F# evangelist Rob Pickering, and tech reviewed by F#s main designer, Don Syme, this is an elegant, comprehensive introduction to all aspects of the language and an incisive guide to using F# for real-world professional development. F# is the future of programming (not just on .NET), and the future is now.
这本书09年夏就开始在看了,后来一度荒废,继而直到上周参加盛大创新院赞助首届.NET技术交流会听了老赵的《F#语言对异步程序设计的支持》,才又激起我对F#探索的兴趣来。也希望籍此机会,好好的熟悉一下F#。
Tags: DongPad
Powered By DongPad CopyRight 2008-2011, xhtml | css
Processed in 0.046 seconds(s) , 沪ICP备08111450号