Re: [racket] TR: too-narrow type in / ?

2015-02-03 Thread Vincent St-Amour
That kind of pattern in the type usually happens due to underflow. In this case, however, I don't see how it could cause problems. A frequent problem case is -0.0, which (for closure property reasons) is considered non-negative. But in this case, it's acceptable both as an input and as an output.

Re: [racket] Typed Racket: can this recursive typing become polymorphic?

2015-02-03 Thread J. Ian Johnson
What if A is (Listof Integer)? Generally a type variable naked in a union is just not going to do what you want. There's no way to keep it disjoint from the other types in the union. -Ian - Original Message - From: "Matthew Butterick" To: "users" Sent: Tuesday, February 3, 2015 7:29:47

[racket] Typed Racket: can this recursive typing become polymorphic?

2015-02-03 Thread Matthew Butterick
I'm trying to create a polymorphic type for `flatten` that reflects its usual behavior. This monomorphic version works: #lang typed/racket/base (require/typed rackunit [check-equal? (Any Any . -> . Any)]) (require/typed racket/list [flatten (All (A) (Rec as (U Integer (Listof as))) -> (Listof

Re: [racket] Syntax class patterns and nested attributes

2015-02-03 Thread Jack Firth
Is #:auto-nested-attributes documented anywhere? I can't seem to find it in the syntax class documentation On Tue, Feb 3, 2015 at 3:28 PM, Alexander D. Knauth wrote: > If you switch the order in which the syntax-classes are defined and add > #:auto-nested-attribustes, this works: > #lang racket

Re: [racket] Syntax class patterns and nested attributes

2015-02-03 Thread Alexander D. Knauth
If you switch the order in which the syntax-classes are defined and add #:auto-nested-attribustes, this works: #lang racket (require syntax/parse) (define-syntax-class B (pattern (b1 b2 b3))) (define-syntax-class A #:auto-nested-attributes (pattern (a1 a2:B a3))) (define foo (syntax-parser

[racket] TR: too-narrow type in / ?

2015-02-03 Thread John Clements
I'm dividing a Nonnegative-Real by an Index, and I want to get back a Nonnegative-Real. The type of / contains this clause: (-> Positive-Real Positive-Real * Nonnegative-Real) It appears to me that the first term here should be "Nonnegative-Real", rather than "Positive-Real"... that is, this type

[racket] Syntax class patterns and nested attributes

2015-02-03 Thread Jack Firth
Suppose I have these syntax classes: (define-syntax-class A (pattern (a1 a2:B a3))) (define-syntax-class B (pattern (b1 b2 b3))) I'd like to be able to access nested attributes, like so: (define foo (syntax-parser [blah:A #'blah.a2.b1])) Currently, this doesn't work (and it doesn't e

Re: [racket] How to reduce my Racket web server's memory usage?

2015-02-03 Thread George Neuner
Hi Jay, On 2/3/2015 8:10 AM, Jay McCarthy wrote: On Mon, Feb 2, 2015 at 5:06 PM, George Neuner wrote: there are 43 servlets and counting, plus several auxiliary threads and a large(ish) connection pool. Probably the number of servlets will double before I'm done.

Re: [racket] racket and lisp/scheme

2015-02-03 Thread Benjamin Greenman
Here's a quick overview of the name change (PLT Scheme -> Racket) from the Racket website: http://racket-lang.org/new-name.html On Sun, Feb 1, 2015 at 5:59 AM, Catonano wrote: > In what is racket different from Scheme ? > > I read that the racket language is a "descendent" of Lisp and Scheme > >