Elisp Programming 5: parser-related

Source: Internet
Author: User

How does the lisp parser handle the list?

If the list contains single quotes, the list will be directly returned (excluding single quotes );

If there is no single quotation mark, the first element of the list will be searched as the function name. If it is found, the function will be called. If it cannot be found, an error message will be returned.

Generally, elements in the list are processed one by one from left to right.

If the list contains nesting, the parser always starts from the innermost layer.

How to evaluate?

The result of evaluation always returns a value. If the evaluation is incorrect, an error message is returned.

After the value of the internal list is obtained, it is used to replace the position of the list as an element.

If you evaluate a number, the number itself is obtained.

If you evaluate the value of a symbol (not a number) without parentheses, the parser considers it to be a value for a variable.

If there is a bracket, of course it is to evaluate a list. Refer to the previous section '... how to deal with list'

The equivalent command of C-X c-e is: eval-last-sexp, which is used to evaluate the value of a nearest symbol expression.

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.