p2  0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
glossary.html
Go to the documentation of this file.
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3 <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <style type="text/css">@import 'doc.css';</style>
5 </head><body>
6 <pre style="background:#AE6;width:25em;float:right;padding-right:2em">
7  .ooo
8  'OOOo
9  ~ p ooOOOo 2 ~
10  .OOO
11  oO %% a fast perl5
12  Oo
13  'O
14  `
15  (o)
16  ___/ /
17  /` \
18  /v^ ` ,
19  (...v/v^/
20  \../::/
21  \/::/
22 </pre>
23 <div id='central'>
24 <p>See the <a href="start.html">pamphlet</a> for an overview of the potion syntax and data structures.</p>
25 <dl>
26  <dt><a name="tuple">tuple</a></dt>
27  <dd>an ordered list</dd>
28 </dl>
29 <dl>
30  <dt><a name="table">table</a></dt>
31  <dd>a hash<br />
32  but with list syntax</dd>
33 </dl>
34 <dl>
35  <dt><a name="lick">lick</a></dt>
36  <dd>a nested data structure, i.e. named hash. the keys are called <code>path</code>.</dd>
37 </dl>
38 <p>Every lick can have a name, a table of attributes, and a list of<br />
39 children. The list of children can, instead, be a Potion data<br />
40 type, such as a number or string or something.</p>
41 <dl>
42  <dt><a name="path">path</a></dt>
43  <dd>key of a <code>lick</code>, an instance variable of an object.</dd>
44 </dl>
45 <p>Paths cannot be randomly added to the object after the object<br />
46 is created. Each object has a strict set of paths. Every path<br />
47 which is used in the constructor is added to the object upon<br />
48 creation.</p>
49 <dl>
50  <dt><a name="upvalue">upvalue</a></dt>
51  <dd>A variable in an upper scope.</dd>
52 </dl>
53 <p>Since a closure doesn&#8217;t have access to the registers<br />
54 of another function, these variables are passed<br />
55 as pointers (the <code>PNWeakRef</code> struct.)</p>
56 <dl>
57  <dt><a name="lobby">Lobby</a></dt>
58  <dd>potion named the main interp object <code>Lobby</code>, which holds the<br />
59 methods <code>about</code>, <code>here</code>, <code>exit</code>, <code>self</code>, &#8230;<br />
60 p2 renames it to <code>"P2"</code></dd>
61 </dl>
62 <dl>
63  <dt><a name="mop">mop</a></dt>
64  <dd>potion/p2 uses the <a href="http://piumarta.com/software/cola/objmodel2.pdf">cola mop</a><br />
65 with 5 core functions: <code>addMethod</code>, <code>lookup</code>, <code>allocate</code>, <code>delegated</code> and <code>intern</code>.<br />
66 And 4 native (and jitted) VM ops: <code>SELF</code>, <code>CLASS</code>, <code>BIND</code> and <code>MSG</code>.<br />
67 <img src="p2-mop.png" title="p2-mop" alt="p2-mop" /></dd>
68 </dl>
69 <dl>
70  <dt><a name="flex">flex</a></dt>
71  <dd>the mixin type. A mixin is created with <code>potion_type_new()</code> referencing a parent type, and are handled with <code>PN_FLEX</code> macros.</dd>
72 </dl>
73 </div></body></html>
int main(int argc, char *argv[])
Definition: potion.c:263
root namespace, the global environment and parent class of all builtins.
a weak ref is used for upvals, it acts as a memory slot, non-volatile but mutable.
Definition: potion.h:488
PN potion_type_new(Potion *P, PNType t, PN self)
create a non-user type, derived from self
Definition: objmodel.c:212
the global interpreter state P. currently singleton (not threads yet)
Definition: potion.h:653
PN_FLEX(PNFlex, PN)
const char * name
Definition: compile.c:30