有时候,就像其他编程语言一样,要求相互之间嵌入多个" if"语句。
以下是此声明的一般形式。
if(and condition1 condition2) statement #1 statement #2
以下是如何实现多个条件的示例。
链接:https://www.learnfk.com/clojure/clojure-nested-if-statement.html
来源:LearnFk无涯教程网
(ns clojure.examples.hello (:gen-class)) ;; This program displays Hello Learnfk (defn Example [] ( if ( and (= 2 2) (= 3 3)) (println "Values are equal") (println "Values are not equal"))) (Example)
上面的代码产生以下输出。
Values are equal
这一章《Clojure - 条件判断 - Nested If语句 函数》你学到了什么?在下面做个笔记吧!做站不易,你的分享是对我们最大的支持
为什么 std::fs::write(...) 使用内部函数?
data._mutable= 在 Django REST 框架中为真