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
(define-reagent (push s x) | |
(read-match s | |
[xs (update-to! (cons x xs))])) | |
; --generates-> | |
(define (push s x) | |
(let retry40 () | |
(let ([b41 (atomic-ref-box s)] | |
[ov42 (unsafe-unbox* b41)]) |
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
; when compiled, does this code ... | |
(define (abs x) | |
(define (f) | |
(if (> x 0) x (g)) | |
(define (g) | |
(- 0 x)) | |
(f)) | |
; ... turn into this code? |
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
abbreviated | |
abnormality | |
abrogate | |
absent | |
absolute | |
abusive | |
academically | |
accommodate | |
accompany | |
accompanying |
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
signature PARSER = | |
sig | |
type token | |
val exampleToks: token list | |
type span = (int * int) | |
type 'stream lexer = 'stream -> token * span * 'stream | |
type result | |
exception ParseError of span | |
val parse: 'stream lexer -> 'stream -> result |
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
implicit def str2toInt(s: String): { def toInt: Int } = new { | |
def toInt: Int = java.lang.Integer.parseInt(s) | |
} |
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
trait AsRef<T: ?Sized> { | |
fn convert_as_ref(&self) -> &T; | |
} | |
trait Into<T> { | |
fn convert_into(self) -> T; | |
} | |
trait From<T> { | |
fn from(T) -> Self; |
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
// As lifts over Deref | |
impl<D: ?Sized + Deref, U: ?Sized> AsRef<U> for D where D::Target: AsRef<U> { | |
fn as_ref(&self) -> &U { | |
self.deref().as_ref() | |
} | |
} |
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
trait Rand<Distribution> { | |
type Stream: RandStream<T>; | |
fn rand(dist: Distribution) -> Stream; | |
} | |
trait RandStream<T> { | |
fn next<R: Rng>(&self, rng: &mut R) -> T; | |
} | |
impl Rand<Range<u32, u32>> for u32 { |
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
trait Rand<Rng, Distribution> { | |
type Iter: Iterator<Item = Self>; | |
fn rand(rng: Rng, dist: Distribution) -> Iter; | |
} |
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
fn nonparametric<T: 'static>(t: T) { | |
let b: Box<Any> = box t; | |
match b.downcast::<SomeConcreteType>() { | |
... | |
} | |
} |
NewerOlder