I hereby claim:
- I am brosenan on github.
- I am brosenan (https://keybase.io/brosenan) on keybase.
- I have a public key ASDsLHzZo2z937kJK2kzjxZNPW9xy3kERbjREvrHqKXw4wo
To claim this, I am signing this object:
#include <iostream> | |
template <typename T> | |
struct Print { | |
static void print() { | |
std::cout << T::val; | |
} | |
}; | |
template <int N> |
(ns foo) | |
(defn m-const [val] | |
(fn [state] | |
[state val])) | |
(defn m-do [& actions] | |
(if (= (count actions) 1) | |
(first actions) | |
; else |
I hereby claim:
To claim this, I am signing this object:
use std::mem; | |
type TreeRef<K, V> = Option<Box<Tree<K, V>>>; | |
struct Tree<K: PartialOrd, V> { | |
key: K, | |
val: V, | |
left: TreeRef<K, V>, | |
right: TreeRef<K, V> | |
} |
;; This is not really Clojure code. I used the .clj extention since it provides the closests syntax highlighting to this imaginary language. | |
(defabst constantly [?t] (-> ?t (-> ?t)) | |
(fn [c] | |
(fn [] | |
(copy c)))) | |
(deftype List [?t] | |
(::nil) | |
(::item ?t (List ?t))) |
use std::collections::HashMap; | |
use std::hash::Hash; | |
struct Memoize<F, T1, T2> where F: Fn(&T1) -> T2 { | |
cache: HashMap<T1, T2>, | |
func: F, | |
} | |
impl<F, T1, T2> Memoize<F, T1, T2> where F: Fn(&T1) -> T2, T1: Eq + Hash, T2: Clone { | |
fn new(func: F) -> Memoize<F, T1, T2> { |
#[derive(Debug)] | |
struct List<T> { | |
elem: T, | |
next: Option<Box<List<T>>>, | |
} | |
#[derive(Debug)] | |
struct Queue<T> { | |
tail: Option<Box<List<T>>>, | |
head: *mut Option<Box<List<T>>>, |
use std::ops::{Mul, Add}; | |
struct Parser { | |
parser: Box<Fn(&[u8], usize) -> Vec<usize>>, | |
} | |
fn empty() -> Parser { | |
Parser{parser: Box::new(|_s: &[u8], idx| vec![idx])} | |
} |
use std::collections::HashMap; | |
use std::sync::Arc; | |
#[derive(Clone)] | |
pub enum Value { | |
Num(f64), | |
Str(String), | |
Struct(HashMap<String, Arc<Value>>), | |
} |
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData( |