Files
Sheerka-Old/docs/syntax_v2.md
T
2019-10-29 18:39:51 +01:00

39 lines
857 B
Markdown

```
def concept one as 1 --> creates a new concept 1
def concept two as 2 --> creates a new concept 2
def concept add(a,b) as a + b --> create concept that need parenthesis
def concept a plus b as add(a,b) --> create a concept that mimic human language
one plus two --> recognizes the concept 'a plus b'
one plus two ? --> makes the addition
concept a plus b --> will work on this concept
pre: a is a number
--> ERROR : 'a is a number' is not known
def concept a is a number as :
isinstanceof(a, number)
--> adds concept a is a number
--> add the pre condition to the concept a plus b
```
# Define a new concept in one line
```
def concept words
def concept words [where whereclause] [as expression] [pre precond] [post postcond]
```
# Define a complicated concept
```
def concept
as:
...
where:
...
pre:
...
post:
...
```