This project is read-only.
Use structure format display attribute

Category:
Format
Description: Use structure format display attribute. Use this attribute we can customerize the printf content.
Code:
[<StructuredFormatDisplayAttribute("MyType is {Contents}")>]
type C(elems:int list) =
member x.Contents = elems

let pritnfnSample0() =
printfn "%A" (C [1..4])

Execution Result:
MyType is [1; 2; 3; 4]

Last edited Sep 14, 2011 at 4:13 AM by ttliu2000, version 2

Comments

No comments yet.