<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>第八篇 概念专题 on 编程那些事儿</title><link>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/</link><description>Recent content in 第八篇 概念专题 on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sat, 19 Sep 2026 21:54:25 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/index.xml" rel="self" type="application/rss+xml"/><item><title>第48章 序列与集合协议族：为什么 for-in 什么都吃得下</title><link>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-48-Sequence-and-Collection-Protocols/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-48-Sequence-and-Collection-Protocols/</guid><description>&lt;h1 id="第四十八章序列与集合协议族为什么-for-in-什么都吃得下"&gt;第四十八章：序列与集合协议族：为什么 &lt;code&gt;for-in&lt;/code&gt; 什么都吃得下&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;你从第 10 章就在用 &lt;code&gt;Array&lt;/code&gt;、&lt;code&gt;Set&lt;/code&gt;、&lt;code&gt;Dictionary&lt;/code&gt;，第 11 章开始写 &lt;code&gt;for-in&lt;/code&gt;，第 14 章之后又用了一堆 &lt;code&gt;map&lt;/code&gt;、&lt;code&gt;filter&lt;/code&gt;。但有一件事一直没说：&lt;strong&gt;&lt;code&gt;for-in&lt;/code&gt; 凭什么接受这些东西？&lt;/strong&gt; 答案是一族协议——&lt;code&gt;Sequence&lt;/code&gt;、&lt;code&gt;IteratorProtocol&lt;/code&gt;、&lt;code&gt;Collection&lt;/code&gt;。这一章把这一族补齐，顺便让你自己的类型也能直接用上整套标准库算法。&lt;/p&gt;</description></item><item><title>第49章 数值协议族与格式化：数字从计算到显示</title><link>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-49-Numeric-Protocols-and-Formatting/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-49-Numeric-Protocols-and-Formatting/</guid><description>&lt;h1 id="第四十九章数值协议族与格式化数字从计算到显示"&gt;第四十九章：数值协议族与格式化：数字从计算到显示&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;第 4 章讲了整数、浮点、溢出；第 38 章又顺手提了一句金额要用 &lt;code&gt;Decimal&lt;/code&gt;。但中间那层一直没讲：&lt;strong&gt;为什么 &lt;code&gt;reduce(0, +)&lt;/code&gt; 能同时算 &lt;code&gt;Int&lt;/code&gt; 和 &lt;code&gt;Double&lt;/code&gt;？&lt;code&gt;UInt8.max&lt;/code&gt; 是哪来的？&lt;/strong&gt; 这一章补齐数值协议族，顺便把&amp;quot;数字怎么变成给人看的文字&amp;quot;讲清楚——那部分几乎每个项目都会用到，也几乎每个项目都会写歪。&lt;/p&gt;</description></item><item><title>第50章 属性与下标全形态：一个概念家族的收口</title><link>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-50-Properties-and-Subscripts-Tour/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-50-Properties-and-Subscripts-Tour/</guid><description>&lt;h1 id="第五十章属性与下标全形态一个概念家族的收口"&gt;第五十章：属性与下标全形态：一个概念家族的收口&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;计算属性&amp;quot;只是这个家族里的一个成员。它的亲戚散落在好几章里：观察器在第 19.2 节、&lt;code&gt;lazy&lt;/code&gt; 在第 19.3 节、类型属性在第 19.4 节、属性包装器在第 19.7 与第 15B.6 节、扩展里的计算属性在第 21 章……这一章把它们摆到一起，让你第一次看清整个家族的样子。&lt;/p&gt;</description></item><item><title>第51章 标准库算法工具箱：zip、stride 与 reduce(into:)</title><link>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-51-Standard-Library-Algorithms/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-51-Standard-Library-Algorithms/</guid><description>&lt;h1 id="第五十一章标准库算法工具箱zipstride-与-reduceinto"&gt;第五十一章：标准库算法工具箱：zip、stride 与 reduce(into:)&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;前面五十章里，&lt;code&gt;map&lt;/code&gt;、&lt;code&gt;filter&lt;/code&gt;、&lt;code&gt;sorted&lt;/code&gt; 出镜率最高，于是很容易留下一个错觉：Swift 的集合操作就这三个。其实标准库里躺着一整箱工具，&lt;code&gt;zip&lt;/code&gt;、&lt;code&gt;stride&lt;/code&gt;、&lt;code&gt;sequence&lt;/code&gt;、&lt;code&gt;reduce(into:)&lt;/code&gt;、&lt;code&gt;Dictionary(grouping:by:)&lt;/code&gt;……它们平时只是没遇到合适的场景，所以你没注意到。&lt;/p&gt;</description></item><item><title>第52章 反射与内存布局：类型在运行时留下什么</title><link>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-52-Reflection-and-Memory-Layout/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-8-Concept-Tour/Chapter-52-Reflection-and-Memory-Layout/</guid><description>&lt;h1 id="第五十二章反射与内存布局类型在运行时留下什么"&gt;第五十二章：反射与内存布局：类型在运行时留下什么&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;同一个问题是所有现代语言都要回答的：程序跑起来之后，类型还剩多少信息？Swift 的答案很有个性——&lt;strong&gt;反射是只读的，内存布局是可以量的&lt;/strong&gt;。这一章把 &lt;code&gt;CustomStringConvertible&lt;/code&gt;、&lt;code&gt;Mirror&lt;/code&gt;、&lt;code&gt;MemoryLayout&lt;/code&gt; 和 &lt;code&gt;withUnsafeBytes&lt;/code&gt; 串成一条线，讲清楚 Swift 在这个话题上的边界。&lt;/p&gt;</description></item></channel></rss>