W
- Appeared in:
- 2013
- Influenced by:
- Typing discipline:
- File extensions:
- .w
- Versions and implementations (Collapse all | Expand all):
Elements of syntax:
| Inline comments | ? |
|---|---|
| Non-nestable comments | { ... } |
| Case-sensitivity | no |
| Variable assignment | variable = value |
| Variable declaration | item variable |
| Variable declaration with assignment | item variable = value |
| Block | [...] |
| Physical (shallow) equality | = |
| Comparison | = < > <= >= |
| If - then | if condition [...] |
| If - then - else | if condition [...] [...] |
| Loop forever | repeat [...] |
| For each value in a numeric range, 1 increment | repeat x [... x = x + 1 ...] |
| For each value in a numeric range, 1 decrement | repeat x [... x = x - 1 ...] |
Examples:
Factorial:
Example for versions W 0.0.1Repeat 15
[
Item x = 1
Repeat #
[
x = x * #
]
Type(x)
]
Hello, World!:
Example for versions W 1.1.0REF "Runtime.IO"
Type("Hello, World!")
Fibonacci numbers:
Example for versions W 1.1.0REF "Runtime.IO"
Item x = 1
Item y = 1
Type(x)
Repeat 15
[
Type(y)
Item z = x + y
x = y
y = z
]
Comments
]]>blog comments powered by Disqus
]]>