Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Clojure Programming/Examples/API Examples

From Wikibooks, open books for an open world
<Clojure Programming |Examples

This page gives example usage for Clojure API function calls. For a more general introduction to Clojure by example please seehttp://en.wikibooks.org/wiki/Clojure_Programming/By_Example

Documentation

[edit |edit source]

This page provides examples for the following functions.

Data Structures

[edit |edit source]

Numbers

[edit |edit source]
Computation+-*/incdecminmaxremrationalize
Comparison==<><=>=
Predicateszero?pos?neg?

Strings

[edit |edit source]

Characters

[edit |edit source]

Advanced Data Structures

[edit |edit source]

Lists

[edit |edit source]

Vectors

[edit |edit source]

Maps

[edit |edit source]

Struct Maps

[edit |edit source]

Array Maps

[edit |edit source]

Sets

[edit |edit source]

Zippers

[edit |edit source]

Sequences

[edit |edit source]

Sequence Building

[edit |edit source]

Mapping Operators

[edit |edit source]

This page provides examples for the following functions.

Macros

[edit |edit source]

do Macros

[edit |edit source]

This page provides examples for the following functions.

Variable Definition

[edit |edit source]

This page provides examples for the following functions.

MultiMethod

[edit |edit source]

This page defines the following functions

Reference Tools

[edit |edit source]

This page defines the following functions.

Predicate functions

[edit |edit source]

This page provides examples for the following functions.

Recursion Tools

[edit |edit source]

This page defines the following functions.

Function Tools

[edit |edit source]

This page provides examples for the following functions.

Java Interaction

[edit |edit source]

This page provides examples for the following functions.

Namespaces

[edit |edit source]

ns

[edit |edit source]
(ns test.test   (:refer-clojure :exclude [+ -])) (defn +   [a b]   33) (+ 1 2) ;= 33

require

[edit |edit source]
(require '[clojure.zip :as zip]) (require ['clojure.contrib.sql :as 'sql])

Misc.

[edit |edit source]

test

[edit |edit source]
user=> (defn  #^{:test (fn []    (assert (= 4 (myadd 2 2))))}  myadd [a b]  (+ a b))#'user/myadduser=> (test #'myadd):ok
Retrieved from "https://en.wikibooks.org/w/index.php?title=Clojure_Programming/Examples/API_Examples&oldid=3230473"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp