Re: [racket] sad user face?

2012-02-21 Thread SF
If it's fair to compare a woman's situation in a mostly-men field to a man's situation in a mostly-women field... Then, mentally putting myself in such a situation, I would probably feel pretty strange going to a club of more than, say, 5 other people who were all women and trying to socialize wit

Re: [racket] Challenge: Game of life in 140 chars

2012-02-19 Thread SF
> Here's a 136-character version (after unnecessary spaces are removed): > > (define (life s) >  (let* ((a bitwise-and) >         (s (bitwise-ior (* s #x111000101000111/1000) s))) >    (a (* (a (- -1 s) (* s 4)) 3/32) >       (/ (- (expt 8 48) 1) 15 > > -- Jeremiah Willcock That doesn't wo

[racket] for/vector bug in typed racket

2012-02-19 Thread SF
#lang typed/racket ; this works (for/list: : (Listof Integer) ([i 5]) i) ; this doesn't (for/vector: : (Vectorof Integer) ([i 5]) i) error: Type Checker: Error in macro expansion -- insufficient type information to typecheck. please add more type annotations in: (for/vector: : (Vectorof

Re: [racket] Challenge: Game of life in 140 chars

2012-02-18 Thread SF
Here's a rough draft that has tons of room for improvement: #lang racket (define glider (string->number "#x\ 01\ 001000\ 111000\ 00\ 00\ 00\ ")) (define (life s) (define (c s n) (if (= -1 n) 0 (+ (if (bitwise-bit-set? 3080 (arithmetic-shift s (* -4 n)))

Re: [racket] Optimization; converting 'Float' to 'Fixnum' in Typed Racket

2012-02-18 Thread SF
On Sat, Feb 18, 2012 at 9:18 PM, Robby Findler wrote: > I'm not sure of the precise answer, but I don't think that all floats > (even the integers) have a corresponding fixnum. My C brain wonders why I can't just cast it to get the lower bits, I don't care about overflow. Using fixnum? does indee

[racket] Optimization; converting 'Float' to 'Fixnum' in Typed Racket

2012-02-18 Thread SF
I'm trying to optimize some code that processes a bunch of data, basically image pixels, which currently takes on the order of several seconds and seems like it should be much faster (important because it's an interactive application). Coming from C++ I have a good idea in my mind of how I'd write

[racket] 'Single-Flonum' error in Typed Racket

2012-02-18 Thread SF
Running this program in DrRacket... #lang typed/racket (provide (all-defined-out)) (: foo Single-Flonum) (define foo 1.0f0) ...gives me this error: expand: unbound identifier in module in: t:single-flonum? I don't know what it means or why it shows up when I try to provide all-defined-out. I've