mirror of
https://github.com/zeroflag/fcl.git
synced 2025-01-12 20:01:25 +01:00
Update README.md
This commit is contained in:
parent
ba61adf5c9
commit
fcdb9cc11b
1 changed files with 9 additions and 9 deletions
18
README.md
18
README.md
|
@ -25,7 +25,7 @@ General form of `if else then`.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
```forth
|
```forth
|
||||||
: max ( a b -- max )
|
: max ( n n -- n )
|
||||||
2dup < if nip else drop then ;
|
2dup < if nip else drop then ;
|
||||||
|
|
||||||
10 100 max . \ prints 100
|
10 100 max . \ prints 100
|
||||||
|
@ -45,15 +45,15 @@ The `else` part is optional.
|
||||||
FCL supports switch-case like flow control logic as shown in the following example.
|
FCL supports switch-case like flow control logic as shown in the following example.
|
||||||
|
|
||||||
```forth
|
```forth
|
||||||
: day ( n -- )
|
: day ( n -- s )
|
||||||
case
|
case
|
||||||
1 of print: 'Monday' endof
|
1 of 'Monday' endof
|
||||||
2 of print: 'Tuesday' endof
|
2 of 'Tuesday' endof
|
||||||
3 of print: 'Wednesday' endof
|
3 of 'Wednesday' endof
|
||||||
4 of print: 'Thursday' endof
|
4 of 'Thursday' endof
|
||||||
5 of print: 'Friday' endof
|
5 of 'Friday' endof
|
||||||
6 of print: 'Saturday' endof
|
6 of 'Saturday' endof
|
||||||
7 of print: 'Sunday' endof
|
7 of 'Sunday' endof
|
||||||
drop 'Unknown'
|
drop 'Unknown'
|
||||||
endcase ;
|
endcase ;
|
||||||
````
|
````
|
||||||
|
|
Loading…
Reference in a new issue