Chiba Logo CHIBA v0.6.13
CHIBA blog RSS feed
CHIBA / DOCS / LEVEL-1 SPEC

算术运算

这里集中展示 CHIBA level-1 specification,覆盖 core language、control flow、memory、patterns、IR lowering 与 package system 等实现边界。

The docs surface keeps CHIBA level-1 specification pages browsable inside the site, with direct paths into language, control flow, memory, pattern, and lowering rules.

算术运算

语法

当前至少包括:

  • +
  • -
  • *
  • /
  • %

语义

算术运算作用于数值类型,并可参与 operator overloading。

Usage

let x = 1 + 2 * 3
let y = x % 4

注释:这个例子覆盖了加、乘、取模的最基本表面,强调它们首先是数值运算,再谈 overload 扩展。

边界

需要单独明确:

  • 整数与未来浮点的统一规则
  • operator overload 的候选筛选