Jump to content

Category:Arturo: Difference between revisions

no edit summary
No edit summary
Line 16:
====Everything is a simple statement====
 
There are no "special" language constructs (''*even <code>`if</code>` is nothing but a simple statement''*). Everything you see is a statement in the form <code>ID <expression> <expression> <expression> ...</code>. An assignment is nothing but a labeled statement. <code>LABEL: <statement></code>
<br>
====Code is data - and data is code====
Line 32:
====Uniform syntax====
 
There are 3 types of statements.
As already mentioned, everything is a statement of the form `ID <expressions>`. So, how does this work?
- Simple statements, that work as a function call in the form of <code>ID <expressions></code>
- Expressions (Yes, <code>1+2</code> is also a valid statement)
- Labeled statements (see: assignments) like <code>a: 2</code>
 
*Pro tip: Do you want to use the result of a function callstatement as part of an expression? Just enclose the function call in square brackets <code>$([...)]</code> E.g.: <code>print $([reverse #(1 2 3))]</code>
* Is the ID a new or non-function existing symbol? Then, the right-hand value will be assigned to it
* Is it a function? Then it will be called, with the right-hand values as arguments
* Do you want to use the result of a function call as part of an expression? Just enclose the function call in <code>$(...)</code> E.g.: <code>print $(reverse #(1 2 3))</code>
 
===Implementation===
1,532

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.