<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 10, 2018, at 10:10 AM, Riley Testut <<a href="mailto:rileytestut@gmail.com" class="">rileytestut@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""></div><div class=""><font class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">On Jan 9, 2018, at 10:02 PM, Chris Lattner via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</span></font></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><font class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">What is the use-case for a type conforming to this protocol but returning nil? If there is a use case for that, why not have such an implementation return “self” instead?</span></font></blockquote><br class=""></div><div class="">I assumed it could be used if a type’s playground representation was variable. For instance:</div><div class=""><br class=""></div><div class="">enum MyUnion</div><div class="">{</div><div class=""> case string(String)</div><div class=""> case image(UIImage)</div><div class=""> case none</div><div class="">}</div><div class=""><br class=""></div><div class="">In its implementation of <span style="background-color: rgba(255, 255, 255, 0);" class="">CustomPlaygroundRepresentable, it could return a string if case string, an image if case image, or return nil if case none to just do whatever is the default for enum values. </span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Admittedly the above is a very contrived example, but I do think it is important to allow types to opt-out.</span></div></div></div></blockquote><br class=""></div><div>You should just be able to return ‘self' in that case?</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><br class=""></body></html>