词条 | P* |
释义 |
| logo = | name = P* | year = 2013 | designer = Atle Solbakken | latest release date = November 2013 | typing = Static, weak | influenced_by = C, PHP, Perl, C++ | operating_system = Cross-platform (multi-platform) | file_ext = .pstar or no extension | license = GPLv3 | website = {{URL|http://www.p-star.org}} }} P* (pronounced "P-star") is a programming language meant to be useful in web development for creating dynamic HTML documents. The language provides syntax for templates and prepared SQL-statements. P* programs are scripts which are run by the P* interpreter. SyntaxThe syntax is inspired from other C-family languages. Program Blocks starts with the open curly bracket Scenes and templatesThe code of a P* program is placed into scenes , and the HTML markup is typically placed inside templates. A scene is a special type of function which does not take arguments. All programs must provide exactly one scene called 'main', which is the first to run by the interpreter. A small P* web page, where the code for the program sits inside the scene called 'main' and the HTML markup is put inside a template, can look like this: When scenes and templates in P* are called, the callee inherhits all variables which is available from where the call is made. This is opposed to when functions are called, where only a set of paramenters is passed. Data typesP* provides eight basic types for storing data in variables. All variables is required to have a type, but P* automatically converts between them. In the following example program, one variable, ImplementationP* programs are run by the P* interpreter. A typical way to run scripts is to include a shebang on the first line of the scripts (like 1 : C programming language family |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。