Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sxtanna/odin
Odin "programming" language
https://github.com/sxtanna/odin
Last synced: 23 days ago
JSON representation
Odin "programming" language
- Host: GitHub
- URL: https://github.com/sxtanna/odin
- Owner: Sxtanna
- Created: 2020-05-15T16:14:47.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T15:26:18.000Z (over 4 years ago)
- Last Synced: 2024-10-27T11:17:46.349Z (2 months ago)
- Language: Kotlin
- Homepage:
- Size: 324 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Example
-------
##### Keywords
```kotlin
type({Expr}) // returns the type of the result of the expression// standard out
push {Expr}// standard in
pull
pull::[{Type}] // pull a type
pull({Txt Prompt}) // pull with a promptpull::[{Type}]({Txt Prompt})
// properties
var // mutable reference
val // immutable reference// functions
fun // function// types
trait // interface like type
class // a class...// flow control
when ({Bit Expr}) // evaluator
else // failing case of whenloop ({Bit Expr}) // repeats a block of code
stop // cancels the repetition of a loop
```##### Property
```kotlin
val sansType = 10val withType: Int = 20
```##### Function
```kotlin
fun basic {
push "Basic Function"
}fun param(var0: Int) {
}fun params(var0: Int, var1: Txt) {
}
fun multiParams(var0, var1: Int) {
}
fun returns: Txt {
=> "Hey"
}
```##### Flow Control
```kotlin
// whenval num0 = pull::[Int]("1st number: ")
val num1 = pull::[Int]("2nd number: ")when (num0 > num1) {
push "First number is larger"
}when (num1 > num0) {
push "Second number is larger"
} else {
push "First number is equal or less"
}// loop
var count0 = 0
loop (count0++ < 10) {
push "Count = " + count0
}var count1 = 0
loop (true)
{
push "Count = " + count1when(count1++ > 10)
{
stop
}
}
```