[racket] Stateless servlets and formlets error

2013-02-05 Thread Lorenz Köhl
The following servlet show an input field from a formlet and then tries to use formlet-process on the resulting request. I don't understand why this fails when, like below, the send/suspend and formlet-process is in a function but works when inlined, like the #; commented code in handle-html-for

Re: [racket] Typed Racket procedure wrapping?

2013-02-05 Thread Eric Dobson
I don't get why TR should use a custom contract instead of case-> providing better error messages. You get the same error message with: #lang racket (define/contract (f) (case->) 2) (f 2) ;(f) On Tue, Feb 5, 2013 at 8:10 PM, Matthias Felleisen wrote: > > On Feb 5, 2013, at 4:17 PM, Asumu Taki

Re: [racket] Typed Racket procedure wrapping?

2013-02-05 Thread Matthias Felleisen
On Feb 5, 2013, at 4:17 PM, Asumu Takikawa wrote: >> >> In 5.3.2, when running untyped.rkt, I get: >> >> #: arity mismatch; >>the expected number of arguments does not match the given number >> given: 1 >> arguments...: >> 5 > > I agree that this error message is bad. It's

Re: [racket] Cast in typed/racket/no-check

2013-02-05 Thread Vincent St-Amour
Fixed, thanks for the report! Vincent At Tue, 5 Feb 2013 16:06:12 -0500, Joe Gibbs Politz wrote: > > [1 ] > [1.1 ] > It seems like `cast` doesn't work at all in typed/racket/no-check: > > #lang typed/racket/no-check > > (cast 5 Number) > > ../../usr/lib/racket/collects/racket/contract/priv

Re: [racket] Typed Racket procedure wrapping?

2013-02-05 Thread Asumu Takikawa
On 2013-02-05 16:06:11 -0500, Joe Gibbs Politz wrote: >This worked in 5.3.1: > >typed.rkt >=== >#lang typed/racket > >(provide wrap) > >(define: (wrap (p : Procedure)) : Procedure >  (λ (_) p)) > >untyped.rkt >=== >#lang racket > >(require "ty

[racket] Cast in typed/racket/no-check

2013-02-05 Thread Joe Gibbs Politz
It seems like `cast` doesn't work at all in typed/racket/no-check: #lang typed/racket/no-check (cast 5 Number) ../../usr/lib/racket/collects/racket/contract/private/blame.rkt:89:0: 5: broke its contract promised: #f produced: 5 in: #f contract from: cast blaming: cast at: unsaved-editor108

[racket] Typed Racket procedure wrapping?

2013-02-05 Thread Joe Gibbs Politz
Question about a TR regression in 5.3.2 This worked in 5.3.1: typed.rkt === #lang typed/racket (provide wrap) (define: (wrap (p : Procedure)) : Procedure (λ (_) p)) untyped.rkt === #lang racket (require "typed.rkt") (define f (λ (n) n)) ((wrap f) 5) ;; returns f itself; f is e

Re: [racket] racket/db: fetching multiple rows with multiple columns in a "for" loop

2013-02-05 Thread Dmitry Pavlov
Thanks Pierpaolo, I did not know about that useful trick with call-with-values, missed it sometimes. Ryan, thanks! in-values-sequence did the trick perfectly. Regards, Dmitry On 02/05/2013 09:17 PM, Ryan Culpepper wrote: On 02/05/2013 11:57 AM, Dmitry Pavlov wrote: Hello, Suppose I have

Re: [racket] racket/db: fetching multiple rows with multiple columns in a "for" loop

2013-02-05 Thread Ryan Culpepper
On 02/05/2013 11:57 AM, Dmitry Pavlov wrote: Hello, Suppose I have the following code: (define conn (sqlite3-connect #:database "mydb.db" )) (for (((x y) (in-query c "SELECT X, Y FROM DATA"))) (displayln x) (displayln y)) in-query returns a sequence that gives two values at one call, and

Re: [racket] racket/db: fetching multiple rows with multiple columns in a "for" loop

2013-02-05 Thread Pierpaolo Bernardi
On Tue, Feb 5, 2013 at 5:57 PM, Dmitry Pavlov wrote: > Any hints will be much appreciated. Does the following help? (define (function-which-returns-an-unknown-number-of-values) (apply values (make-list (random 10) 'foo))) > (call-with-values function-which-returns-an-unknown-number-of-values

[racket] racket/db: fetching multiple rows with multiple columns in a "for" loop

2013-02-05 Thread Dmitry Pavlov
Hello, Suppose I have the following code: (define conn (sqlite3-connect #:database "mydb.db" )) (for (((x y) (in-query c "SELECT X, Y FROM DATA"))) (displayln x) (displayln y)) in-query returns a sequence that gives two values at one call, and the "for" loop binds those values to x and y r

Re: [racket] Racket v5.3.2

2013-02-05 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01-02-13 19:34, Matthew Flatt wrote: > At Fri, 01 Feb 2013 15:09:31 +0100, Marijn wrote: >> On 01-02-13 05:20, Eli Barzilay wrote: >>> Racket version 5.3.2 is now available from >>> >>> http://racket-lang.org/ >>> >>> * Documentation cross-referen