Squirrel Study Notes

Source: Internet
Author: User

Ii. Differences with Lua

 

Squirrel supports oo better than Lua. squirrel can define classes, allow class inheritance, and automatically execute constructor functions. Lua can only simulate classes through tables. More importantly, squirrel allows classes to generate instances. Each instance has its own storage space, which is obviously better than the Lua simulation class.

Squirrel supports setting a userpoint on each instance. This feature is very advantageous with the c ++ object interface. A squirrel class can be conveniently used as the shadow of a C ++ class, we only need to implement the C ++ class interface on Squirrel and use the userpoint of squirrel to manipulate this c ++ object.

I encapsulated a support for SQLite and found that it is easy to use squirrel to convert the C/C ++ library into squirrel local support. It is troublesome to do this in Lua. Although there are a lot of secondary development in Lua, there are also very complete C/C ++ to Lua binding libraries, however, it is better to do this by yourself.

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.