目录

concat

这用于将两个序列连接在一起。

语法 (Syntax)

以下是语法。

(concat seq1 seq2)

Parameters - 'seq1'是元素的第一个序列列表。 'seq2'是元素的第二个序列列表,需要将其附加到第一个。

Return Value - 元素的组合序列。

例子 (Example)

下面是Clojure中concat的一个例子。

(ns clojure.examples.example
   (:gen-class))
;; This program displays Hello World
(defn Example []
   (def seq1 (seq [1 2]))
   (def seq2 (seq [3 4]))
   (println (concat seq1 seq2)))
(Example)

输出 (Output)

上述程序产生以下输出。

(1 2 3 4)
↑回到顶部↑
WIKI教程 @2018