Clojure's quantum properties

Source: Internet
Author: User

(Defprotocol X (cat [this other])

Define a protocol, which is similar to the objective-C protocol. Different from Java interfaces. User => X {: On-interface user. x,: on user. x,: Sigs {: CAT {: Doc nil,: arglists ([this other]),: Name cat }},: var # 'user/X ,: method-map {: Cat: CAT },: method-builders {# 'user/cat # <user $ eval12 $ FN _ 13 user $ eval12 $ FN _ 13 @ 13cc0a7f> }}
User => (extend-type string X (cat [this other] (. Concat this other )))This is the objc style. Define a function as an implementation of a type under a protocol. User => (Cat "AA" "BB ") "AABB"Ideologically speaking, FP and OO are opposite. A function is the core and a data is the core. While lisp is divided into two layers: The base layer, and everything belongs to Data. However, at the abstraction layer, all functions and functions are called. Or, it can be said that lisp has the characteristics similar to the Two-Phase Properties of the wave particles in quantum optics. "motion" is a function call, "static" is data.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.