https://github.com/schultyy/orcrist
https://github.com/schultyy/orcrist
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/schultyy/orcrist
- Owner: schultyy
- License: mit
- Created: 2014-07-11T19:46:27.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-16T10:53:52.000Z (almost 12 years ago)
- Last Synced: 2025-04-06T23:35:29.846Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 482 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
orcrist
======
[](https://travis-ci.org/schultyy/orcrist)
# Usage
```bash
$ orcrist exec
```
## Methods
### Definition
```
def foo(a,b):
a + b
```
A method is defined with the `def` keyword, followed by an identifier and params. The colon indicates, that following lines are indented.
### Method call
`foo(a,b)` with params
`foo` without params. Parentheses are optional here.
Assign a method to a variable and call it:
```
def add(a,b):
a + b
my_add = add
my_add(1,2) #=> 3
```
### Assign to a variable
```
def foo(a,b):
a + b
add = foo
add(1,2)
```
# Basic type checking
When you do addition or subtraction, types are checked:
`3 - 4 # => ok`
`3 + 5 # => ok`
`3 + true # => Error`