[racket] clarification for a Typed Racket error?

2012-01-05 Thread Erik Silkensen
Hi, I was wondering if someone could help me understand the problem with the following code? (struct: obj ([a : Integer] [b : Symbol])) (: f1? (obj Symbol -> Boolean)) (define (f1? o x) (and (= 0 (obj-a o)) (eq? x (obj-b o (: f2? (obj Symbol -> Boolean)) (define (f2? o x) (and (zer

Re: [racket] Teach yourself Racket in Fixnum Days?

2012-01-05 Thread Richard Cleis
Have you seen the tutorials? ... Quick:An Introduction to Racket with Pictures Continue: Web Applications in Racket More: Systems Programming with Racket rac On Jan 5, 2012, at 7:51 PM, Giuseppe Paleologo wrote: > I am a new Racket user. I am reading the Racket Guide, but I was wonder

[racket] Teach yourself Racket in Fixnum Days?

2012-01-05 Thread Giuseppe Paleologo
I am a new Racket user. I am reading the Racket Guide, but I was wondering if a shorter guide is available somewhere, perhaps not as comprehensive. Something like "Teach yourself Racket in Fixnum Days?" or "Core Racket", "Racket: the good parts" [I know, all Racket parts are good]. If not, I'll ke

Re: [racket] TR: scope of universally quantified type variables is ... very strange?

2012-01-05 Thread Sam Tobin-Hochstadt
On Thu, Jan 5, 2012 at 11:56 PM, John Clements wrote: > I wrote a piece of code like this without thinking: > > #lang typed/racket > > (: f (All (T) (Number -> T -> T))) > (define ((f x) y) >  (ann y T)) > > ... and then, after a second, was sort of flabbergasted that it worked.   > What's the sco

Re: [racket] TR: predicate for a Float ?

2012-01-05 Thread Sam Tobin-Hochstadt
On Fri, Jan 6, 2012 at 1:00 AM, John Clements wrote: > > Examining the difference between Inexact-Real and Float yields this: > >> (:type Float) > (U Float-Positive-Zero Float-Negative-Zero Float-Nan Positive-Float > Negative-Float) >> (:type Inexact-Real) > (U Float-Positive-Zero Float-Negative-

[racket] TR: predicate for a Float ?

2012-01-05 Thread John Clements
I'd like a predicate that checks whether a number is a Float. Here's what I tried: (: amplitudes/t (Listof Float)) (define amplitudes/t (cond [(andmap inexact-real? amplitudes) amplitudes] [(error 'impossible "Make TR happy")])) But

[racket] TR: scope of universally quantified type variables is ... very strange?

2012-01-05 Thread John Clements
I wrote a piece of code like this without thinking: #lang typed/racket (: f (All (T) (Number -> T -> T))) (define ((f x) y) (ann y T)) ... and then, after a second, was sort of flabbergasted that it worked. What's the scope of the type variable T? Apparently I can use it anywhere in the def

Re: [racket] scribble -> ePub/mobi?

2012-01-05 Thread Hendrik Boom
On Wed, Jan 04, 2012 at 11:03:13PM -0700, Ryan Culpepper wrote: > On 01/04/2012 09:51 PM, John Clements wrote: > >Has anyone taken a look at generating ePub or mobi documents directly > >from scribble? > > > >As the owner of a Kindle, I can see that pdf/dvi/ps is terrible for > >these kind of on-th

Re: [racket] XML library: representing CDATA

2012-01-05 Thread Jay McCarthy
I'm happy to take the code below as a patch. I think that would be the best thing to do in this case, because I don't really have anything else to add. Jay On Thu, 5 Jan 2012 18:07:47 +, Norman Gray mumbled: > Jay, hello. > On 4 Jan 2012, at 20:53, Jay McCarthy wrote: > >> In the XML mod

[racket] Compile seems to stall or hang.

2012-01-05 Thread J G Cho
Compiling racket-textual-5.2 (unix) on EC2 (CentOS), seems to stall around: a - ../foreign/foreign.o a - ../foreign/libffi/src/closures.o a - ../foreign/libffi/src/debug.o a - ../foreign/libffi/src/java_raw_api.o a - ../foreign/libffi/src/prep_cif.o a - ../foreign/libffi/src/raw_api.o a - ../forei

Re: [racket] XML library: representing CDATA

2012-01-05 Thread Norman Gray
Jay, hello. On 4 Jan 2012, at 20:53, Jay McCarthy wrote: >> In the XML module's cdata struct, "[t]he string field is assumed to >> be of the form with proper quoting of >> ‹content›." It's not clear that this is a very useful design of the >> interface. > >> Principally, it makes it inconveni

Re: [racket] XML library: representing CDATA

2012-01-05 Thread Norman Gray
John and Neil, hello. On 4 Jan 2012, at 03:47, John Clements wrote: > On Jan 3, 2012, at 3:09 PM, Neil Van Dyke wrote: > >> I don't know what the *stock* XML parsing does, but I have used Oleg >> Kiselyov's SSAX parser a lot in Racket-based production apps, and it does >> handle CDATA. [...]

Re: [racket] Q. about intent of TR wrt floats

2012-01-05 Thread Vincent St-Amour
At Thu, 5 Jan 2012 09:10:49 -0800, John Clements wrote: > I just had trouble with the type of log; I wanted to pass it a > positive real, and get back a Real. After inspecting the type, I see > that it works for Positive-Float. Is this deliberate, in order to get > more optimizable code (if the i

Re: [racket] why does TR stop printing helpful "type (:print-type ) to see more" message ?

2012-01-05 Thread Vincent St-Amour
At Thu, 5 Jan 2012 09:16:31 -0800, John Clements wrote: > It appears that TR only prints the message "[Use (:print-type > ) to see more.]" once. I think this is the wrong choice, and > that it should be printed every time. Once the user has seen that message once, he knows that there's a way to di

[racket] why does TR stop printing helpful "type (:print-type ) to see more" message ?

2012-01-05 Thread John Clements
It appears that TR only prints the message "[Use (:print-type ) to see more.]" once. I think this is the wrong choice, and that it should be printed every time. Totally unimportant, I know. Thanks! John Clements smime.p7s Description: S/MIME cryptographic signature

[racket] Q. about intent of TR wrt floats

2012-01-05 Thread John Clements
I just had trouble with the type of log; I wanted to pass it a positive real, and get back a Real. After inspecting the type, I see that it works for Positive-Float. Is this deliberate, in order to get more optimizable code (if the input is a float, we don't need to check it), or just an overs

Re: [racket] for/hash: bad syntax in: for/hash

2012-01-05 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04-01-12 16:55, Matthias Felleisen wrote: > > On Jan 4, 2012, at 10:40 AM, Marijn wrote: > >> Basically, my idea was to transform: >> >> (dependent-boxes ((a) (b (* 2 a)) (c (+ 2 a b >> >> into something which would automatically propagate c

Re: [racket] for/hash: bad syntax in: for/hash [and 1 more messages]

2012-01-05 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04-01-12 22:50, Eli Barzilay wrote: > 11 hours ago, Marijn wrote: >> It took me a while to understand what you're saying here, but if >> I am not mistaken you're saying that the result of the >> macro-expansion is a function-application with `let*'