目录

first

此函数返回列表中的第一项。

语法 (Syntax)

以下是语法。

(first lst)

Parameters - 'lst'是项目列表。

Return Value - 列表中的第一个值。

例子 (Example)

以下是Clojure中的第一个例子。

(ns clojure.examples.example
   (:gen-class))
(defn example []
   (println (first (list 1 2,3))))
(example)

输出 (Output)

上述程序产生以下输出。

1
↑回到顶部↑
WIKI教程 @2018