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
#lang racket | |
(require (for-syntax racket syntax/parse racket/syntax syntax/id-table)) | |
(begin-for-syntax | |
(define macro-table (make-free-id-table)) | |
(define (expand-macro id stx) | |
(define transformer (syntax-local-value id)) |
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
#lang racket | |
(require (for-syntax racket syntax/parse racket/syntax syntax/id-table)) | |
(begin-for-syntax | |
(define macro-table (make-free-id-table)) | |
(define (expand-macro id stx) | |
(define transformer (syntax-local-value id)) |
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
#lang at-exp racket | |
; For in source documentation: | |
(require racket/contract | |
scribble/srcdoc | |
(for-doc racket/base | |
scribble/manual)) | |
(require rackunit) | |
(require plot) |
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
#reader(lib"read.ss""wxme")WXME0108 ## | |
#| | |
This file uses the GRacket editor format. | |
Open this file in DrRacket version 5.3.1 or later to read it. | |
Most likely, it was created by saving a program in DrRacket, | |
and it probably contains a program with non-text elements | |
(such as images or comment boxes). | |
http://racket-lang.org/ |
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
#lang racket | |
(require math/number-theory) | |
(define limit 28123) | |
(define (is-abundant? n) | |
(> (- (apply + (divisors n)) n) n)) | |
(define abundants |
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 Trait { | |
fn method( &self ); | |
} | |
struct Simple; | |
impl Trait for Simple { |
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 imap<A,B>( i : ~Iterator<A>, f : &fn(A)->B ) { i.map(f) } | |
fn main () {} | |
/* | |
iter.rs:1:50: 1:60 error: type `~std::iterator::Iterator<A>:Send` does not implement any method in scope named `map` | |
iter.rs:1 fn imap<A,B>( i : ~Iterator<A>, f : &fn(A)->B ) { i.map(f) } | |
^~~~~~~~~~ | |
error: aborting due to previous error | |
*/ |
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
priv use std::prelude::*; | |
priv extern mod std; | |
/* This version works: */ | |
// Box{ unbox : b.unbox.clone() } | |
/* This version doesn't: */ |
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 main (){} | |
#[deriving(Clone)] | |
struct Box<T>{unbox:@T} | |
fn op<T>( b : Box<T> ) -> Box<T> { | |
/* This version works: */ | |
// Box{ unbox : b.unbox.clone() } |
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 Thing<T> { | |
fn ignore(self) -> (); | |
} | |
impl<T> Thing<T> for () { | |
fn ignore(self) -> () { self } | |
} | |
fn main () { |
NewerOlder