Skip to content

Instantly share code, notes, and snippets.

@captainbland
captainbland / main.rs
Last active November 3, 2018 17:54
Monte carlo pi estimation in rust
extern crate rand;
use rand::{thread_rng, Rng};
use std::f64;
struct Point {
pub x: f64,
pub y: f64
}
proc myIntProc(x: int, y: int): int = x*2
proc myIntProc(x: int): string = $x
template typeTest(myCall:untyped): untyped =
let something: int = myCall
when(compiles(typeTest(myIntProc(5, 5)))):
let a = myIntProc(5, 5)
else:
### Keybase proof
I hereby claim:
* I am jshulver on github.
* I am jshulver (https://keybase.io/jshulver) on keybase.
* I have a public key ASCRdeLuTrmfRDUdsYgrqTk3bNRkjjrLot04LPguFDc40Ao
To claim this, I am signing this object:
Input string: int* add(int *a, int b);
int NAME
* PTR
SPACE
add NAME
( BRACKET_OPEN
int NAME
SPACE
* PTR
a NAME