{"size": 974, "ext": "scrbl", "max_stars_repo_path": "pkgs/racket-doc/scribblings/guide/booleans.scrbl", "max_stars_repo_name": "Racket-zh/racket", "max_stars_repo_stars_event_min_datetime": "2018-07-05T21:18:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-04T14:48:37.000Z", "max_issues_repo_path": "pkgs/racket-doc/scribblings/guide/booleans.scrbl", "max_issues_repo_name": "Racket-zh/racket", "max_issues_repo_issues_event_min_datetime": "2017-05-10T07:33:20.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-19T15:49:46.000Z", "max_forks_repo_path": "pkgs/racket-doc/scribblings/guide/booleans.scrbl", "max_forks_repo_name": "Racket-zh/racket", "max_forks_repo_forks_event_min_datetime": "2016-04-25T11:47:57.000Z", "max_forks_repo_forks_event_max_datetime": "2017-05-09T14:52:48.000Z"}
{"max_stars_count": 4, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 30.4375, "max_line_length": 70, "alphanum_fraction": 0.6991786448}
#lang scribble/doc
@(require scribble/manual scribble/eval "guide-utils.rkt")

@; @title[#:tag "booleans"]{Booleans}

@title[#:tag "booleans"]{布尔值}

@; Racket has two distinguished constants to represent boolean values:
@; @racket[#t] for true and @racket[#f] for false. Uppercase
@; @racketvalfont{#T} and @racketvalfont{#F} are parsed as the same
@; values, but the lowercase forms are preferred.

Racket 用两个不同的常量来表示布尔值：@racket[#t] 表示真，@racket[#f] 表示假。
大写的 @racketvalfont{#T} 和 @racketvalfont{#F} 会被解析为相同的值，
不过小写形式是首选的。

@; The @racket[boolean?] procedure recognizes the two boolean
@; constants. In the result of a test expression for @racket[if],
@; @racket[cond], @racket[and], @racket[or], etc., however, any value
@; other than @racket[#f] counts as true.

过程 @racket[boolean?] 用于识别这两个布尔常量。然而在 @racket[if]、@racket[cond]、
@racket[and] 和 @racket[or] 等测试表达式中，任何非 @racket[#f] 的值均被视为真。
@examples[
(= 2 (+ 1 1))
(boolean? #t)
(boolean? #f)
(boolean? "no")
(if "no" 1 0)
]

