Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
language [2018/11/01 13:54] 127.0.0.1 external edit |
language [2019/09/13 09:55] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
#+options: toc:nil | #+options: toc:nil | ||
+ | #+html: {{tag>language syntax}} | ||
* Language | * Language | ||
Line 27: | Line 28: | ||
Notice that CASM does not require symbol names to be declared before usage. | Notice that CASM does not require symbol names to be declared before usage. | ||
Inside the =HelloWorld= rule a [[./syntax#BlockRule][block rule]] creates a parallel execution semantics scope (line 4, 6). | Inside the =HelloWorld= rule a [[./syntax#BlockRule][block rule]] creates a parallel execution semantics scope (line 4, 6). | ||
- | Last but not least the actual statement to print out the ="Hello world!"= string defined by a [[./syntax#CallRule][call rule]] to a built-in function named =println=. | + | Last but not least the actual statement to print out the =Hello world!= string defined by a [[./syntax#CallRule][call rule]] to a built-in function named =println=. |
CASM does not require any newlines, tabulators, or statement separators like in other specification or programming languages. | CASM does not require any newlines, tabulators, or statement separators like in other specification or programming languages. | ||
- | As example the following /Hello World/ application is equivalent to the one given above. | ||
- | #+html: <callout type="info" icon="fa fa-code"> | ||
- | The inline version of the /Hello World/ application specified in CASM: | ||
- | #+begin_src casm -n | ||
- | CASM init HelloWorld rule HelloWorld println( "Hello world!" ) | ||
- | #+end_src | ||
- | #+html: </callout> | ||
TBA | TBA | ||
Line 44: | Line 38: | ||
TBA | TBA | ||
+ | |||
+ | # #+html: <callout type="info" icon="fa fa-code"> | ||
+ | # The following example defines a binary function named =phoneBook= with a | ||
+ | # given type relation $x : String * String \rightarrow String$ to store | ||
+ | # telephone number strings identified by a last and first name string: | ||
+ | # #+begin_src casm | ||
+ | # function phoneBook : String * String -> String | ||
+ | # #+end_src | ||
+ | # #+html: </callout> | ||
+ | |||
** Rules | ** Rules |