[racket] keyword arguments for type constructors?

2014-06-06 Thread Alexander D. Knauth
Is there a way to define a type constructor that accepts keyword arguments? I know that things like the Class type constructor do this already, so is there a way to define something like this myself? The reason is I have a struct that represents a dimension (as in dimensional analysis and u

Re: [racket] Creating a module language extending typed/racket

2014-06-06 Thread Michael Ballantyne
Thanks! That gets me a little closer - to the next problem, at least. My module language provides some typed functions; when using those functions in my newly typed module language, the type checker complains that it doesn't have the type info. Any ideas? -> (module testimport typed/racket (:

Re: [racket] How to get arity of make-object? Found answer

2014-06-06 Thread Matthias Felleisen
You are correct. The case lambda will accept 1 2 or 3 args. The construction process may not accept 1 arg tomorrow On Jun 6, 2014, at 2:18 PM, Asumu Takikawa wrote: > On 2014-06-06 13:31:17 -0400, Matthias Felleisen wrote: >> I think we can get them in this sense: >> (arity-includes?

Re: [racket] How to get arity of make-object? Found answer

2014-06-06 Thread Asumu Takikawa
On 2014-06-06 13:31:17 -0400, Matthias Felleisen wrote: > I think we can get them in this sense: > > > > (arity-includes? (procedure-arity (case-lambda [(x) x][(x y) x][(x y z) > > > x])) 1) > > #t > > > (arity-includes? (procedure-arity (case-lambda [(x) x][(x y) x][(x y z) > > > x])) 3) > > #t

Re: [racket] How to get arity of make-object? Found answer

2014-06-06 Thread Matthias Felleisen
I think we can get them in this sense: > > (arity-includes? (procedure-arity (case-lambda [(x) x][(x y) x][(x y z) > > x])) 1) > #t > > (arity-includes? (procedure-arity (case-lambda [(x) x][(x y) x][(x y z) > > x])) 3) > #t > > (arity-includes? (procedure-arity (case-lambda [(x) x][(x y) x][(

Re: [racket] How to get arity of make-object? Found answer

2014-06-06 Thread Asumu Takikawa
On 2014-06-06 06:31:27 +0100, Matthew Flatt wrote: > Sorry for being so late to the discussion, but I agree that something > like `class-constructor-arity` and `class-constructor-arity-includes?` > should be added to `racket/class`. Are those even possible to implement? After all, I can construct

Re: [racket] How to get arity of make-object?

2014-06-06 Thread Matthias Felleisen
The new expression dos not designate an initial field value for x even though the contract says there must be one. You can also specify 'a as the initial value for x inside the class and the contract system won't tell you that your object does not have a correct field value. When you eventually

Re: [racket] How to get arity of make-object?

2014-06-06 Thread Robby Findler
What is wrong with this? Robby On Thu, Jun 5, 2014 at 8:13 PM, Matthias Felleisen wrote: > > class/c doesn't check inits properly: > > #lang racket > > (provide > (contract-out > [c% (class/c (init-field [x number?]))])) > > (define c% > (class object% > (field (x 10)) > (super-n

[racket] Final call for talk proposals: HOPE'14 (Workshop on Higher-Order Programming with Effects, affiliated with ICFP'14)

2014-06-06 Thread Neelakantan Krishnaswami
-- CALL FOR TALK PROPOSALS HOPE 2014 The 3rd ACM SIGPLAN Workshop on Higher-Order Programming with Effects August 31, 2014

Re: [racket] current-module-name-resolver and syntax/docprovide

2014-06-06 Thread Greg Hendershott
Thank you for the explanation Matthew, that all makes sense to me now. Racket Users list: http://lists.racket-lang.org/users