📜  Clojure-函数

📅  最后修改于: 2020-11-05 03:59:21             🧑  作者: Mango


Clojure被称为函数式编程语言,因此您可能会希望对Clojure中的函数如何工作有更多的重视。本章介绍Clojure中的函数可以完成的所有操作。

Sr.No. Functions & Description
1 Defining a Function

A function is defined by using the ‘defn’ macro.

2 Anonymous Functions

An anonymous function is a function which has no name associated with it.

3 Functions with Multiple Arguments

Clojure functions can be defined with zero or more parameters. The values you pass to functions are called arguments, and the arguments can be of any type.

4 Variadic Functions

Clojure offers the ‘case’ statement which is similar to the ‘switch’ statement available in the Java programming language.

5 Higher Order Functions

Higher-order functions (HOFs) are functions that take other functions as arguments. HOFs are an important functional programming technique and are quite commonly used in Clojure.