Function programming. Lambda algorithm. Lisp.

Source: Internet
Author: User

This contactCodeMore, and have some in-depth understanding of various programming methods.

Especially when I learned lisp, I had a little bit of experience.

Like lisp, the simplest syntax is used for functional programming. According to my guess, LISP comes from the lambda algorithm (derived from the three principles of the lambda algorithm into seven principles)

Its biggest feature is that there is only one output parameter. Each function keeps its score and does not return more variables. Its goal is computing.

Therefore, it has a major disadvantage in Engineering Applications: it is difficult to define various error types or implement a complete rollback mechanism.

It is intended for computing, not errors, so it has a good performance in scientific applications. Writing a functional programming script is much easier than writing a C script.

Let's talk about its abstract code:

  • A lisp function: (func a B) where A and B are the parameters of func. In the abstract sense, A can be (list A1 A2 A3 ), it can also be simple (A1 A2 A3)
  • Compared with C functions: func (a, B), there is actually no difference, but C has pointers, macros, enumerations, and a series of language aids. C code is more rigorous, while lisp code is more geek.

In fact, most of the other languages support multiple return values, removing the pointer from the sky in C. Pointers are not fun.

There is no Object-Oriented Compiler-level implementation, and there is no good template library. I think it is not a good language. Although I have already been proficient in C.

Of course, I think function-oriented and object-oriented ideas can all be unified. Objects have functions and functions also have objects. Automatic types are gradually improved in C ++ 11, and C ++ is getting closer and closer to a function-type language.

The template is actually an empirical function-oriented idea.

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.