<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>表达式 on Tony Bai</title><link>https://tonybai.com/tags/%E8%A1%A8%E8%BE%BE%E5%BC%8F/</link><description>Recent content in 表达式 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Tue, 28 Apr 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/%E8%A1%A8%E8%BE%BE%E5%BC%8F/index.xml" rel="self" type="application/rss+xml"/><item><title>Go 语言“内战”迎来终局？Go 圣经作者亲自下场，为“三元运算符”发起折中提案！</title><link>https://tonybai.com/2026/04/28/go-conditional-expressions-propsal/</link><pubDate>Tue, 28 Apr 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/04/28/go-conditional-expressions-propsal/</guid><description>本文永久链接 – https://tonybai.com/2026/04/28/go-conditional-expressions-propsal 大家好，我是Tony Bai。 在 Go 语言的江湖里，有一个话题，像幽灵一样，每隔几个月就会重燃战火。它引发的争论之激烈、持续时间之长，甚至超过了当初的“泛型”和“错误处理”。 它就是——**三元条件运算符（Ternary Conditional ...</description></item><item><title>告别懵圈：实战派 Gopher 的类型理论入门</title><link>https://tonybai.com/2025/10/30/type-theory-intro-for-gopher/</link><pubDate>Thu, 30 Oct 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/10/30/type-theory-intro-for-gopher/</guid><description>本文永久链接 – https://tonybai.com/2025/10/30/type-theory-intro-for-gopher 大家好，我是Tony Bai。 你是否曾有过这样的经历：在浏览一个关于 Go 泛型或接口设计的 GitHub issue 或技术提案时，评论区里的大佬们突然开始讨论 “Sum Type”、“Product Type”、“Parametric Polymorphi...</description></item><item><title>手把手教你使用ANTLR和Go实现一门DSL语言（第一部分）：设计DSL语法与文法</title><link>https://tonybai.com/2022/05/24/an-example-of-implement-dsl-using-antlr-and-go-part1/</link><pubDate>Tue, 24 May 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/05/24/an-example-of-implement-dsl-using-antlr-and-go-part1/</guid><description>本文永久链接 – https://tonybai.com/2022/05/24/an-example-of-implement-dsl-using-antlr-and-go-part1 在《使用ANTLR和Go实现DSL入门》一文中，我们了解了DSL与通用编程语言(GPL)的差异、DSL解析器生成工具选择以及ANTLR文法的简要书写规则，并和大家一起完成了一个CSV解析器的例子。看完上述文章后，你...</description></item><item><title>使用ANTLR和Go实现DSL入门</title><link>https://tonybai.com/2022/05/10/introduction-of-implement-dsl-using-antlr-and-go/</link><pubDate>Tue, 10 May 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/05/10/introduction-of-implement-dsl-using-antlr-and-go/</guid><description>本文永久链接 – https://tonybai.com/2022/05/10/introduction-of-implement-dsl-using-antlr-and-go 一. 引子 设计与实现一门像Go这样的通用编程语言的确很难！那是世界上少数程序员从事的事业，但是实现一门领域特定语言(Domain Specific Language, DSL)似乎是可行的。 就像著名的语言解析器生成工具...</description></item><item><title>针对大型数组的迭代，for range真的比经典for loop慢吗？</title><link>https://tonybai.com/2022/03/19/for-range-vs-classic-for-loop-when-iterating-large-array/</link><pubDate>Sat, 19 Mar 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/03/19/for-range-vs-classic-for-loop-when-iterating-large-array/</guid><description>本文永久链接 – https://tonybai.com/2022/03/19/for-range-vs-classic-for-loop-when-iterating-large-array Go语言推崇“**一件事情仅有一个作法**”！比如：Go仅保留一类循环控制语句，那就是**经典版的for loop**： ``` for i := 0; i &amp;lt; 100; i++ { ... ... } `...</description></item><item><title>对一段有关Go Code Block和变量作用域的代码的简要分析</title><link>https://tonybai.com/2018/05/11/the-analysis-of-a-go-code-snippet-about-code-blocks-and-scope/</link><pubDate>Fri, 11 May 2018 00:00:00 +0800</pubDate><guid>https://tonybai.com/2018/05/11/the-analysis-of-a-go-code-snippet-about-code-blocks-and-scope/</guid><description>近期，Go team的David CrawShaw在twitter上贴出了一段代码，如下： func main() { if a := 1; false { } else if b := 2; false { } else if c := 3; false { } else { println(a, b, c) } } David CrawShaw想表达的意图是gopher们很少在”else if...</description></item><item><title>C程序员驯服Common Lisp – 控制结构</title><link>https://tonybai.com/2011/09/14/c-programers-tame-common-lisp-series-control-structure/</link><pubDate>Wed, 14 Sep 2011 00:00:00 +0800</pubDate><guid>https://tonybai.com/2011/09/14/c-programers-tame-common-lisp-series-control-structure/</guid><description>光有表达式，我们依旧无法写出实用的程序，我们还缺少控制结构(Control Structures)。 C语言主要有三种控制结构：顺序结构、条件分支结构和循环结构。Common Lisp 也实现了类似的控制结构，我们逐一来看。 一、顺序结构 顾名思义，顺序结构中的语句或表达式是按其位置的先后顺序依次执行的，这也是最简单也最容易理解的一种结构。在C语言中，绝大多数代码块(code block)中的代码...</description></item><item><title>C程序员驯服Common Lisp – 表达式</title><link>https://tonybai.com/2011/09/02/c-programers-tame-common-lisp-series-expressions/</link><pubDate>Fri, 02 Sep 2011 00:00:00 +0800</pubDate><guid>https://tonybai.com/2011/09/02/c-programers-tame-common-lisp-series-expressions/</guid><description>Common Lisp程序由一组表达式构成。在&amp;#34;入门&amp;#34;一文中我提到过：Common Lisp使用S-expressions作为表达式(Expressions)的基本语法格式。S-expressions由原子(atoms)和S-expressions列表组成，或者说原子和列表(List)是组成S-expression的基本元素。复杂的源程序都是由简单的表达式组成的，我们在学习编写实用的Common ...</description></item></channel></rss>