This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(macro_rules)] | |
//tested on: | |
//rustc 0.10 | |
//host: x86_64-unknown-linux-gnu | |
use std::to_str::ToStr; | |
macro_rules! make_range_int_type( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Primes{ | |
current: u64, | |
prev: Vec<u64> | |
} | |
impl Primes{ | |
fn new() -> Primes { | |
Primes { current: 1, prev: Vec::new()} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT = 'INPUT CODE > ' | |
PROMPT_SIMPLE = ' > ' | |
def eval_code(code): | |
was_expression = True | |
try: | |
try: | |
return eval(code, locals(), globals()), was_expression | |
except SyntaxError: | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# single line 255 char repl | |
l={};e=lambda s:exec("import traceback;\ntry:\n try:\n l['_']=eval(s,globals(),l)\n except SyntaxError:\n l['_']=exec(s,globals(),l)\nexcept Exception: traceback.print_exc()") or (l['_'] if l['_']!=None else '');list(print(e(input('>'))) for _ in range(99)) |