[racket] mac plot crash

2010-11-08 Thread Richard Mittel
Hi, I have a module that begins with (require 2htdp/image) and (require (prefix-in plot: plot)). When I require the module on a Mac, I get: ffi-lib: couldn't open "Volumes/Racket v5.0.1/Racket v5.0.1/collects/plot/compiled/native/i386-macosx/libfit.dylib" (dlopen(/Volumes/Racket v5.0.1/Racket v5

Re: [racket] a small programming exercise

2010-10-14 Thread Richard Mittel
Code is below. There's something stupidly verbose about the way I extract the first digit, so suggestions are welcome. (define (count-firsts d) (let ((c (make-vector 9 0))) (let loop ((d d)) (if (null? d) (let* ((cl (vector->list c)) (sum (exact->inexact (apply + cl

Re: [racket] stumped by a little macro exercise

2010-10-09 Thread Richard Mittel
Yes, you're right; thanks for the clarification. I'll assume the answer to my macro-literals question is yes. On Sat, Oct 9, 2010 at 3:47 PM, Shriram Krishnamurthi wrote: > After two steps, do you not get something that looks like this? > > [image: mtc.png] > > The two mtc's are in different col

Re: [racket] stumped by a little macro exercise

2010-10-09 Thread Richard Mittel
I tried this, and I'm not sure things played out as you said. After walking the Macro Stepper through "(cas-cad-e 2 ((1) 3))," I saw the unbound identifier error without really seeing two different colorings of mtc. But no big deal: I obviously don't understand hygiene as well as I thought I did,

[racket] stumped by a little macro exercise

2010-10-09 Thread Richard Mittel
Hi, In trying to take up the fall-through case challenge in "a little macro exercise," I came up with this so far: (define-syntax cas-cad-e (syntax-rules (break go!) ((_ go! v () a) (let ((mtc #f)) (call/cc (lambda (break) . a ((cas-cad-e go! v (((bv ...) . b) . r) (a ...)) (ca

[racket] buffer mode

2010-08-15 Thread Richard Mittel
I'm trying to get read-char to read a character as soon as it is typed, but read-char insists on buffering the input until a carriage return is entered. The Racket reference says that the buffer mode is controlled by file-stream-buffer-mode, but it seems to have no effect. (More confusingly, the